当前位置: 首页>>代码示例>>C#>>正文


C# TreeControl.ExpandAll方法代码示例

本文整理汇总了C#中Sce.Atf.Controls.TreeControl.ExpandAll方法的典型用法代码示例。如果您正苦于以下问题:C# TreeControl.ExpandAll方法的具体用法?C# TreeControl.ExpandAll怎么用?C# TreeControl.ExpandAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sce.Atf.Controls.TreeControl的用法示例。


在下文中一共展示了TreeControl.ExpandAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SettingsDialog

        /// <summary>
        /// Constructor</summary>
        /// <param name="settingsService">Settings service</param>
        /// <param name="dialogOwner">Dialog owner window HWND</param>
        /// <param name="pathName">Path of settings to display initially, or null</param>
        public SettingsDialog(SettingsService settingsService, IWin32Window dialogOwner, string pathName)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            SplitterRatio = 0.33f;

            m_settingsService = settingsService;
            m_dialogOwner = dialogOwner;

            m_originalState = m_settingsService.UserState; // for cancel

            m_treeControl = new TreeControl(TreeControl.Style.SimpleTree);
            m_treeControl.Dock = DockStyle.Fill;
            m_treeControl.SelectionMode = SelectionMode.One;
            m_treeControl.ShowRoot = false;
            m_treeControl.ImageList = ResourceUtil.GetImageList16();
            m_treeControl.ExpandAll();

            m_treeControl.NodeSelectedChanged += treeControl_NodeSelectedChanged;

            m_treeControlAdapter = new TreeControlAdapter(m_treeControl);
            m_treeControlAdapter.TreeView = settingsService.UserSettings;

            treePanel.Controls.Add(m_treeControl);

            m_propertyGrid = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_propertyGrid.Dock = DockStyle.Fill;
            propertiesPanel.Controls.Add(m_propertyGrid);

            // select an initial node so something is displayed in the PropertyGrid
            TreeControl.Node firstNode = null;
            if (pathName != null)
                firstNode = m_treeControlAdapter.ExpandPath(m_settingsService.GetSettingsPath(pathName));
            if (firstNode == null) // in case pathName is not null, but ExpandPath returns null  
                firstNode = m_treeControl.ExpandToFirstLeaf();
            


            firstNode.Selected = true;
            ShowProperties(m_settingsService.GetProperties((Tree<object>)firstNode.Tag)); //does auto-setting of column widths

            defaultsButton.Click += DefaultsButton_Click;
        }
开发者ID:sbambach,项目名称:ATF,代码行数:50,代码来源:SettingsDialog.cs


注:本文中的Sce.Atf.Controls.TreeControl.ExpandAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。