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


C# NodeInfo类代码示例

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


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

示例1: ExportXml

        public void ExportXml(TreeViewItem item)
        {
            exportXmlDocument = new XmlDocument();

            using (FileStream stream = new FileStream("QueryTreeViewNode.xml", FileMode.Create))
            {
                XmlDeclaration xmlDeclaration = exportXmlDocument.CreateXmlDeclaration("1.0", "UTF-8", null);
                exportXmlDocument.AppendChild(xmlDeclaration);

                NodeInfo ni = new NodeInfo() { Query = (string)item.Header, IsExpanded = item.IsExpanded };
                XmlElement xe = exportXmlDocument.CreateElement("item");
                xe.SetAttribute("name", ni.Query);

                if (item.IsExpanded)
                {
                    xe.SetAttribute("expand", "true");
                }
                // ルートノードをXmlDocumentに追加
                exportXmlDocument.AppendChild(xe);

                // 再帰的にツリーノードを読み込み、XmlDocument構築
                RecursiveTreeViewItemToXml(item, xe);

                // ファイルに出力
                exportXmlDocument.Save(stream);
            }
        }
开发者ID:asapo,项目名称:Profes,代码行数:27,代码来源:FileShareTreeQueryControl.xaml.cs

示例2: GetData

		public void GetData(NodeInfo nodeInfo, CellInfo[] cellData)
		{
//			int commentCol = ShowLinks ? (int) FavoritesGridColumns.Comment
//				: (int) FavoritesGridColumns.Name;

			cellData[(int)FavoritesGridColumns.Name].Text = Name;
			cellData[(int)FavoritesGridColumns.Name].ImageIndex =
				Links.Count > 0
					? FavoritesDummyForm.Instance.FolderStartIndex
					: FavoritesDummyForm.Instance.EmptyFolderStartIndex;

			nodeInfo.Highlight = true;

//			if (ShowLinks)
//			{
//				cellData[(int) FavoritesGridColumns.ColSubj].Image = -1;
//				cellData[(int) FavoritesGridColumns.ColSubj].Text = string.Empty;
//				cellData[(int) FavoritesGridColumns.ColAuthor].Image = -1;
//				cellData[(int) FavoritesGridColumns.ColAuthor].Text = string.Empty;
//				cellData[(int) FavoritesGridColumns.ColDate].Image = -1;
//				cellData[(int) FavoritesGridColumns.ColDate].Text = string.Empty;
//				cellData[(int) FavoritesGridColumns.ColForum].Image = -1;
//				cellData[(int) FavoritesGridColumns.ColForum].Text = string.Empty;
//			}
//			cellData[commentCol].Text = Comment.ToString();
//			cellData[commentCol].Image = -1;

			cellData[(int)FavoritesGridColumns.Comment].Text = Comment;
		}
开发者ID:rsdn,项目名称:janus,代码行数:29,代码来源:FavoritesFolder.cs

示例3: AddFadingNode

 public void AddFadingNode(FNode node, float showDuration)
 {
     NodeInfo info = new NodeInfo ();
     info.node = node;
     info.showDuration = showDuration;
     infos.Add (info);
 }
开发者ID:tanis2000,项目名称:Futile,代码行数:7,代码来源:FadeSequenceContainer.cs

示例4: Position

 public Position(NodeInfo nodeInfo, int i)
 {
     left = double.Parse(nodeInfo.data.ControlList[i].Position.Left);
     top = double.Parse(nodeInfo.data.ControlList[i].Position.Top);
     right = double.Parse(nodeInfo.data.ControlList[i].Position.Right);
     bottom = double.Parse(nodeInfo.data.ControlList[i].Position.Bottom);
 }
开发者ID:pipimushroom,项目名称:windowphone,代码行数:7,代码来源:Position.cs

