private void Load()
{
HardwareItemDescription hid = _item as HardwareItemDescription;
if (hid != null)
{
Nodes.Add(hid.GetType().Name, hid.GetType().Name );
List<object> ports = hid.Interface;
if (ports != null)
{
foreach (object port in ports)
{
PhysicalInterfacePorts pip = port as PhysicalInterfacePorts;
if (pip != null)
{
List<PhysicalInterfacePortsPort> pipps = pip.Port;
if (pipps != null)
{
foreach (PhysicalInterfacePortsPort pipp in pipps)
{
string name = pipp.name;
string direction = pipp.directionSpecified?pipp.direction.ToString():"";
string type = pipp.typeSpecified ? pipp.type.ToString() : "";
Nodes[hid.GetType().Name].Nodes.Add(name, name + " " + direction + " " + type );
Nodes[hid.GetType().Name].Nodes[name].Tag = pipp;
}
}
}
}
}
}
}