Пример #1
0
        void Metadata_HostsEvent(object sender, HostsEventArgs e)
        {
            if (sender == this)
            {
                return;
            }
            if (_activeConnection.Value == null)
            {
                return;
            }

            Action <object> act = new Action <object>((_) => SetupControlConnection());

            if (e.What == HostsEventArgs.Kind.Down)
            {
                if (e.IPAddress.Equals(_activeConnection.Value.GetHostAdress()))
                {
                    act.BeginInvoke(null, (ar) => { act.EndInvoke(ar); }, null);
                }
            }
            else if (e.What == HostsEventArgs.Kind.Up)
            {
                if (_isDiconnected)
                {
                    act.BeginInvoke(null, (ar) => { act.EndInvoke(ar); }, null);
                }
            }
        }
        private void Metadata_HostsEvent(object sender, HostsEventArgs e)
        {
            if (sender == this)
            {
                return;
            }
            if (_activeConnection.Value == null)
            {
                return;
            }

            Action <object> act     = _ => SetupControlConnection();
            var             address = TranslateAddress(e.Address);

            if (e.What == HostsEventArgs.Kind.Down)
            {
                if (address.Equals(_activeConnection.Value.Address))
                {
                    act.BeginInvoke(null, act.EndInvoke, null);
                }
            }
            else if (e.What == HostsEventArgs.Kind.Up)
            {
                if (_isDisconnected)
                {
                    act.BeginInvoke(null, act.EndInvoke, null);
                }
            }
        }
        void Metadata_HostsEvent(object sender, HostsEventArgs e)
        {
            if (sender == this)
            {
                return;
            }

            if (e.What == HostsEventArgs.Kind.Down)
            {
                if (e.IPAddress.Equals(listeningOnHost))
                {
                    SetupControlConnection();
                }
            }
            else if (e.What == HostsEventArgs.Kind.Up)
            {
                if (_isDiconnected)
                {
                    SetupControlConnection();
                }
            }
        }
Пример #4
0
        void Metadata_HostsEvent(object sender, HostsEventArgs e)
        {
            if (sender == this)
                return;
            if (_activeConnection.Value == null)
                return;

            Action<object> act = new Action<object>((_) => SetupControlConnection());

            if (e.What == HostsEventArgs.Kind.Down)
            {
                if (e.IPAddress.Equals(_activeConnection.Value.GetHostAdress()))
                    act.BeginInvoke(null, (ar) => { act.EndInvoke(ar); }, null);
            }
            else if (e.What == HostsEventArgs.Kind.Up)
            {
                if (_isDiconnected)
                    act.BeginInvoke(null, (ar) => { act.EndInvoke(ar); }, null);
            }
        }
        void Metadata_HostsEvent(object sender, HostsEventArgs e)
        {
            if (sender == this)
                return;

                if (e.What == HostsEventArgs.Kind.Down)
                {
                    if (e.IPAddress.Equals(listeningOnHost))
                        SetupControlConnection();
                }
                else if (e.What == HostsEventArgs.Kind.Up)
                {
                    if (_isDiconnected)
                        SetupControlConnection();
                }
        }