Exemple #1
0
        public void AddHost(object sender, HostEventArgs eventArgs)
        {
            Host host = eventArgs.Host;

            for (int i = 0; i < Hosts.Count(); i++)
            {
                if (host.IpAddress.Equals(Hosts[i].IpAddress) ||
                    host.MacAddress.Equals(Hosts[i].MacAddress))
                {
                    Hosts[i] = host;
                    return;
                }
            }

            Hosts.Add(host);

            HostAdded?.Invoke(this, new HostEventArgs()
            {
                Host = host
            });
        }
 private void OnHostAdded(Host h)
 {
     HostAdded?.Invoke(h);
 }