0

嘿,SQLMetal 生成如下代码:

    [Column(Storage = "_specimen", DbType = "VarChar(100)")]
    public string Specimen
    {
        get
        {
            return this._specimen;
        }
        set
        {
            if ((this._specimen != value))
            {
                this.OnSpecimenChanging(value);
                this.SendPropertyChanging();
                this._specimen = value;
                this.SendPropertyChanged("specimen");
                this.OnSpecimenChanged();
            }
        }
    }

OnSpecimenChanging所有这些方法是做什么的?来自的样本this.SendPropertyChanged("specimen");是否必须全部大写或不区分大小写?

4

1 回答 1

0

如果没有看到任何源代码,很难说出他们到底做了什么。SendPropertyChanged 最有可能用于引发 PropertyChanged 事件,该事件将通知事件的任何订阅者特定属性已更改。PropertyChangedEventArgs 中的 PropertyName 字符串区分大小写,因此 S 需要大写。

了解更多信息:

http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx

http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanging.aspx

于 2011-05-05T08:09:47.337 回答