コード例 #1
0
ファイル: MinerForm.cs プロジェクト: reza300/MultiMiner
        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);
        }
コード例 #2
0
ファイル: MinerForm.cs プロジェクト: reza300/MultiMiner
 private void HandleInstanceOffline(object sender, InstanceChangedArgs ea)
 {
     BeginInvoke((Action)(() =>
     {
         //code to update UI
         instancesControl.UnregisterInstance(ea.Instance);
         UpdateInstancesVisibility();
     }));
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: MinerForm.cs プロジェクト: 27miller87/MultiMiner
 private void HandleRemoteInstanceRegistered(object sender, InstanceChangedArgs ea)
 {
     instancesControl.RegisterInstance(ea.Instance);
 }