Exemple #1
0
        void button_ConnectedChanged(object sender, ConnectedChangedEventArgs e)
        {
            if (closing) return;

            Action action = () =>
                {
                    SetNotifyIcon();
                };

            if (this.InvokeRequired)
            {
                this.BeginInvoke(action);
            }
            else
            {
                action();
            }
        }
Exemple #2
0
        void button_ConnectedChanged(object sender, ConnectedChangedEventArgs e)
        {
            if (closing) return;

            Action action = () =>
                {
                    notifyIcon1.Icon = e.IsConnected ? icons.icoGreen : icons.icoGrey;
                };

            if (this.InvokeRequired)
            {
                this.BeginInvoke(action);
            }
            else
            {
                action();
            }
        }