public void OnSyncRouterNotification(AmsRouterState state) { if (this._iNoteReceiver != null) { this._iNoteReceiver.OnRouterNotification(state); } }
private void UpdateRouterState() { bool enabled = false; if (!base._disposed) { try { if (this.AmsPortEnabled(false, out enabled) == AdsErrorCode.NoError) { if (enabled) { this._routerState = AmsRouterState.Start; } else { StateInfo info; AdsErrorCode code = this.ReadState(false, out info); this._routerState = AmsRouterState.Stop; if (code == AdsErrorCode.PortNotConnected) { this._routerState = AmsRouterState.Removed; } } } } catch (Exception exception) { Module.Trace.TraceError(exception); } } }
public void PostRouterNotification(AmsRouterState state) { if (this.syncMsgReceiver != null) { object[] objArray1 = new object[] { state }; base.BeginInvoke(this.routerNotificationDelegate, objArray1); } }
private void _routerNotificationTimer_Tick(object sender, EventArgs e) { if (!this._routerNotificationsRegistered) { AmsRouterState state = this._routerState; this.UpdateRouterState(); if (state != this._routerState) { this.OnRouterNotification(this._routerState); } } }
public void OnRouterNotification(AmsRouterState state) { if (!base._disposed) { if (!this._bSynchronize) { this.OnSyncRouterNotification(state); } else if (this._routerSyncWindow != null) { this._routerSyncWindow.PostRouterNotification(state); } } }
public void OnRouterNotification(AmsRouterState state) { IList <WeakReference> list = null; object obj2 = s_instLock; lock (obj2) { this._routerState = state; list = new List <WeakReference>(this._syncPortDict.Values); } try { foreach (WeakReference reference in list) { if (!reference.IsAlive) { continue; } TcAdsSyncPort target = (TcAdsSyncPort)reference.Target; if (target != null) { if (!target.IsDisposed) { target.OnRouterNotification(this._routerState); continue; } string message = $"SyncPort '{target.Id}' is already disposed!"; Module.Trace.TraceWarning(message); } } } catch (Exception exception) { Module.Trace.TraceError(exception); } }
public AmsRouterNotificationEventArgs(AmsRouterState state) { this.state = state; }
private void _connection_AmsRouterNotification(object sender, AmsRouterNotificationEventArgs e) { AmsRouterState state = e.State; }