public void UnsubscribeEvents() { if (this.mRemoteObject != null) { this.mRemoteObject.Warning -= OnWarning; this.mRemoteObject.Terminated -= OnTerminated; } }
protected virtual void Warning(string message, params object[] args) { WarningDelegate handler = OnWarning; if (handler != null) { handler(message, args); } }
public void GetRemoteObject() { this.mRemoteObject = (IProgramMonitorRemoting)Activator.GetObject(typeof(IProgramMonitorRemoting), "ipc://ProgramMonitor.RemotingServer/ProgramMonitorRemoting"); this.mRemoteObject.Warning += OnWarning; this.mRemoteObject.Terminated += OnTerminated; }
private void btnSetup_Click(object sender, EventArgs e) { if (this.radioBtnEnable.Checked == true) { registryKey.SetValue("Start", (int)Permission.Allow); if (USBDisable != null) { USBDisable.Abort(); } } else if (this.radioBtnDisable.Checked == true) { registryKey.SetValue("Start", (int)Permission.Deny); WarningMsg = new WarningDelegate(WarningView); if (this.checkBoxReal.Checked == true) { USBDisable = new Thread(USBReg); USBDisable.Start(); } } }