public ColorizationUpdateRegistrationHandle(TControl control, ControlUpdater <TControl> updater) { this.control = control; this.updater = updater; control.Disposed += new EventHandler(ControlDisposedHandler); GlobalColorizationChanged += new EventHandler(Handler); }
protected void gps_LocationChanged(object sender, LocationChangedEventArgs args) { ControlUpdater cu = UpdateControl; updateDataHandler = new EventHandler(UpdateData); position = args.Position; if (locationfrm != null) { if (position.LatitudeValid) { Invoke(cu, locationfrm.LatitudeLbl, position.Latitude.ToString()); // delgate method,Control on form, value to be updated } if (position.LongitudeValid) { Invoke(cu, locationfrm.LongitudeLbl, position.Longitude.ToString()); } if (position.SatellitesInSolutionValid && position.SatellitesInViewValid && position.SatelliteCountValid) { Invoke(cu, locationfrm.SatelliteInfolbl, satelliteinfo += "Satellite Count: " + position.GetSatellitesInSolution().Length.ToString() + "/" + position.GetSatellitesInView().Length.ToString() + " (" + position.SatelliteCount.ToString() + ")\n"); } } // call the UpdateData method via the updateDataHandler so that we if (!Reminder_Occurs) { Invoke(updateDataHandler); } }
// The class constructor. //public Stampa(IntPtr handle) //{ // this.handle = handle; //} private void RispondiATimeOutEvent(string Messaggio) { try { ControlUpdater updater = UpdateControl; //Invoke(updater, toolStripStatusLabel1, Messaggio, Color.Red); } catch (System.Exception ex) { MessageBox.Show(ex.ToString()); } }
private void RispondiALANSocketEvent(string Messaggio) { try { ControlUpdater updater = UpdateControl; // Invoke(updater, toolStripStatusLabel1, Messaggio, Color.Green); ISConnected = true; } catch (System.Exception ex) { ISConnected = false; MessageBox.Show(ex.ToString()); } }
void gps_LocationChanged(object sender, LocationChangedEventArgs args) { GpsPosition position = args.Position; ControlUpdater cu = UpdateControl; if ((position.LatitudeValid) & (position.LongitudeValid)) { statusBar1.Visible = true; statusBar1.Text = "Localização identificada."; Invoke(cu, begLat, position.Latitude.ToString()); Invoke(cu, begLng, position.Longitude.ToString()); gps.LocationChanged -= gps_LocationChanged; gm.setLatitude(position.Latitude); gm.setLongitude(position.Longitude); mapBox.Image = gm.RetrieveStaticMap(); } }
public static void UpdateMenuToolbar() { var Engine = WorkspaceDirector.ActiveDocumentEngine as CompositionEngine; if (Engine == null || Engine.CurrentView == null) { return; } Engine.CurrentView.Presenter .PostCall(vpres => { foreach (var ControlUpdater in MenuToolbarControlsUpdater) { ControlUpdater.Value(); } }); }
public ContextSinkListControl(Control container, DiagContext context) { Container = container; Context = context; _updater = new ControlUpdater <TrackedSink>(context, container) { ItemFilter = ItemFilter, AutoUpdateUntilContextLoaded = true, }; _updater.CreateSearchBox(10, 10); _updater.ListView.BorderStyle = BorderStyle.None; _updater.ListView.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; _updater.ListView.Bounds = new Rectangle(Container.ClientRectangle.Left, Container.ClientRectangle.Top + 40, Container.ClientRectangle.Width, Container.ClientRectangle.Height - 40); _updater.ListView.ItemActivate += ListView_ItemActivate; _updater.ListView.Columns.Add(new OLVColumn() { Text = "Rows", AspectGetter = x => (x as TrackedSink)?.RowCount, AspectToStringConverter = x => ((int?)x)?.FormatToStringNoZero(), TextAlign = HorizontalAlignment.Right, HeaderTextAlign = HorizontalAlignment.Right, }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Location", AspectGetter = x => (x as TrackedSink)?.Location, }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Path", AspectGetter = x => (x as TrackedSink)?.Path, }); context.WholePlaybook.OnSinkStarted += OnSinkStarted; _updater.Start(); }
public void RegisterControlForUpdates <TControl>(TControl control, ControlUpdater <TControl> updater) where TControl : Control { updater(Instance, control); new ColorizationUpdateRegistrationHandle <TControl>(control, updater); }
void gps_DeviceStateChanged(object sender, DeviceStateChangedEventArgs args) { GpsDeviceState device = args.DeviceState; ControlUpdater cu = UpdateControl; }
public LogListControl(Control container, DiagnosticsStateManager diagnosticsStateManager, DiagSession session) { Container = container; Session = session; _updater = new ControlUpdater <LogModel>(null, Container) { ItemFilter = ItemFilter, }; _updater.CreateSearchBox(10, 10); ShowDebugLevel = new CheckBox() { Parent = container, Bounds = new Rectangle(_updater.SearchBox.Right + 20, _updater.SearchBox.Top, 200, _updater.SearchBox.Height), Text = "Show debug level", CheckAlign = ContentAlignment.MiddleLeft, }; ShowDebugLevel.CheckedChanged += (s, a) => _updater.RefreshItems(true); _updater.ListView.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; _updater.ListView.Bounds = new Rectangle(Container.ClientRectangle.Left, Container.ClientRectangle.Top + 40, Container.ClientRectangle.Width, Container.ClientRectangle.Height - 40); _updater.ListView.ItemActivate += ListView_ItemActivate; _updater.ListView.Columns.Add(new OLVColumn() { Text = "Timestamp", AspectGetter = x => (x as LogModel)?.Timestamp, AspectToStringConverter = x => ((DateTime)x).ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture), }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Severity", AspectGetter = x => (x as LogModel)?.Event.Severity.ToShortString(), }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Context", AspectGetter = x => (x as LogModel)?.Playbook.DiagContext.Name, }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Process", AspectGetter = x => (x as LogModel)?.Process?.Name, }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Kind", AspectGetter = x => (x as LogModel)?.Process?.KindToString(), }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Type", AspectGetter = x => (x as LogModel)?.Process?.Type, }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Topic", AspectGetter = x => (x as LogModel)?.Process?.Topic, }); _updater.ListView.Columns.Add(new OLVColumn() { Text = "Message", AspectGetter = x => (x as LogModel)?.Text, }); _updater.Start(); diagnosticsStateManager.OnDiagContextCreated += ec => { if (ec.Session == session) { ec.WholePlaybook.OnEventsAdded += OnEventsAdded; } }; }