コード例 #1
0
ファイル: DockTreeView.cs プロジェクト: treeDiM/PackLib4ES
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // cardboard format loader
            CardboardFormatLoader formatLoader = new CardboardFormatLoaderImpl();

            pluginViewCtrl.CardboardFormatLoader  = formatLoader;
            factoryViewCtrl.CardBoardFormatLoader = formatLoader;

            pluginViewCtrl.Localizer = LocalizerImpl.Instance;
            pluginViewCtrl.DependancyStatusChanged += new PluginViewUCtrl.DependancyStatusChangedHandler(_main.DependancyStatusChanged);
            // profile loader
            pluginViewCtrl.ProfileLoader = _profileLoaderImpl;
            // search method
            ComponentSearchMethodDB searchmethod = new ComponentSearchMethodDB();

            pluginViewCtrl.SearchMethod = new ComponentSearchMethodDB();

            treeView.SelectionChanged += new DocumentTreeView.SelectionChangedHandler(branchViewCtrl.OnSelectionChanged);
            treeView.SelectionChanged += new DocumentTreeView.SelectionChangedHandler(OnSelectionChanged);

            branchViewCtrl.SelectionChanged += new BranchViewControl.SelectionChangedHandler(treeView.OnSelectionChanged);
            branchViewCtrl.SelectionChanged += new BranchViewControl.SelectionChangedHandler(OnSelectionChanged);
            branchViewCtrl.TreeNodeCreated  += new BranchViewControl.TreeNodeCreatedHandler(treeView.OnTreeNodeCreated);

            // construct tree
            // this line was moved here from the treeview contructor
            // to avoid running this code while in design mode
            treeView.RefreshTree();
            treeView.CollapseRootChildrens();

            SelectionChanged?.Invoke(this);
        }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: minrogi/PLMPackLib
        private void FormMain_Load(object sender, EventArgs e)
        {
            try
            {
                // make ToolStripButton available
                toolStripButtonOceProCut.Available = Properties.Settings.Default.TSButtonAvailableOceProCut;
                toolStripButtonARISTO.Available = Properties.Settings.Default.TSButtonAvailableARISTO;
                toolStripButtonZUND.Available = Properties.Settings.Default.TSButtonAvailableZUND;

                // construct tree
                // this line was moved here from the treeview contructor
                // to avoid running this code while in design mode
                _treeViewCtrl.RefreshTree();

                // load settings only if not in debug mode
                if (!Properties.Settings.Default.DebugMode)
                    ToolStripManager.LoadSettings(this, this.Name);

                // --- instantiate and start splach screen thread
                // cardboard format loader
                CardboardFormatLoader formatLoader = new CardboardFormatLoaderImpl();
                _pluginViewCtrl.CardboardFormatLoader = formatLoader;
                _factoryViewCtrl.CardBoardFormatLoader = formatLoader;

                // profile loader
                _profileLoaderImpl = new ProfileLoaderImpl();
                _pluginViewCtrl.ProfileLoader = _profileLoaderImpl;
                // search method
                ComponentSearchMethodDB searchmethod = new ComponentSearchMethodDB();
                _pluginViewCtrl.SearchMethod = new ComponentSearchMethodDB();

                _treeViewCtrl.StartPageSelected += new DocumentTreeView.StartPageSelectHandler(ShowStartPage);
                _treeViewCtrl.DownloadPageSelected += new DocumentTreeView.DownloadPageSelectHandler(ShowDownloadPage);

                _treeViewCtrl.SelectionChanged += new DocumentTreeView.SelectionChangedHandler(_branchViewCtrl.OnSelectionChanged);
                _treeViewCtrl.SelectionChanged += new DocumentTreeView.SelectionChangedHandler(OnSelectionChanged);

                _branchViewCtrl.SelectionChanged += new DocumentTreeBranchView.SelectionChangedHandler(_treeViewCtrl.OnSelectionChanged);
                _branchViewCtrl.SelectionChanged += new DocumentTreeBranchView.SelectionChangedHandler(OnSelectionChanged);
                _branchViewCtrl.TreeNodeCreated += new DocumentTreeBranchView.TreeNodeCreatedHandler(_treeViewCtrl.OnTreeNodeCreated);

                // ---
                // initialize menu state
                PicGlobalCotationProperties.ShowShortCotationLines = PicParam.Properties.Settings.Default.UseCotationShortLines;
                _log.Info(string.Format("ShowShortCotationLines initialized with value : {0}", PicParam.Properties.Settings.Default.UseCotationShortLines.ToString()));
                toolStripMenuItemCotationShortLines.Checked = PicGlobalCotationProperties.ShowShortCotationLines;

                // show start page
                if (_showRoot)
                    _treeViewCtrl.CollapseRootChildrens();
                else
                    ShowStartPage(this);
                // update tool bars
                UpdateToolCommands();

                // Most recently used databases
                mruManager = new MRUManager();
                mruManager.Initialize(
                    this,                              // owner form
                    databaseToolStripMenuItem,         // Recent Files menu item
                    mnuFileMRU,                        // Recent Files menu item
                    "Software\\treeDiM\\PLMPackLib");  // Registry path to keep MRU list

                mruManager.Add(Pic.DAL.ApplicationConfiguration.CustomSection.DatabasePath);
            }
            catch (System.Exception ex)
            {
                Debug.Fail(ex.ToString());
                _log.Error(ex.ToString());
            }
            // restore window position
            if (null != Settings.Default.MainFormSettings && !Settings.Default.StartMaximized)
            {
                Settings.Default.MainFormSettings.Restore(this);
            }
            // show maximized
            if (Settings.Default.StartMaximized)
                WindowState = FormWindowState.Maximized;
        }