嘿,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");中的样本必须全部大写还是不区分大小写?
发布于 2011-05-05 16:09:47
在没有看到任何源代码的情况下,很难说它们到底做了什么。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
https://stackoverflow.com/questions/5893751
复制相似问题