コード例 #1
0
 internal SubNetworkHostTreeNode(PacketParser.NetworkHost sourceHost, PacketParser.NetworkHost destinationHost, PacketParser.NetworkPacketList packetList)
 {
     this.sourceHost      = sourceHost;
     this.destinationHost = destinationHost;
     this.packetList      = packetList;
     this.Text            = sourceHost.ToString() + " -> " + destinationHost.ToString() + " : " + packetList.ToString();
     if (packetList.Count > 0)
     {
         this.Nodes.Add("dummie node");//so that it can be expanded
     }
 }
コード例 #2
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;
        }
コード例 #3
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;
        }