当前位置: 首页>>代码示例>>C#>>正文


C# INode.GetChildren方法代码示例

本文整理汇总了C#中INode.GetChildren方法的典型用法代码示例。如果您正苦于以下问题:C# INode.GetChildren方法的具体用法?C# INode.GetChildren怎么用?C# INode.GetChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INode的用法示例。


在下文中一共展示了INode.GetChildren方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SerializeNode

        private static Node SerializeNode(INode n)
        {
            IList<Node> children = new List<Node>();

            foreach (INode child in n.GetChildren())
            {
                children.Add(SerializeNode(child));
            }

            if (n is IClassNode)
            {
                IClassNode cn = (IClassNode)n;
                IList<IConstructorDef> injectable = cn.GetInjectableConstructors();
                IList<IConstructorDef> all = cn.GetAllConstructors();
                IList<IConstructorDef> others = new List<IConstructorDef>(all);

                foreach (var c in injectable)
                {
                    others.Remove(c);
                }

                IList<ConstructorDef> injectableConstructors = new List<ConstructorDef>();
                foreach (IConstructorDef inj in injectable)
                {
                    injectableConstructors.Add(SerializeConstructorDef(inj));
                }

                IList<ConstructorDef> otherConstructors = new List<ConstructorDef>();
                foreach (IConstructorDef other in others)
                {
                    otherConstructors.Add(SerializeConstructorDef(other));
                }

                List<string> implFullNames = new List<string>();
                foreach (IClassNode impl in cn.GetKnownImplementations())
                {
                    implFullNames.Add(impl.GetFullName());  // we use class fully qualifed name 
                }

                return NewClassNode(cn.GetName(), cn.GetFullName(),
                    cn.IsInjectionCandidate(), cn.IsExternalConstructor(), cn.IsUnit(),
                    injectableConstructors, otherConstructors, implFullNames, children);
            }
            if (n is INamedParameterNode)
            {
                INamedParameterNode np = (INamedParameterNode)n;
                return NewNamedParameterNode(np.GetName(), np.GetFullName(),
                    np.GetSimpleArgName(), np.GetFullArgName(), np.IsSet(), np.IsList(), np.GetDocumentation(),
                    np.GetShortName(), np.GetDefaultInstanceAsStrings(), children, np.GetAlias(), np.GetAliasLanguage());
            }
            if (n is IPackageNode)
            {
                return NewPackageNode(n.GetName(), n.GetFullName(), children);
            }
            Utilities.Diagnostics.Exceptions.Throw(new IllegalStateException("Encountered unknown type of Node: " + n), LOGGER);
            return null;
        }
开发者ID:beomyeol,项目名称:reef,代码行数:57,代码来源:ProtocolBufferClassHierarchy.cs

示例2: PopulateTree

 private void PopulateTree(INode currentNode, TreeNodeCollection parentsNodes)
 {
     TreeNode newNode = new TreeNode(currentNode.GetDisplayName());
     newNode.Tag = currentNode;
     parentsNodes.Add(newNode);
     foreach (INode child in currentNode.GetChildren())
     {
         PopulateTree(child, newNode.Nodes);
     }
 }
开发者ID:Thwaitesy,项目名称:appium-dot-exe,代码行数:10,代码来源:InpsectorForm.cs

示例3: handleNode

 private void handleNode(INode node, Stack<INode> nodeStack)
 {
     nodeStack.Push(node);
     foreach (var method in node.GetMethods())
     {
         method.Value.HttpMethod = method.Key;
         method.Value.Path = NodeApiMiddleware.Prefix + String.Join("/", nodeStack
                 .Reverse()
                 .Select(t => t.Id)
                 .ToArray());
     }
     foreach (var childNode in node.GetChildren())
     {
         handleNode(childNode, nodeStack);
     }
     nodeStack.Pop();
 }
开发者ID:aaasoft,项目名称:Quick.OwinMVC,代码行数:17,代码来源:NodeManager.cs

示例4: BuildHashTable

 /// <summary>
 /// Build hash table to index the node
 /// </summary>
 /// <param name="n"></param>
 public void BuildHashTable(INode n)
 {
     foreach (INode child in n.GetChildren())
     {
         _lookupTable.Add(child.GetFullName(), child);
         if (child is INamedParameterNode)
         {
             AddAlias((INamedParameterNode)child);
         }
         BuildHashTable(child);
     }
 }
开发者ID:swlsw,项目名称:incubator-reef,代码行数:16,代码来源:AvroClassHierarchy.cs

示例5: _Init

 private void _Init(INode node, IDictionary<string, string> properties)
 {
     HunterUtils.TryHunt(node, properties);
     HunterUtils.TryHunt(node.GetMethods().Values, properties);
     foreach (var childNode in node.GetChildren())
         _Init(childNode, properties);
 }
开发者ID:aaasoft,项目名称:Quick.OwinMVC,代码行数:7,代码来源:NodeManager.cs

示例6: BuildHashTable

 public void BuildHashTable(INode n)
 {
     foreach (INode child in n.GetChildren())
     {
         lookupTable.Add(child.GetFullName(), child);
         BuildHashTable(child);
     }
 }
开发者ID:kijungs,项目名称:incubator-reef,代码行数:8,代码来源:ProtocolBufferClassHierarchy.cs

示例7: SerializeNode

        private static ClassHierarchyProto.Node SerializeNode(INode n)
        {
            IList<ClassHierarchyProto.Node> children = new List<ClassHierarchyProto.Node>();

            foreach (INode child in n.GetChildren())
            {
                children.Add(SerializeNode(child));
            }

            if (n is IClassNode)
            {
                IClassNode cn = (IClassNode)n;
                IList<IConstructorDef> injectable = cn.GetInjectableConstructors();
                IList<IConstructorDef> all = cn.GetAllConstructors();
                IList<IConstructorDef> others = new List<IConstructorDef>(all);

                foreach (var c in injectable)
                {
                    others.Remove(c);
                }

                IList<ClassHierarchyProto.ConstructorDef> injectableConstructors = new List<ClassHierarchyProto.ConstructorDef>();
                foreach (IConstructorDef inj in injectable)
                {
                    injectableConstructors.Add(SerializeConstructorDef(inj));
                }

                IList<ClassHierarchyProto.ConstructorDef> otherConstructors = new List<ClassHierarchyProto.ConstructorDef>();
                foreach (IConstructorDef other in others)
                {
                    otherConstructors.Add(SerializeConstructorDef(other));
                }

                List<string> implFullNames = new List<string>();
                foreach (IClassNode impl in cn.GetKnownImplementations())
                {
                    implFullNames.Add(impl.GetFullName());
                }

                return NewClassNode(cn.GetName(), cn.GetFullName(),
                    cn.IsInjectionCandidate(), cn.IsExternalConstructor(), cn.IsUnit(),
                    injectableConstructors, otherConstructors, implFullNames, children);

            }
            else if (n is INamedParameterNode)
            {
                INamedParameterNode np = (INamedParameterNode)n;
                return NewNamedParameterNode(np.GetName(), np.GetFullName(),
                    np.GetSimpleArgName(), np.GetFullArgName(), np.IsSet(), np.GetDocumentation(),
                    np.GetShortName(), np.GetDefaultInstanceAsStrings(), children);
            }
            else if (n is IPackageNode)
            {
                return NewPackageNode(n.GetName(), n.GetFullName(), children);
            }
            else
            {
                throw new IllegalStateException("Encountered unknown type of Node: " + n);
            }
        }
开发者ID:kyungtaak,项目名称:TANG,代码行数:60,代码来源:ProtocolBufferClassHierarchy.cs


注:本文中的INode.GetChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。