A
alp
Hi,
I've got a class constructor that takes
public Foo(int a, MyString b)
MyString type has an implicit operator for string so I can call this
from code with Foo f = new Foo(1, "hello");
However i'd like to programmatically call the constructor using
Activator.CreateInstance(typeof(Foo), new object[] { 1, "hello" })
This doesn't work because the constructor is of type MyString, and the
CreateInstance Binder is looking for a type string. Is there anyway to
get the Binder to just 'use' the params I pass in, or at least to see
if there is a possible implicit type conversion possible???
Cheers,
Al
I've got a class constructor that takes
public Foo(int a, MyString b)
MyString type has an implicit operator for string so I can call this
from code with Foo f = new Foo(1, "hello");
However i'd like to programmatically call the constructor using
Activator.CreateInstance(typeof(Foo), new object[] { 1, "hello" })
This doesn't work because the constructor is of type MyString, and the
CreateInstance Binder is looking for a type string. Is there anyway to
get the Binder to just 'use' the params I pass in, or at least to see
if there is a possible implicit type conversion possible???
Cheers,
Al