本文整理汇总了C#中TreeListNode.ExpandAll方法的典型用法代码示例。如果您正苦于以下问题:C# TreeListNode.ExpandAll方法的具体用法?C# TreeListNode.ExpandAll怎么用?C# TreeListNode.ExpandAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeListNode
的用法示例。
在下文中一共展示了TreeListNode.ExpandAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpandNode
private void ExpandNode(TreeListNode nodeTarget,bool refresh)
{
if (nodeTarget == null)
return;
if (!refresh && nodeTarget.HasChildren)
return;
nodeTarget.Nodes.Clear();
ICatalogItem catalogItem = nodeTarget.Tag as ICatalogItem;
if (!catalogItem.HasChild)
return;
SendMessage("正在加载,请稍候...");
try
{
List<ICatalogItem> catalogItemList = catalogItem.Childrens;
if (catalogItemList == null)
{
DevExpress.XtraEditors.XtraMessageBox.Show("打开失败");
return;
}
foreach (ICatalogItem subItem in catalogItemList)
{
if (subItem == null)
continue;
TreeListNode nodeSub = m_TreeList.AppendNode(new object[] { subItem.Name }, nodeTarget);
nodeSub.Tag = subItem;
nodeSub.ImageIndex = File3DHelper.GetCatalogImageIndex(subItem);
nodeSub.SelectImageIndex = 18;
BandEvent(nodeSub, subItem);
//subItem.OnOpen += delegate
//{
// ExpandNode(nodeSub, true);
//};
//subItem.OnRefresh += delegate
//{
// nodeSub.Nodes.Clear();
// if (subItem is IWorkspaceCatalogItem)
// {
// nodeSub.ImageIndex = 0;
// }
//};
}
nodeTarget.ExpandAll();
// 如果是Workspace,改成连接的图标
if (catalogItem is IWorkspaceCatalogItem)
{
nodeTarget.ImageIndex = 1;
}
SendMessage("加载完成。");
}
catch
{
SendMessage("加载失败!");
}
finally
{
}
}
示例2: ExpandNode
private void ExpandNode(TreeListNode node)
{
node.ExpandAll();
node.StateImageIndex = 1;
}
示例3: GetChildOfFocusedNode
private string GetChildOfFocusedNode(TreeListNode node)
{
selectecdIDNodes.Append(node.GetValue("ID").ToString() + " ");
if (node.HasChildren)
{
node.ExpandAll();
TreeListNode childNode = node.NextVisibleNode;
while (childNode.Level != node.Level) {
selectecdIDNodes.Append(childNode.GetValue("ID").ToString() + " ");
childNode = childNode.NextVisibleNode;
}
return selectecdIDNodes.ToString();
}
else {
return selectecdIDNodes.ToString();
}
}