private static void ShowStatusUpdate(StatusUpdateEvent @event) { switch (@event.Level) { case StatusLevelEnum.Info: System.Console.ForegroundColor = ConsoleColor.Gray; break; case StatusLevelEnum.Success: System.Console.ForegroundColor = ConsoleColor.Green; break; case StatusLevelEnum.Warning: System.Console.ForegroundColor = ConsoleColor.Yellow; break; case StatusLevelEnum.Error: System.Console.ForegroundColor = ConsoleColor.Red; break; default: throw new ArgumentOutOfRangeException(); } System.Console.WriteLine(@event.Status); System.Console.ForegroundColor = ConsoleColor.Gray; }
public void StatusUpdateEventTest() { string expectedText = "my text"; StatusUpdateEvent se = new StatusUpdateEvent(new GRLocation(0, 0), "", expectedText); Assert.AreEqual(expectedText, se.StatusText); }
protected void Initialize() { MockEventAggregator = new Mock<IEventAggregator>(); MockRegionManager = new Mock<IRegionManager>(); MockServiceLocator = new Mock<IServiceLocator>(); MockBackgroundWorker = new Mock<BackgroundWorker>(); OutputEvent = new OutputEvent(); ClickableOutputEvent = new ClickableOutputEvent(); ProjectOpeningEvent projectOpeningEvent = new ProjectOpeningEvent(); LoadProjectEvent loadProjectEvent = new LoadProjectEvent(); ClearOutputEvent clearOutputEvent = new ClearOutputEvent(); ResultAddedEvent resultAddedEvent = new ResultAddedEvent(); ViewResultsEvent viewResultsEvent = new ViewResultsEvent(); StatusUpdateEvent statusUpdateEvent = new StatusUpdateEvent(); MockEventAggregator.Setup(mock => mock.GetEvent<ClearOutputEvent>()).Returns(clearOutputEvent); MockEventAggregator.Setup(mock => mock.GetEvent<OutputEvent>()).Returns(OutputEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ClickableOutputEvent>()).Returns(ClickableOutputEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ProjectOpeningEvent>()).Returns(projectOpeningEvent); MockEventAggregator.Setup(mock => mock.GetEvent<LoadProjectEvent>()).Returns(loadProjectEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ResultAddedEvent>()).Returns(resultAddedEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ViewResultsEvent>()).Returns(viewResultsEvent); MockEventAggregator.Setup(mock => mock.GetEvent<StatusUpdateEvent>()).Returns(statusUpdateEvent); List<IExperimentType> experimentTypes = new List<IExperimentType>(); experimentTypes.Add(new HydraExperimentType(MockServiceLocator.Object)); List<IDataProvider> dataProviders = new List<IDataProvider>(); dataProviders.Add(new ProteoWizardDataProvider(MockEventAggregator.Object)); MockServiceLocator.Setup(mock => mock.GetAllInstances<IExperimentType>()).Returns(experimentTypes); MockServiceLocator.Setup(mock => mock.GetAllInstances<IDataProvider>()).Returns(dataProviders); }
public static void Write(string ns, XmlTextWriter writer, StatusUpdateEvent aEvent) { writer.WriteStartElement(ns + "facebook-status-update"); writer.WriteStartElement(ns + "text"); writer.WriteString(aEvent.StatusText); writer.WriteEndElement(); Write(ns, writer, aEvent.EventLocation); Write(ns, writer, aEvent.EventDateTime); writer.WriteEndElement(); }
private void btn_submit_Click(object sender, EventArgs e) { statusText = txt_statusUpdate.Text; dt = dtPicker.Value; if (Ready()) { Event newEvent = new StatusUpdateEvent(new GRLocation(eventLocation.Latitude, eventLocation.Longitude), dt.ToString(), statusText); GREventManager.AddEvent(newEvent); MessageBox.Show("Event successfully added!"); this.Hide(); } else { MessageBox.Show("Could not add event."); } }
private async void StatusUpdates(Object sender, StatusUpdateEvent e) => await Task.Run(() => this.StatusUpdate?.Invoke(sender, e));
protected virtual void OnRaiseStatusUpdateEvent(StatusUpdateEvent e) { // Make a temporary copy of the event to avoid possibility of a race condition if the last subscriber unsubscribes immediately after the // null check and before the event is raised. StatusUpdate?.Invoke(this, e); }
public void SendUpdate(byte[] cameraImage, List <LaneUpdate> currentLanesState) { var updateEvent = new StatusUpdateEvent(new DataObjects.Camera(cameraImage), currentLanesState); Publish(updateEvent); }
protected void NotifyStatusUpdate(object sender, StatusUpdateArgs args) { StatusUpdateEvent?.Invoke(sender, args); }