This may seem a little complicated, but I will try to explain it clearly.
Is this possible in C # if I have a long interface:
public interface IInterface
{
bool interface_1;
bool interface_2;
bool interface_3;
bool interface_4;
bool interface_5;
...
}
And the class that implements the interface
public class MyClass : IInterface
{
...
}
Imagine I have an IInterface object myInterface, is there a way to create a MyClass object myClass and set all myClass fields to one of myInterface without setting all the fields one after the other. For instance:
IInterface myInterface;
MyClass myClass;
myClass.SetIInterface(myInterface);
source
share