开发者

C# SQLMetal generated code

开发者 https://www.devze.com 2023-03-02 19:05 出处:网络
Hei, SQLMetal generates code like this: [Column(Storage = \"_specimen\", DbType = \"VarChar(100)\")] public string Specimen

Hei, SQLMetal generates code like this:

    [Column(Storage = "_specimen", DbType = "VarChar(100)")]
    public string Specimen
    {
        get
        {
            return this._specimen;
        }
        set
        {
            if ((thi开发者_运维百科s._specimen != value))
            {
                this.OnSpecimenChanging(value);
                this.SendPropertyChanging();
                this._specimen = value;
                this.SendPropertyChanged("specimen");
                this.OnSpecimenChanged();
            }
        }
    }

What are the OnSpecimenChanging and all those methods do? And does the specimen from thethis.SendPropertyChanged("specimen"); has to be allso capitalized or its not case sensitive?


It's hard to say what they do exactly without seeing any source code. SendPropertyChanged is most likely used to raise the PropertyChanged event, which will notify any subscribers to the event that a particular property has changed. The PropertyName string in PropertyChangedEventArgs is case sensitive, so the S will need to be capitalised.

For more information:

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

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

0

精彩评论

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