本文整理汇总了C#中System.Windows.Forms.TreeNode.Realize方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.Realize方法的具体用法?C# TreeNode.Realize怎么用?C# TreeNode.Realize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.Realize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertNodeAt
internal void InsertNodeAt(int index, TreeNode node)
{
this.EnsureCapacity(1);
node.parent = this;
node.index = index;
for (int i = this.childCount; i > index; i--)
{
TreeNode node2;
this.children[i] = node2 = this.children[i - 1];
node2.index = i;
}
this.children[index] = node;
this.childCount++;
node.Realize(false);
if ((this.TreeView != null) && (node == this.TreeView.selectedNode))
{
this.TreeView.SelectedNode = node;
}
}
示例2: InsertNodeAt
/// <include file='doc\TreeNode.uex' path='docs/doc[@for="TreeNode.InsertNodeAt"]/*' />
/// <devdoc>
/// Helper function to add node at a given index after all validation has been done
/// </devdoc>
/// <internalonly/>
internal void InsertNodeAt(int index, TreeNode node) {
EnsureCapacity(1);
node.parent = this;
node.index = index;
for (int i = childCount; i > index; --i) {
(children[i] = children[i-1]).index = i;
}
children[index] = node;
childCount++;
node.Realize(false);
if (TreeView != null && node == TreeView.selectedNode)
TreeView.SelectedNode = node; // communicate this to the handle
}
示例3: AddInternal
private int AddInternal(TreeNode node, int delta)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
if (node.handle != IntPtr.Zero)
{
throw new ArgumentException(System.Windows.Forms.SR.GetString("OnlyOneControl", new object[] { node.Text }), "node");
}
TreeView treeView = this.owner.TreeView;
if ((treeView != null) && treeView.Sorted)
{
return this.owner.AddSorted(node);
}
node.parent = this.owner;
int fixedIndex = this.owner.Nodes.FixedIndex;
if (fixedIndex != -1)
{
node.index = fixedIndex + delta;
}
else
{
this.owner.EnsureCapacity(1);
node.index = this.owner.childCount;
}
this.owner.children[node.index] = node;
this.owner.childCount++;
node.Realize(false);
if ((treeView != null) && (node == treeView.selectedNode))
{
treeView.SelectedNode = node;
}
if ((treeView != null) && (treeView.TreeViewNodeSorter != null))
{
treeView.Sort();
}
return node.index;
}
示例4: AddInternal
private int AddInternal(TreeNode node, int delta) {
if (node == null) {
throw new ArgumentNullException("node");
}
if (node.handle != IntPtr.Zero)
throw new ArgumentException(SR.GetString(SR.OnlyOneControl, node.Text), "node");
// If the TreeView is sorted, index is ignored
TreeView tv = owner.TreeView;
if (tv != null && tv.Sorted) {
return owner.AddSorted(node);
}
node.parent = owner;
int fixedIndex = owner.Nodes.FixedIndex;
if (fixedIndex != -1) {
node.index = fixedIndex + delta;
}
else {
//if fixedIndex != -1 capacity was ensured by AddRange
Debug.Assert(delta == 0,"delta should be 0");
owner.EnsureCapacity(1);
node.index = owner.childCount;
}
owner.children[node.index] = node;
owner.childCount++;
node.Realize(false);
if (tv != null && node == tv.selectedNode)
tv.SelectedNode = node; // communicate this to the handle
if (tv != null && tv.TreeViewNodeSorter != null) {
tv.Sort();
}
return node.index;
}