本文整理汇总了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);
}
}
示例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;
}
示例3: AddFadingNode
public void AddFadingNode(FNode node, float showDuration)
{
NodeInfo info = new NodeInfo ();
info.node = node;
info.showDuration = showDuration;
infos.Add (info);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}