Beispiel #1
0
 private void View_getAllElements <elementType>
     (IErrorable windowInterface, ICommunicative windowCommunicator)
     where elementType : Communicator.CommunicatorElement <elementType>
 {
     new Task(() => {
         try
         {
             windowCommunicator.ReturnListOfObjects(model.GetAllElements <elementType>().OfType <object>().ToList());
             windowCommunicator.PushNotification(goodGettingResult, 0);
         }
         catch (Exception ex)
         {
             windowCommunicator.PushNotification(badGettingResult, 2);
             windowInterface.ShowError(ex.Message, ex.HelpLink, errorableTitle);
         }
     }).Start();
 }
Beispiel #2
0
 private void View_removeListOfElements <elementType>
     (IErrorable windowInterface, ICommunicative windowCommunicator, List <elementType> itemsToRemove)
     where elementType : Communicator.CommunicatorElement <elementType>
 {
     new Task(() =>
     {
         try
         {
             model.RemoveListOfElements <elementType>(itemsToRemove);
             windowCommunicator.PushNotification(goodRemovingResult, 0);
         }
         catch (Exception ex)
         {
             windowCommunicator.PushNotification(badRemovingResult, 2);
             windowInterface.ShowError(ex.Message, ex.HelpLink, errorableTitle);
         }
     }).Start();
 }
Beispiel #3
0
 private void View_insertElement <elementType>
     (IErrorable windowInterface, ICommunicative windowCommunicator, elementType newItem)
     where elementType : Communicator.CommunicatorElement <elementType>
 {
     new Task(() =>
     {
         try
         {
             model.InsertElement <elementType>(newItem);
             windowCommunicator.PushNotification(goodInsertingResult, 0);
         }
         catch (Exception ex)
         {
             windowCommunicator.PushNotification(badInsertingResult, 2);
             windowInterface.ShowError(ex.Message, ex.HelpLink, errorableTitle);
         }
     }).Start();
 }
Beispiel #4
0
 private void View_find <elementType>
     (IErrorable windowInterface, ICommunicative windowCommunicator, int elementID)
     where elementType : Communicator.CommunicatorElement <elementType>
 {
     new Task(() =>
     {
         try
         {
             elementType tmp = model.Find <elementType>(elementID);
             //windowCommunicator.ReturnObject((object)tmp);
             windowCommunicator.PushNotification(goodGettingResult, 0);
         }
         catch (Exception ex)
         {
             windowCommunicator.PushNotification(badGettingResult, 2);
             windowInterface.ShowError(ex.Message, ex.HelpLink, errorableTitle);
         }
     }).Start();
 }