2011-05-05 4 views
0

Hei, SQLMetal génère du code comme ceci:C# SQLMetal code généré

[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(); 
      } 
     } 
    } 

Quels sont les OnSpecimenChanging et toutes ces méthodes font? Et le spécimen du this.SendPropertyChanged("specimen"); doit-il être en majuscules ou n'est-il pas sensible à la casse?

Répondre

0

Il est difficile de dire exactement ce qu'ils font sans voir le code source. SendPropertyChanged est probablement utilisé pour déclencher l'événement PropertyChanged, qui informera les abonnés de l'événement qu'une propriété particulière a été modifiée. La chaîne PropertyName dans PropertyChangedEventArgs est sensible à la casse, donc le S devra être mis en majuscule.

Pour plus d'informations:

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

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

Questions connexes