コード例 #1
0
        internal NetworkHostTreeNode(PacketParser.NetworkHost networkHost, Func <System.Net.IPAddress, string> ipLocator, ToolInterfaces.IHostDetailsGenerator hostDetailsGenerator, Func <System.Net.NetworkInformation.PhysicalAddress, System.Net.IPAddress, IEnumerable <NetworkHostTreeNode> > macSiblingsFunction = null)
        {
            this.networkHost          = networkHost;
            this.ipLocator            = ipLocator;
            this.hostDetailsGenerator = hostDetailsGenerator;
            this.macSiblingsFunction  = macSiblingsFunction;

            this.Text = networkHost.ToString();
            this.Nodes.Add("dummie node");

            if (networkHost.SentPackets.Count == 0)
            {
                this.ForeColor = System.Drawing.Color.Gray;
            }

            if (this.networkHost.FaviconKey != null)
            {
                this.ImageKey = this.networkHost.FaviconKey;
            }
            else if (GetIpImageKey() != null)
            {
                this.ImageKey = GetIpImageKey();
            }
            else if (GetOsImageKey() != null)
            {
                this.ImageKey = GetOsImageKey();
            }
            else if (networkHost.SentPackets.Count > 0)
            {
                this.ImageKey = "computer";
            }
            else
            {
                this.ImageKey = "white";
            }

            this.SelectedImageKey = this.ImageKey;


            this.ToolTipText = "Sent packets: " + networkHost.SentPackets.Count + "\nReceived packets: " + networkHost.ReceivedPackets;
        }
コード例 #2
0
        internal NetworkHostTreeNode(PacketParser.NetworkHost networkHost, ToolInterfaces.IIPLocator ipLocator, ToolInterfaces.IHostDetailsGenerator hostDetailsGenerator)
        {
            this.networkHost          = networkHost;
            this.ipLocator            = ipLocator;
            this.hostDetailsGenerator = hostDetailsGenerator;

            this.Text = networkHost.ToString();
            this.Nodes.Add("dummie node");

            if (networkHost.SentPackets.Count == 0)
            {
                this.ForeColor = System.Drawing.Color.Gray;
            }

            if (this.networkHost.FaviconKey != null)
            {
                this.ImageKey = this.networkHost.FaviconKey;
            }
            else if (GetIpImageKey() != null)
            {
                this.ImageKey = GetIpImageKey();
            }
            else if (GetOsImageKey() != null)
            {
                this.ImageKey = GetOsImageKey();
            }
            else if (networkHost.SentPackets.Count > 0)
            {
                this.ImageKey = "computer";
            }
            else
            {
                this.ImageKey = "white";
            }

            this.SelectedImageKey = this.ImageKey;


            this.ToolTipText = "Sent packets: " + networkHost.SentPackets.Count + "\nReceived packets: " + networkHost.ReceivedPackets;
        }