當前位置: 首頁>>代碼示例>>C#>>正文


C# TreeControl.ExpandToFirstLeaf方法代碼示例

本文整理匯總了C#中Sce.Atf.Controls.TreeControl.ExpandToFirstLeaf方法的典型用法代碼示例。如果您正苦於以下問題:C# TreeControl.ExpandToFirstLeaf方法的具體用法?C# TreeControl.ExpandToFirstLeaf怎麽用?C# TreeControl.ExpandToFirstLeaf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sce.Atf.Controls.TreeControl的用法示例。


在下文中一共展示了TreeControl.ExpandToFirstLeaf方法的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.ExpandToFirstLeaf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。