开发者

Is there a way to do this with Auto Properties?

I have code that looks something like this:

Card m_currentCard;
public Card CurrentCard {
    get { return m_currentCard; }
    set {
        m_currentCard = value;
        QuestionLabel.Text = CurrentCard.Question;
    }
}

It doesn't do anything special in terms of getting and setting the value of the property, but it does something additional when setting the property. Am I stuck using a separate variable,开发者_如何学JAVA or is there a way to do this with auto properties?


It is not possible to do that using automatically implemented properties.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