• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NodeCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NodeCollection的典型用法代码示例。如果您正苦于以下问题:C# NodeCollection类的具体用法?C# NodeCollection怎么用?C# NodeCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeCollection类属于命名空间,在下文中一共展示了NodeCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetNodes

        public ActionResult GetNodes(string node)
        {
            if (!string.IsNullOrEmpty(node))
            {
                NodeCollection nodes = new NodeCollection();
                SiteMapNode siteMapNode = SiteMap.Provider.FindSiteMapNodeFromKey(node);

                if (siteMapNode == null)
                {
                    return this.Store(nodes);
                }

                SiteMapNodeCollection children = siteMapNode.ChildNodes;

                if (children != null && children.Count > 0)
                {
                    foreach (SiteMapNode mapNode in siteMapNode.ChildNodes)
                    {
                        nodes.Add(NodeHelper.CreateNodeWithOutChildren(mapNode));
                    }
                }

                return this.Store(nodes);
            }

            return new HttpStatusCodeResult(500);
        }
开发者ID:shalves,项目名称:Ext.NET.Community,代码行数:27,代码来源:DragDrop_Between_TreesController.cs


示例2: SolverValidator

 public SolverValidator(Solver solver, NodeCollection nodes, Node root, IPositionLookupTable<Node> transpositionTable)
 {
     this.solver = solver;
     this.nodes = nodes;
     this.root = root;
     this.transpositionTable = transpositionTable;
 }
开发者ID:ricksladkey,项目名称:Sokoban,代码行数:7,代码来源:SolverValidator.cs


示例3: GetExamplesNodes

        public static NodeCollection GetExamplesNodes()
        {
            var nodes = new NodeCollection();
            string path = HttpContext.Current.Server.MapPath(ExamplesModel.ExamplesRoot);

            return ExamplesModel.BuildAreasLevel();
        }
开发者ID:extnet,项目名称:Ext.NET.Examples.MVC,代码行数:7,代码来源:ExamplesModel.cs


示例4: PPPragmaNode

        public PPPragmaNode(IdentifierExpression identifier, NodeCollection<ConstantExpression> value, PragmaAction action)
            : base(identifier.RelatedToken)
		{
			this.identifier = identifier;
            this.value = value;
            this.Action = action;
		}
开发者ID:debreuil,项目名称:CSharpParser,代码行数:7,代码来源:PPPragmaNode.cs


示例5: CompilationUnitNode

		public CompilationUnitNode(): base(new Token( TokenID.Invalid, 0, 0) )
		{
			this.globalAttributes = new NodeCollection<AttributeNode>();
            this.namespaces = new NodeCollection<NamespaceNode>();

            this.defaultNamespace = new NamespaceNode(RelatedToken);
		}
开发者ID:mintberry,项目名称:stackrecaller,代码行数:7,代码来源:CompilationUnitNode.cs


示例6: ForStatement

 public ForStatement(Token relatedToken)
     : base(relatedToken)
 {
     _blockStatement = new BlockStatement(relatedToken);
     _init = new NodeCollection<ExpressionNode>();
     _inc = new NodeCollection<ExpressionNode>();
 }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:ForStatement.cs


示例7: CompilationUnitNode

    public CompilationUnitNode()
      : base(new Token(TokenID.Invalid, 0, 0))
    {
      namespaces = new NodeCollection<NamespaceNode>();

      defaultNamespace = new NamespaceNode(RelatedToken);
    }
开发者ID:andyhebear,项目名称:Csharp-Parser,代码行数:7,代码来源:CompilationUnitNode.cs


示例8: EvalCollection

 private void EvalCollection(IContext context, NodeCollection<ExpressionNode> collection, Stream writer)
 {
     foreach (ExpressionNode node in collection)
     {
         node.Execute(context, writer);
     }
 }
开发者ID:yslib,项目名称:minimvc,代码行数:7,代码来源:ForStatement.cs


示例9: GetNodes

        public string GetNodes(string node)
        {
            NodeCollection nodes = new NodeCollection(false);

            if (!string.IsNullOrEmpty(node))
            {
                for (int i = 1; i < 6; i++)
                {
                    Node asyncNode = new Node();
                    asyncNode.Text = node + i;
                    asyncNode.NodeID = node + i;
                    nodes.Add(asyncNode);
                }

                for (int i = 6; i < 11; i++)
                {
                    Node treeNode = new Node();
                    treeNode.Text = node + i;
                    treeNode.NodeID = node + i;
                    treeNode.Leaf = true;
                    nodes.Add(treeNode);
                }
            }

            return nodes.ToJson();
        }
