I have one class named A and one class B
public class A : UserControl { }
public class B : UserControl { }
Now I have one assembly whose class function accepts objects of class A. This assembly is not created by me, so I have no control. This is mainly an assembly of third-party manufacturers.
But I want to provide my objects of class B, since it is customized. Be sure that it contains all the properties of class A. How can I give my class B object to type A so that I can integrate a third-party assembly into my project, as well as customize the look to suit my needs?
If I feel like something (A)objB, this is unacceptable. Then I tried this:
UserControl control = objB as UserControl;
A objA = control as A;
But the problem in this case is objA null.
To avoid confusion: Class A and assembly are provided by a third party.
Thanks in advance:)