예제 #1
0
        void ObjectsItemEndEdit(IEditableObject sender)
        {
            ExcludingPlantsViewModel UIObject = sender as ExcludingPlantsViewModel;

            try
            {
                if (UIObject.Plant1 != null && UIObject.Plant2 != null)
                {
                    ExcludingPlantsDataAccess.UpdateObject(UIObject.GetDataObject());
                }
            }
            catch
            {
                throw;
            }
        }
예제 #2
0
 void ObjectsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         try
         {
             foreach (object item in e.OldItems)
             {
                 ExcludingPlantsViewModel UIObject = item as ExcludingPlantsViewModel;
                 if (UIObject.Plant1 != null && UIObject.Plant2 != null)
                 {
                     ExcludingPlantsDataAccess.DeleteObject(UIObject.GetDataObject());
                 }
             }
         }
         catch (Exception ex)
         {
             log.Error(ex.StackTrace);
         }
     }
 }