示例5: CreateMenu

        public ContextMenuStrip CreateMenu(NodeInfo node)
        {
            ContextMenuStrip menu = new ContextMenuStrip();

            foreach (ContextAction action in this.actions)
            {
                if ((action.Controls.Count > 0) && !action.Controls.Contains(this.currentControl))
                {
                    continue;
                }

                if (!action.NoSelection)
                {
                    if (node == null)
                    {
                        continue;
                    }

                    if ((action.NodeType != 0) && !action.NodeType.HasFlag(node.Type))
                    {
                        continue;
                    }

                    if ((action.Predicate != null) && !action.Predicate(node))
                    {
                        continue;
                    }
                }

                ToolStripMenuItem item = this.CreateMenuItem(action, node);
                menu.Items.Add(item);
            }

            return menu;
        }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:35,代码来源:ContextActionController.cs

示例6: GetChildren

		public NodeInfoCollection GetChildren (NodeInfo root)
		{
			Trace.WriteLineIf (info.Enabled, "GroupingNodeFinder.GetChildren");
			NodeInfoCollection collection = null;

			switch (root.NodeType) {
			case NodeTypes.Type:
				GroupChildNodes (root);
				collection = new NodeInfoCollection ();
				collection.AddRange ((NodeInfoCollection)nodes[""]);
				AddGroup (nestedClasses, collection, root);
				AddGroup (baseNode, collection, root);
				AddGroup (interfacesNode, collection, root);
				AddGroup (constructorsNode, collection, root);
				AddGroup (methodsNode, collection, root);
				AddGroup (fieldsNode, collection, root);
				AddGroup (propertiesNode, collection, root);
				AddGroup (eventsNode, collection, root);
				return collection;
			case NodeTypes.Other:
				if (root.Description is GroupingInfo) {
					Trace.WriteLineIf (info.Enabled, "Found GroupingInfo");
					GroupingInfo g = (GroupingInfo) root.Description;
					collection = (NodeInfoCollection) nodes[g.Group];
					return collection;
				}
				break;
			}

			return finder.GetChildren (root);
		}
开发者ID:emtees,项目名称:old-code,代码行数:31,代码来源:GroupingNodeFinder.cs

示例7: CompareResults

        public void CompareResults(List<NodeInfo> nodes, string outFile)
        {
            int pos = 0;
            XmlReader reader = XmlReader.Create(outFile);
            IXmlLineInfo li = (IXmlLineInfo)reader;
            XmlNodeType previousNodeType = XmlNodeType.None;
            using (reader) {
                while (reader.Read()) {
                    if (reader.NodeType == XmlNodeType.Whitespace ||
                        reader.NodeType == XmlNodeType.SignificantWhitespace ||
                        reader.NodeType == XmlNodeType.XmlDeclaration)
                        continue;

                    NodeInfo node = new NodeInfo(reader);
                    if (pos >= nodes.Count) {
                        throw new ApplicationException("Found too many nodes");
                    }
                    NodeInfo other = nodes[pos++];
                    if (!node.Equals(other)) {
                        throw new ApplicationException(
                                string.Format("Mismatching nodes at line {0},{1}",
                                li.LineNumber, li.LinePosition));
                    }
                    previousNodeType = node.NodeType;
                }
            }
        }
开发者ID:dbremner,项目名称:xmlnotepad,代码行数:27,代码来源:TestBase.cs

示例8: AddTypeChildren

		protected override void AddTypeChildren (NodeInfoCollection c, NodeInfo parent, Type type)
		{
			object instance = parent.ReflectionInstance;

			foreach (MemberInfo mi in GetMembers (type)) {
				AddNode (c, parent, mi, instance);
			}
		}
开发者ID:emtees,项目名称:old-code,代码行数:8,代码来源:ReflectionNodeFinder.cs

