R
Ram
Hi Friends
I want to develope a custom control in .net which can be used with any
project. I am writing a function in that class which I want to take any
object as parameter. For that I have used Object class as parameter.
Now it can take any object as its parameter. But the problem is that I
want to access the values of the private or public member variables of
the passed object, for which I may have to typecast the Object class
variable into appropriate class but I can't do so coz I dont't have the
dll of the classes whose object will be passed to the function.
how can I do that.
Let me clarify the situation.
In the control I have a function like Script(Object obj)
public void Script(Object obj)
{
}
Now suppose there is a class called Mail which may be defined in any
assembly I don't know.
class mail
{
public MailId;
public Name;
}
now suppose the object of this class is passed to the Function script.
Now how can I access the values of MailId and Name in my function
script as I dont't have anyway to typecast the Object class into mail
class coz I don't have the dll for the mail class.
Thanks in advance.
Ram
I want to develope a custom control in .net which can be used with any
project. I am writing a function in that class which I want to take any
object as parameter. For that I have used Object class as parameter.
Now it can take any object as its parameter. But the problem is that I
want to access the values of the private or public member variables of
the passed object, for which I may have to typecast the Object class
variable into appropriate class but I can't do so coz I dont't have the
dll of the classes whose object will be passed to the function.
how can I do that.
Let me clarify the situation.
In the control I have a function like Script(Object obj)
public void Script(Object obj)
{
}
Now suppose there is a class called Mail which may be defined in any
assembly I don't know.
class mail
{
public MailId;
public Name;
}
now suppose the object of this class is passed to the Function script.
Now how can I access the values of MailId and Name in my function
script as I dont't have anyway to typecast the Object class into mail
class coz I don't have the dll for the mail class.
Thanks in advance.
Ram