Beispiel #1
0
 public static bool SetObject <T>(this IProjectItem notifier, ref T oldValue, ref T newValue, string propertyName)
     where T : class
 {
     if (oldValue == null && newValue == null)
     {
         return(false);
     }
     if (oldValue == null || (newValue == null || !oldValue.Equals(newValue)))
     {
         oldValue = newValue;
         notifier.NotifyPropertyChanged(propertyName);
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 public static bool SetStruct <T>(this IProjectItem notifier, ref T oldValue, ref T newValue, string propertyName)
     where T : struct
 {
     try
     {
         if (!oldValue.Equals(newValue))
         {
             oldValue = newValue;
             notifier.NotifyPropertyChanged(propertyName);
             return(true);
         }
     }
     catch (Exception ee)
     {
         Console.WriteLine("exeption :" + ee.Message);
     }
     return(false);
 }
Beispiel #3
0
 public static bool SetObject(this IProjectItem notifier, string propertyName)
 {
     notifier.NotifyPropertyChanged(propertyName);
     return(true);
 }