mardi 20 septembre 2016

C# getter/setter behaviour in template pattern

I am new at C# and I want to use the template pattern. I am wandering how the get set operation behave. Does the default getter execute before op1 or after? Does the default setter execute before op2 or after?

public class C : B {
    public void AMethod(bool b){
        MyBool = b;
    }
}

public interface B {
    bool MyBool
        {get;
         set;}
}

public abstract class A : B {
    public bool MyBool {
        get {op1();}
        set {op2();}
    }
}

Aucun commentaire:

Enregistrer un commentaire