예제 #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);
 }
예제 #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);
 }
예제 #3
0
 public static bool SetObject(this IProjectItem notifier, string propertyName)
 {
     notifier.NotifyPropertyChanged(propertyName);
     return(true);
 }