public Form1() { InitializeComponent(); //m_edmVault = new edmVaultSingleton(); this.toolStripSplitButton2.DefaultItem = this.upOnLevelToolStripMenuItem; this.tabControl1.TabIndexChanged += new EventHandler(tabControl1_TabIndexChanged); LoadExplorers(); this.tabControl1.SelectedIndex = Properties.Settings.Default.LastIndex; this.currentExplorer = (VaultExplorerControl.VaultExplorer)this.tabControl1.SelectedTab.Controls[0]; if (Properties.Settings.Default.LastPath != "" & this.currentExplorer != null) { this.currentExplorer.CurrentPath = Properties.Settings.Default.LastPath; } this.FormClosing += new FormClosingEventHandler(Form1_FormClosing); }
void tabControl1_TabIndexChanged(object sender, EventArgs e) { TabPage page = this.tabControl1.SelectedTab; currentExplorer = (VaultExplorerControl.VaultExplorer)page.Controls[0]; }
private void LoadExplorers() { IEdmVault9 edmVault = (IEdmVault9)edmVaultSingleton.Instance; Array views; EdmViewInfo[] viewInfos; edmVault.GetVaultViews(out views, false); viewInfos = (EdmViewInfo[])views; foreach (EdmViewInfo viewInfo in viewInfos) { this.tabControl1.TabPages.Add(viewInfo.mbsVaultName, viewInfo.mbsVaultName); TabPage page = this.tabControl1.TabPages[viewInfo.mbsVaultName]; VaultExplorerControl.VaultExplorer exp = new VaultExplorerControl.VaultExplorer(viewInfo.mbsPath, viewInfo.mbsVaultName); exp.Dock = DockStyle.Fill; exp.PathChangedEvent += new VaultExplorerControl.VaultExplorer.PathChangedEventHanlder(exp_PathChangedEvent); page.Controls.Add(exp); } }