本文整理汇总了C#中INotifyPropertyChanged.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# INotifyPropertyChanged.ToString方法的具体用法?C# INotifyPropertyChanged.ToString怎么用?C# INotifyPropertyChanged.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INotifyPropertyChanged
的用法示例。
在下文中一共展示了INotifyPropertyChanged.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setPropertyChanged
private void setPropertyChanged(INotifyPropertyChanged businessClass)
{
try
{
businessClass.PropertyChanged -= businessClassPropertyChanged;
businessClass.PropertyChanged += businessClassPropertyChanged;
_controlPropertyChanged.Add(businessClass);
var properties = businessClass.GetType().GetProperties();
foreach (var t in properties)
{
try
{
var valore = t.GetValue(businessClass, null);
var key = valore as INotifyPropertyChanged;
if (key != null)
{
key.PropertyChanged -= businessClassPropertyChanged;
key.PropertyChanged += businessClassPropertyChanged;
_controlPropertyChanged.Add(key);
if (businessClass is BaseDTOOfint && !_businessRelations.ContainsKey(key))
_businessRelations.Add(key, (BaseDTOOfint)businessClass);
setPropertyChanged(key);
}
}
catch (Exception ex)
{
_log.ErrorFormat("Errore inaspettato nel set della proprietà - SINGOLA PROPRIETA' - {0} - proprietà:{1} - class:{2} - azienda:{3}", ex, Utility.GetMethodDescription(), t.ToString(), businessClass.ToString(), Login.Instance.CurrentLogin().Azienda);
throw;
}
}
}
catch (Exception ex)
{
_log.ErrorFormat("Errore inaspettato nel set della proprietà - {0} - class:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), businessClass.ToString(), Login.Instance.CurrentLogin().Azienda);
throw;
}
}