本文整理汇总了C#中System.Data.Node.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Node.ToString方法的具体用法?C# Node.ToString怎么用?C# Node.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Node
的用法示例。
在下文中一共展示了Node.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: searchPath
public bool searchPath(Dictionary<string, string> pathMap)
{
PriorityQueue<Node> priorityQueue;
priorityQueue = new PriorityQueue<Node>();
priorityQueue.Push(this.begainNode);
while (!priorityQueue.Empty())
{
Node topNode = priorityQueue.Pop();
#region 判断是否找到目状态
if (matched(topNode, this.targetNode))
{
MessageBox.Show("Finished!");
return true;
}
#endregion
int row = topNode.row_0;
int col = topNode.col_0;
if (row > 0 && topNode.cannotAct != Direction.up)
{
Node curNode = new Node(topNode);
exchange(curNode, row, col, row - 1, col);
curNode.ToString();
curNode.cannotAct = Direction.down;
if (!pathMap.ContainsKey(curNode.state))
{
curNode.deepth = topNode.deepth + 1;
curNode.value = getValue(curNode, this.targetNode);
curNode.row_0 = row - 1;
curNode.col_0 = col;
priorityQueue.Push(curNode);
pathMap.Add(curNode.state, topNode.state);
}
}
if (row < 2 && topNode.cannotAct != Direction.down)
{
Node curNode = new Node(topNode);
exchange(curNode, row, col, row + 1, col);
curNode.ToString();
curNode.cannotAct = Direction.up;
if (!pathMap.ContainsKey(curNode.state))
{
curNode.deepth = topNode.deepth + 1;
curNode.value = getValue(curNode, this.targetNode);
curNode.row_0 = row + 1;
curNode.col_0 = col;
priorityQueue.Push(curNode);
pathMap.Add(curNode.state, topNode.state);
}
}
if (col > 0 && topNode.cannotAct != Direction.left)
{
Node curNode = new Node(topNode);
exchange(curNode, row, col, row, col - 1);
curNode.ToString();
curNode.cannotAct = Direction.left;
if (!pathMap.ContainsKey(curNode.state))
{
curNode.deepth = topNode.deepth + 1;
curNode.value = getValue(curNode, this.targetNode);
curNode.row_0 = row;
curNode.col_0 = col - 1;
priorityQueue.Push(curNode);
pathMap.Add(curNode.state, topNode.state);
}
}
if (col < 2 && topNode.cannotAct != Direction.right)
{
Node curNode = new Node(topNode);
exchange(curNode, row, col, row, col + 1);
curNode.ToString();
curNode.cannotAct = Direction.right;
if (!pathMap.ContainsKey(curNode.state))
{
curNode.deepth = topNode.deepth + 1;
curNode.value = getValue(curNode, this.targetNode);
curNode.row_0 = row;
curNode.col_0 = col + 1;
priorityQueue.Push(curNode);
pathMap.Add(curNode.state, topNode.state);
}
}
}
return false;
}
示例2: AddNode
private void AddNode(Node node)
{
List<TreeNode> ChildNodes = new List<TreeNode>();
ChildNodes.Add(new TreeNode(node.ToString()));
TreeNode Tn = new TreeNode("Status - " + node.IsOnline_ToString());
Tn.Name = "Status";
ChildNodes.Add(Tn);
Tn = new TreeNode();
Tn.Name = "Version";
ChildNodes.Add(Tn);
Tn = new TreeNode();
Tn.Name = "CRC";
ChildNodes.Add(Tn);
Tn = new TreeNode();
Tn.Name = "Ckp Count";
ChildNodes.Add(Tn);
Tn = new TreeNode();
Tn.Name = "DeviceType";
ChildNodes.Add(Tn);
Tn = new TreeNode();
Tn.Name = "Serial";
ChildNodes.Add(Tn);
Tn = new TreeNode();
Tn.Name = "AppName";
ChildNodes.Add(Tn);
TreeNode NewParentNode = new TreeNode("Node - 0x" + node.NodeId.ToString("X2"), ChildNodes.ToArray<TreeNode>());
NewParentNode.Tag = node;
tvNodes.Nodes.Add(NewParentNode);
}
示例3: RefreshGUI
private void RefreshGUI(TreeNodeCollection Tree, Node<int> Node)
{
if (Node != null)
{
String text = Node.ToString();
if (AdvancedBTree<int>.isLeft(Node))
text += " (Левый)";
else
if (AdvancedBTree<int>.isParent(Node))
text += " (Корень)";
else
text += " (Правый)";
Tree.Add(text);
RefreshGUI(Tree[Tree.Count - 1].Nodes, Node.Left);
RefreshGUI(Tree[Tree.Count - 1].Nodes, Node.Right);
}
}