private void HandleInstanceOnline(object sender, InstanceChangedArgs ea) { BeginInvoke((Action)(() => { //code to update UI instancesControl.RegisterInstance(ea.Instance); UpdateInstancesVisibility(); })); //send our hashrate back to the machine that is now Online if (!ea.Instance.MachineName.Equals(Environment.MachineName)) SendHashrate(ea.Instance.IpAddress); }
private void HandleInstanceOffline(object sender, InstanceChangedArgs ea) { BeginInvoke((Action)(() => { //code to update UI instancesControl.UnregisterInstance(ea.Instance); UpdateInstancesVisibility(); })); }
private void HandleInstanceOnline(object sender, InstanceChangedArgs ea) { //System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created. if (Context == null) return; Context.BeginInvoke((Action)(() => { //code to update UI if (RemoteInstanceRegistered != null) RemoteInstanceRegistered(this, ea); if (DataModified != null) DataModified(this, new EventArgs()); }), null); //send our hashrate back to the machine that is now Online if (!ea.Instance.MachineName.Equals(Environment.MachineName)) SendHashrate(ea.Instance.IpAddress); }
private void HandleInstanceOffline(object sender, InstanceChangedArgs ea) { //System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created. if (Context == null) return; Context.BeginInvoke((Action)(() => { //code to update UI if (RemoteInstanceUnregistered != null) RemoteInstanceUnregistered(this, ea); if (DataModified != null) DataModified(this, new EventArgs()); }), null); }
private void HandleRemoteInstanceRegistered(object sender, InstanceChangedArgs ea) { instancesControl.RegisterInstance(ea.Instance); }