public override TaskStatus Execute() { TaskStatus status = TaskStatus.Success; foreach (Task task in Tasks) { try { TaskStatus thisStatus = task.Execute(); if (thisStatus == TaskStatus.Failure) { MessagesList.AddRange(task.Messages); return(TaskStatus.Failure); } else if (thisStatus == TaskStatus.Warning) { MessagesList.AddRange(task.Messages); status = TaskStatus.Warning; } } catch (Exception ex) { MessagesList.AddRange(task.Messages); MessagesList.Add(ex.ToString()); return(TaskStatus.Failure); } } return(status); }
private void AddToModelRbMessages(List <Rainbow.Model.Message> rbMessagesList) { List <InstantMessaging.Model.Message> messagesList = new List <InstantMessaging.Model.Message>(); foreach (Rainbow.Model.Message rbMessage in rbMessagesList) { InstantMessaging.Model.Message msg = GetMessageFromRBMessage(rbMessage, rbConversation.Type); if (msg != null) { messagesList.Insert(0, msg); msg.AvatarSource = Helper.GetContactAvatarImageSource(msg.PeerId); } } lock (lockObservableMessagesList) { if (MessagesList.Count == 0) { MessagesList.ReplaceRange(messagesList); } else { MessagesList.AddRange(messagesList, System.Collections.Specialized.NotifyCollectionChangedAction.Reset, 0); } } }
private void CheckBook() { BuildObjectsTable(); CheckVariablesUsage(); if (ErrorsCount == 0 && WarningsCount == 0) { BuildBasicObjectsTrees(); CheckObjectsInterMachines(); Trees.ForEach(bot => MessagesList.AddRange(bot.Messages)); if (ErrorsCount == 0 && WarningsCount == 0) { BuildVariablesStore(); } } }