Ejemplo n.º 1
0
 public Task <ResponseMessage> SendHistory(History history)
 {
     if (APIInvalid)
     {
         LastCallResult = NetworkResult.AuthenticationFailed;
         return(Task.FromResult(new ResponseMessage()
         {
             IsSuccess = false
         }));
     }
     if (FailNetwork)
     {
         LastCallResult = NetworkResult.NetworkError;
         throw new IOException();
     }
     if (UnknownError)
     {
         LastCallResult = NetworkResult.UnknownError;
         throw new Exception("ups");
     }
     if (history != null)
     {
         HistoryEvents.AddRange(history.Events);
         HistoryActions.AddRange(history.Actions);
     }
     LastCallResult = NetworkResult.Success;
     return(Task.FromResult(new ResponseMessage()
     {
         IsSuccess = true
     }));
 }
 private void ShowSelectEventsByGraphic(IEnumerable <Graphic> graphics)
 {
     SelectHistoryEvents = new ObservableCollection <HistoryEvent>(HistoryEvents.Where(p =>
     {
         return(graphics.Where(g => (int)g.Attributes["EventId"] == p.HistoryEventId).Count() > 0);
     }));
     foreach (var graphic in graphics)
     {
         graphic.IsSelected = true;
     }
     new SelectEventsDialog().ShowDialog();
 }
Ejemplo n.º 3
0
 public HistoryEvents GetHistoryEvents(byte[] result)
 {
     return(HistoryEvents.ParseFrom(result));
 }