本文整理汇总了C#中NodeInfo类的典型用法代码示例。如果您正苦于以下问题:C# NodeInfo类的具体用法?C# NodeInfo怎么用?C# NodeInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeInfo类属于命名空间,在下文中一共展示了NodeInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetDescription
public string GetDescription (NodeInfo node)
{
string r = "";
switch (node.NodeType) {
case NodeTypes.Type:
r = GetTypeDescription ((Type)node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.BaseType:
r = GetBaseTypeDescription ((Type)node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Interface:
r = GetInterfaceDescription ((Type)node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Field:
r = GetFieldDescription ((FieldInfo)node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Constructor:
r = GetConstructorDescription ((ConstructorInfo)node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Method:
r = GetMethodDescription ((MethodInfo) node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Parameter:
r = GetParameterDescription ((ParameterInfo) node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Property:
r = GetPropertyDescription ((PropertyInfo) node.ReflectionObject, node.ReflectionInstance);
break;
case NodeTypes.Event:
r = GetEventDescription ((EventInfo) node.ReflectionObject, node.ReflectionInstance);
break;
/*
case NodeTypes.CustomAttributeProvider:
r = GetCustomAttributeProviderDescription ((ICustomAttributeProvider) node.ReflectionObject, node.ReflectionInstance);
break;
*/
case NodeTypes.Other:
case NodeTypes.Alias:
r = GetOtherDescription (node);
break;
case NodeTypes.ReturnValue:
r = GetReturnValueDescription (node);
break;
default:
Debug.Assert (false,
String.Format ("Unhandled NodeInfo value: {0}", node.NodeType));
break;
}
return r;
}
开发者ID:emtees,项目名称:old-code,代码行数:50,代码来源:NodeFormatter.cs
示例17: GetClusterMetadata
public ClusterMetadata GetClusterMetadata()
{
var req = CreateRequest("GetClusterMetadata");
var resp = SendReceive(req);
var sz = resp.ReadInt32();
var list = new List<NodeInfo>(sz);
for (int i = 0; i < sz; i++)
{
var node = new NodeInfo();
node.Address = resp.ReadString();
node.IsMaster = resp.ReadBoolean();
list.Add(node);
}
return new ClusterMetadata(list);
}
开发者ID:eleks,项目名称:FloatingQueuePoC,代码行数:15,代码来源:TCPQueueServiceProxy.cs
示例18: createNodeInfo
private static NodeInfo createNodeInfo(DateTime? dt = null)
{
NodeInfo node = new NodeInfo();
node.DiskAvailableFreeSpace = 100500;
node.DiskUsage = 43.5;
node.MemAvailable = 54.3;
node.MemUsage = 34.2;
node.Net = 3.14;
node.Offline = false;
node.ProcUsage = 76.8;
node.SandBoxTotalSize = 455000;
node.TimeSnapshot = dt ?? DateTime.Now;
return node;
}
开发者ID:kbochenina,项目名称:Kraken,代码行数:16,代码来源:ProfilingSamples.cs
示例19: SaveChildren
void SaveChildren (List<NodeInfo> info, TreePosition it)
{
int num = tree.DataSource.GetChildrenCount (it);
for (int n=0; n<num; n++) {
var child = tree.DataSource.GetChild (it, n);
object id = tree.DataSource.GetValue (child, idColumn);
NodeInfo ni = new NodeInfo ();
ni.Id = id;
ni.Expanded = tree.IsRowExpanded (child);
ni.Selected = tree.IsRowSelected (child);
info.Add (ni);
if (tree.DataSource.GetChildrenCount (child) > 0) {
ni.ChildInfo = new List<NodeInfo> ();
SaveChildren (ni.ChildInfo, child);
}
}
}
开发者ID:m13253,项目名称:xwt,代码行数:17,代码来源:TreeViewStatus.cs
示例20: Save
void Save (List<NodeInfo> info, TreeIter it)
{
do {
object id = tree.Model.GetValue (it, idColumn);
NodeInfo ni = new NodeInfo ();
ni.Id = id;
ni.Expanded = tree.GetRowExpanded (tree.Model.GetPath (it));
ni.Selected = tree.Selection.IterIsSelected (it);
info.Add (ni);
TreeIter cit;
if (tree.Model.IterChildren (out cit, it)) {
ni.ChildInfo = new List<NodeInfo> ();
Save (ni.ChildInfo, cit);
}
}
while (tree.Model.IterNext (ref it));
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:17,代码来源:TreeViewState.cs
注:本文中的NodeInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论