private void CheckAdapter() { var hMonitor = NativeMethods.MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST); if (MonitorId == hMonitor) { return; } MonitorId = hMonitor; Logger.Debug("MonitorFromWindow: 0x{0}", MonitorId.ToString("X")); var adapter = GetAdapterId(Handle); if (adapter == null) { AdapterId = 0; Logger.Debug("AdapterId: {0}", AdapterId); } else { AdapterId = adapter.Adapter; Logger.Debug( "AdapterId: {0} [\"{1}\", \"{2}\"]", AdapterId, adapter.Information.DeviceName, adapter.Information.Description); } }
public virtual void OnMonitorActionHandled(string monitorTypeName, MonitorId monitorId, string currentStateName, string actionName) { if (IsVerbose) { WriteLine($"<MonitorLog> Monitor '{ monitorTypeName }' with id '{ monitorId }' in state '{ currentStateName }' handled action '{ actionName }'"); } MonitorActionHandled?.Invoke(monitorTypeName, monitorId, currentStateName, actionName); }
public void RemoteMonitor(MonitorId target, Event e) { if (target == null) { throw new ArgumentNullException(nameof(target)); } GetOrAddChannel(target.Endpoint).Monitor(target, e); }
protected void RemoteMonitor(MonitorId target, Event e) { if (Runtime.NetworkProvider is ICommunicationProvider networkProvider2) { networkProvider2.RemoteMonitor(target, e); return; } Runtime.InvokeMonitor(target, e); }
private void MonitorForm_Load(object sender, EventArgs e) { monitor.Id = MonitorId; GenerateListsOfControls(); // Check if we already a monitor with this ID Monitor newMonitor = Monitor.GetOne(MonitorId); if (newMonitor.Id == 0) { monitor.Save(); } monitorNumber.Text = MonitorId.ToString(); }
public virtual void OnMonitorEvent(string monitorTypeName, MonitorId monitorId, string currentStateName, string eventName, bool isProcessing) { MonitorEvent?.Invoke(monitorTypeName, monitorId, currentStateName, eventName, isProcessing); }
public SafetyMonitorBundler(RuntimeHost runtimeHost, MonitorId id, ISafetyMonitorReceiver receiver) : base(runtimeHost, id, receiver) { }
static TSender NewCore(RuntimeHost runtimeHost, MonitorId id, Type senderType) { return((TSender)Activator.CreateInstance(senderType, runtimeHost, id)); }
public void RemoteMonitor(MonitorId target, Event e) { m_remoteNetworkProvider.RemoteMonitor(target, e); }
public SafetyMonitorSender(RuntimeHost runtimeHost, MonitorId id) : base(runtimeHost, id) { }
protected MethodizedMonitorSender(RuntimeHost runtimeHost, MonitorId id) { RuntimeHost = runtimeHost; Id = id; }
public void Monitor(MonitorId target, Event e) { m_runtimeHost.InvokeMonitor(target, e); }
protected MethodizedMonitorBundler(RuntimeHost runtimeHost, MonitorId id, TReceiver receiver) { RuntimeHost = runtimeHost; Id = id; Receiver = receiver; }
static TSender New(RuntimeHost runtimeHost, MonitorId id) { var senderType = ms_senderType.Value; return(NewCore(runtimeHost, id, senderType)); }
public TSender GetSender <TSender>(MonitorId monitorId) where TSender : class, IMethodizedMonitorSender { return(RuntimeHost.GetSender <TSender>(Id, monitorId)); }
public static void Set(ref MonitorId id, TSender value) { id = value.Id; ms_senders.AddOrUpdate(id, value, (_1, _2) => value); }
public virtual void OnMonitorAction(string monitorTypeName, MonitorId monitorId, string currentStateName, string actionName) { MonitorAction?.Invoke(monitorTypeName, monitorId, currentStateName, actionName); }
internal override void InvokeMonitor(MonitorId target, Event e) { throw new NotSupportedException(); }
public override void InvokeMonitor(MonitorId target, ApplicationEvent e) { m_networkProvider2.RemoteMonitor(target, e); }
public void SetSender <TSender>(ref MonitorId monitorId, TSender monitor) where TSender : class, IMethodizedMonitorSender { RuntimeHost.SetSender(ref monitorId, monitor); }
public virtual void OnMonitorState(string monitorTypeName, MonitorId monitorId, string stateName, bool isEntry, bool?isInHotState) { MonitorState?.Invoke(monitorTypeName, monitorId, stateName, isEntry, isInHotState); }
public virtual void OnCreateMonitor(string monitorTypeName, MonitorId monitorId) { MonitorCreated?.Invoke(monitorTypeName, monitorId); }
public static TSender Get(CommunicationId key, MonitorId id) { return(ms_senders.GetOrAdd(id, _ => New(RuntimeHostReferences.Get(key.RuntimeHostId), id))); }