Dear C# wizzards out there ...
I want to achieve a maximum of programming/usage comfort and still keep changes locally. Therfore I would like my class to copy the interface of a member object and forward all Property calls to the respective object.
Instead of:
I would like to achieve something like the following PSEUDOCODE.
Does anybody know how to achieve this in C#? Maybe with ComponentModel, Reflection and/or Assembly.
Any help would be greatly appreciated!
Thanks, Aperion
I want to achieve a maximum of programming/usage comfort and still keep changes locally. Therfore I would like my class to copy the interface of a member object and forward all Property calls to the respective object.
Instead of:
Code:
class MyClass
{
MyMemberClass memb;
int Prop1
{
get{return memb.Prop1;}
set{memb.Prop1=value;}
}
string Prop2
{
get{return memb.Prop2;}
set{memb.Prop2=value;}
}
// ...
}
I would like to achieve something like the following PSEUDOCODE.
Code:
MyClass.Properties.Add(MyMemberClass.Properties)
foreach (Property prop in MyMemberClass memb)
{
// pass property calls to member
get {return memb.prop;}
set {memb.prop = value;}
}
Does anybody know how to achieve this in C#? Maybe with ComponentModel, Reflection and/or Assembly.
Any help would be greatly appreciated!
Thanks, Aperion