mardi 9 février 2016

get operator left-hand-side member name inside opertator method in C#

I am writing an implicit assignment operator overload method in c#. I need to determine the member name of the left-hand-side of the assignment Operator, possibly by reflection, for use within the body of the operator's method.

    public static implicit  operator SetPropertyOnce<T>(Property<T> value)
{
    return new SetPropertyOnce<T>(value, operator_left_hand_side_membername);
}





Aucun commentaire:

Enregistrer un commentaire