开发者ID:extnet,项目名称:Ext.NET.Examples,代码行数:26,代码来源:TreeJsonService.asmx.cs


示例10: BuildFirstLevel

        public static NodeCollection BuildFirstLevel()
        {
            string path = HttpContext.Current.Server.MapPath("~/Examples/");
            DirectoryInfo root = new DirectoryInfo(path);
            DirectoryInfo[] folders = root.GetDirectories();
            folders = UIHelpers.SortFolders(root, folders);

            NodeCollection nodes = new NodeCollection(false);

            foreach (DirectoryInfo folder in folders)
            {
                if ((folder.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden ||
                    excludeList.Contains(folder.Name) || folder.Name.StartsWith("_"))
                {
                    continue;
                }

                ExampleConfig cfg = new ExampleConfig(folder.FullName + "\\config.xml", false);

                string iconCls = string.IsNullOrEmpty(cfg.IconCls) ? "" : cfg.IconCls;
                Node node = new Node();

                node.Text = UIHelpers.MarkNew(folder.FullName, folder.Name.Replace("_", " "));
                node.IconCls = iconCls;

                string url = UIHelpers.PhysicalToVirtual(folder.FullName + "/");
                node.NodeID = "e" + Math.Abs(url.ToLower().GetHashCode());

                nodes.Add(node);
            }

            return nodes;
        }
开发者ID:shalves,项目名称:Ext.NET.Community,代码行数:33,代码来源:UIHelpers.cs


示例11: Scene

		public Scene()
		{
			_renderableNodes = new NodeCollection();
			_flatNodes = new NodeCollection();
			_environmentalNodes = new NodeCollection();

			AmbientColor = Color.FromArgb(0xff, 0x3f, 0x3f, 0x3f);
		}
开发者ID:tekbob27,项目名称:Balder,代码行数:8,代码来源:Scene.cs


示例12: Report

        //PageHeader
        //PageFooter
        //InteractiveHeight
        //InteractiveWidth
        //EmbeddedImages
        //CodeModules
        //Classes
        //DataTransform

        public Report()
        {

            this.DataSources = new NodeCollection<DataSource>();
            this.DataSets = new NodeCollection<XDataSet>();
            this.EmbeddedImages = new NodeCollection<EmbeddedImage>();
            this.ReportParameters = new NodeCollection<ReportParameter>();
        }
开发者ID:saveenr,项目名称:saveenr,代码行数:17,代码来源:Report.cs


示例13: FlattenChildren

 /// <summary>
 /// Get all the children recursive and flattens it into the given list.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="listToFill">The list to fill.</param>
 private void FlattenChildren(Node parent, ref NodeCollection listToFill)
 {
     listToFill.Add(parent);
     foreach (var child in parent.Children)
     {
         this.FlattenChildren(child, ref listToFill);
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:13,代码来源:Node.cs


示例14: Element

        public Element(string name, string text, params IAttribute[] attributes)
        {
            this._Name = name;
            this._Attributes = new AttributeCollection(attributes);
            this._Children = new NodeCollection(new Text(text));

            
        }
开发者ID:rportela,项目名称:com.eixox.csharp.core,代码行数:8,代码来源:Element.cs


示例15: Table

 public Table()
 {
     this.Header = new Header();
     this.Details = new Details();
     this.TableColumns = new NodeCollection<TableColumn>();
     this.TableGroups = new NodeCollection<TableGroup>(); 
     this.Style = new Style();
 }
开发者ID:saveenr,项目名称:saveenr,代码行数:8,代码来源:Table.cs


示例16: ForElements

        /// <summary>
        /// Makes a diffing engine for collections of elements.
        /// </summary>
        /// <param name="expected">The expected elements.</param>
        /// <param name="actual">The actual elements.</param>
        /// <param name="path">The current path of the parent node.</param>
        /// <param name="pathExpected">The path of the parent node of the parent collection.</param>
        /// <param name="options">Equality options.</param>
        /// <returns>The resulting diffing engine.</returns>
        public static IDiffEngine<NodeCollection> ForElements(NodeCollection expected, NodeCollection actual, IXmlPathStrict path, IXmlPathStrict pathExpected, Options options)
        {
            if ((options & Options.IgnoreElementsOrder) != 0)
            {
                return new DiffEngineForUnorderedElements(expected, actual, path, pathExpected, options);
            }

            return new DiffEngineForOrderedItems<NodeCollection, INode>(expected, actual, path, pathExpected, options, OrderedItemType.Element);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:18,代码来源:DiffEngineFactory.cs


示例17: ReorderChildNodes

        /// <summary>
        /// Reorder child nodes matching ChildNodeNames
        /// </summary>
        /// <param name="element">Element thats getting its children reordered</param>
        private void ReorderChildNodes(XElement element)
        {
            List<NodeCollection> nodeCollections = new List<NodeCollection>();

            var children = element.Nodes();

            // This indicates if last element matched ChildNodeNames
            bool inMatchingChildBlock = false;
            // This value changes each time a non matching ChildNodeName is reached ensuring that only sortable elements are reordered 
            int childBlockIndex = 0;

            NodeCollection currentNodeCollection = null;

            // Run through children
            foreach (var child in children)
            {
                if (currentNodeCollection == null)
                {
                    currentNodeCollection = new NodeCollection();
                    nodeCollections.Add(currentNodeCollection);
                }

                if (child.NodeType == XmlNodeType.Element)
                {
                    XElement childElement = (XElement)child;

                    var isMatchingChild = ChildNodeNames.Any(match => match.IsMatch(childElement.Name));
                    if (isMatchingChild == false || inMatchingChildBlock == false)
                    {
                        childBlockIndex++;
                        inMatchingChildBlock = isMatchingChild;
                    }

                    if (isMatchingChild)
                    {
                        currentNodeCollection.SortAttributeValues = SortByAttributes.Select(x => x.GetValue(childElement)).ToArray();
                    }

                    currentNodeCollection.BlockIndex = childBlockIndex;
                }

                currentNodeCollection.Nodes.Add(child);

                if (child.NodeType == XmlNodeType.Element)
                    currentNodeCollection = null;
            }

            if (currentNodeCollection != null)
                currentNodeCollection.BlockIndex = childBlockIndex + 1;

            // sort node list
            nodeCollections = nodeCollections.OrderBy(x => x).ToList();

            // replace the element's nodes
            element.ReplaceNodes(nodeCollections.SelectMany(nc => nc.Nodes));
        }
开发者ID:KSSDevelopment,项目名称:XamlStyler,代码行数:60,代码来源:NodeReorderService.cs


示例18: NodeBase

        /// <summary>
        /// Constructs a node instance.
        /// </summary>
        /// <param name="type">The type of the node.</param>
        /// <param name="index">The index of the node.</param>
        /// <param name="count">The number of elements at the same level.</param>
        /// <param name="children">The children nodes.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="children"/> is null.</exception>
        protected NodeBase(NodeType type, int index, int count, IEnumerable<INode> children)
        {
            if (children == null)
                throw new ArgumentNullException("children");

            this.type = type;
            this.index = index;
            this.count = count;
            this.children = new NodeCollection(children);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:18,代码来源:NodeBase.cs


示例19: FlattenChildrenRecursive

        /// <summary>Flattens the whole tree structure underneath me into a simple list.</summary>
        /// <returns>A enumerable list of flattened nodes.</returns>
        public IEnumerable<Node> FlattenChildrenRecursive()
        {
            // create the list to populate
            var list = new NodeCollection();

            // go recursive ! 
            this.FlattenChildren(this, ref list);

            return list;
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:12,代码来源:Node.cs


示例20: Constructs_ok

 public void Constructs_ok()
 {
     var mockMarkup1 = MockRepository.GenerateStub<INode>();
     var mockMarkup2 = MockRepository.GenerateStub<INode>();
     var mockMarkup3 = MockRepository.GenerateStub<INode>();
     var array = new[] { mockMarkup1, mockMarkup2, mockMarkup3 };
     var collection = new NodeCollection(array);
     Assert.Count(3, collection);
     Assert.AreElementsSame(array, collection);
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:10,代码来源:NodeCollectionTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NodeContainer类代码示例发布时间:2022-05-24
下一篇:
C# NodeBase类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap