本文整理汇总了C#中Device.Children方法的典型用法代码示例。如果您正苦于以下问题:C# Device.Children方法的具体用法?C# Device.Children怎么用?C# Device.Children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device.Children方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadInterfaces
private void loadInterfaces(TreeNode node, Device drv)
{
node = node.Nodes.Add("if-" + drv.Id, "端口", if_root_unselected, if_root_selected);
node.Name = "interfaces";
var interfaces = drv.Children<Interface>(null);
foreach (var ifc in interfaces)
{
var n = node.Nodes.Add("if-" + ifc.Id, ifc.IfDescr, if_unselected, if_selected);
n.Tag = ifc;
}
}
示例2: loadRules
private void loadRules(TreeNode node, Device drv)
{
node = node.Nodes.Add("trigger-" + drv.Id, "任务", trigger_root_unselected,
trigger_root_selected);
node.Name = "triggers";
var triggers = drv.Children<Trigger>(null);
foreach (var trigger in triggers)
{
var n = node.Nodes.Add("trigger-" + trigger.Id, trigger.Name,
trigger_unselected, trigger_selected);
n.Tag = trigger;
n.ContextMenuStrip = this.triggerContextMenuStrip;
}
}
示例3: processPorts
static void processPorts(Device dev, bool isRT, XmlElement element)
{
Dictionary<int, IPAddress> ipList = new Dictionary<int, IPAddress>();
foreach (IPAddress ipData in dev.Children<IPAddress>(null))
{
ipList[ipData.IfIndex] = ipData;
}
foreach (Interface port in dev.Children<Interface>(null))
{
IPAddress ip = null;
ipList.TryGetValue(port.IfIndex, out ip);
//if ("172.16.138.254" == dev.IP)
// Console.WriteLine( "{0} - {1}", port.IfIndex, null == ip );
processPort(dev, port, ip, isRT, element);
}
}