2011-05-05 79 views
0

喜,SQLMetal產生這樣的代碼:C#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");的樣本是否必須全部大寫或不區分大小寫?

回答

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