示例9: NodeInfoEventArgs

        /// <summary>
        /// Initializes a new instance of the <see cref="NodeInfoEventArgs"/> class.
        /// </summary>
        /// <param name="nodeInfo">Node info.</param>
        public NodeInfoEventArgs(NodeInfo nodeInfo)
        {
            if (nodeInfo == null)
            {
                throw new ArgumentNullException("nodeInfo");
            }

            NodeInfo = nodeInfo;
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:13,代码来源:NodeInfoEventArgs.cs

示例10: GetChildren

		public override NodeInfoCollection GetChildren (NodeInfo root)
		{
			// We don't want an infinite loop; quite showing children
			Trace.WriteLineIf (info.Enabled, "GetChildren for root.NodeType=" + root.NodeType);
			if (!CanShowChildren (root))
				return new NodeInfoCollection();

			return base.GetChildren (root);
		}
开发者ID:emtees,项目名称:old-code,代码行数:9,代码来源:ExplicitNodeFinder.cs

示例11: CountType

		static int CountType (NodeInfo root, NodeTypes type)
		{
			int count = 0;
			while (root != null) {
				if (root.NodeType == type)
					++count;
				root = root.Parent;
			}
			return count;
		}
开发者ID:emtees,项目名称:old-code,代码行数:10,代码来源:ExplicitNodeFinder.cs

示例12: InHistory

		static bool InHistory (int count, NodeInfo root, params NodeTypes[] types)
		{
			while ((root != null) && (count-- != 0)) {
				foreach (NodeTypes t in types)
					if (root.NodeType == t)
						return true;
				root = root.Parent;
			}
			return false;
		}
开发者ID:emtees,项目名称:old-code,代码行数:10,代码来源:ExplicitNodeFinder.cs

示例13:

		void IGetData.GetData(NodeInfo nodeInfo, CellInfo[] cellData)
		{
			cellData[OutboxManager.ForumColumn].Text = Source;
			cellData[OutboxManager.ForumColumn].ImageIndex = 
				OutboxImageManager.RegetTopicImageIndex;

			cellData[OutboxManager.SubjectColun].Text = Hint;
			
			cellData[OutboxManager.AddInfoColumn].Text = "ID = " + MessageID;
		}
开发者ID:rsdn,项目名称:janus,代码行数:10,代码来源:DownloadTopic.cs

示例14:

		void IGetData.GetData(NodeInfo nodeInfo, CellInfo[] cellData)
		{
			var om = _provider.GetRequiredService<IOutboxManager>();
			cellData[0].Text = Description;
			cellData[0].ImageIndex = ImageIndex;
			cellData[1].Text = $"{(om.NewMessages.Count == 0 ? string.Empty : om.NewMessages.Count.ToString())}/{(om.RateMarks.Count == 0 ? string.Empty : om.RateMarks.Count.ToString())}/{(om.DownloadTopics.Count == 0 ? string.Empty : om.DownloadTopics.Count.ToString())}";

			nodeInfo.Highlight = (om.NewMessages.Count > 0)
				|| (om.RateMarks.Count > 0) || (om.DownloadTopics.Count > 0);
		}
开发者ID:rsdn,项目名称:janus,代码行数:10,代码来源:OutboxFeature.cs

示例15: ReducedErrorPruning

        /// <summary>
        ///   Initializes a new instance of the <see cref="ReducedErrorPruning"/> class.
        /// </summary>
        /// 
        /// <param name="tree">The tree to be prunned.</param>
        /// <param name="inputs">The pruning set inputs.</param>
        /// <param name="outputs">The pruning set outputs.</param>
        /// 
        public ReducedErrorPruning(DecisionTree tree, double[][] inputs, int[] outputs)
        {
            this.tree = tree;
            this.inputs = inputs;
            this.outputs = outputs;
            this.info = new Dictionary<DecisionNode, NodeInfo>();
            this.actual = new int[outputs.Length];

            foreach (var node in tree)
                info[node] = new NodeInfo();

            for (int i = 0; i < inputs.Length; i++)
                trackDecisions(tree.Root, inputs[i], i);
        }
开发者ID:JakeMick,项目名称:framework,代码行数:22,代码来源:ReducedErrorPruning.cs


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