If I have
public class ClassA
{
public static IEnumerable<string> WhateverA { get; set; }
}
and also
public class ClassB
{
public static IEnumerable<string> WhateverB { get; set; }
}
Is it possible to obtain a reference to ClassA.WhateverA
and assign it to ClassB.WhateverB
such that if WhateverA
is later assigned a value, WhateverB
will consequently be assigned the same?
If I was looking to do the same with methods then I could declare WhateverB
as an Action
and then assign WhateverA
as a delegate, thus giving it a kind of 'pass-through' capability. Is it possible to do the same with a property such that WhataverB
always shows the value of WhateverA
?
Aucun commentaire:
Enregistrer un commentaire