/// <summary> /// Runtime Ctor /// </summary> /// <param name="args">commandline argument array</param> public MainForm(string[] args) { try { InitializeComponent(); ToolboxControls = new List <IToolboxControl>(); ResizeControls(); // setup about labelVersionText.Text = String.Format("Version {0}", AssemblyInfo.AssemblyVersion); labelVersionHint.Text = String.Format("Version {0}", AssemblyInfo.AssemblyVersion); labelCopyrightText.Text = AssemblyInfo.AssemblyCopyright; linkLabelCompany.Text = AssemblyInfo.AssemblyCompany; // load controls IntPtr dummyTabPageInsertDoesntWorkWithout = this.tabControlMain.Handle; OfficeCompatibilityControl newControl1 = new OfficeCompatibilityControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl1.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl1); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl1; imageListTabMain.Images.Add(newControl1.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl1.Dock = DockStyle.Fill; ToolboxControls.Add(newControl1); ApplicationObserverControl newControl2 = new ApplicationObserverControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl2.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl2); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl2; imageListTabMain.Images.Add(newControl2.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl2.Dock = DockStyle.Fill; ToolboxControls.Add(newControl2); RegistryEditorControl newControl3 = new RegistryEditorControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl3.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl3); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl3; imageListTabMain.Images.Add(newControl3.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl3.Dock = DockStyle.Fill; ToolboxControls.Add(newControl3); AddinGuardControl newControl4 = new AddinGuardControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl4.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl4); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl4; imageListTabMain.Images.Add(newControl4.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl4.Dock = DockStyle.Fill; ToolboxControls.Add(newControl4); OfficeUIControl newControl6 = new OfficeUIControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl6.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl6); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl6; imageListTabMain.Images.Add(newControl6.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl6.Dock = DockStyle.Fill; ToolboxControls.Add(newControl6); OutlookSecurityControl newControl5 = new OutlookSecurityControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl5.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl5); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl5; imageListTabMain.Images.Add(newControl5.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl5.Dock = DockStyle.Fill; ToolboxControls.Add(newControl5); ProjectWizardControl newControl7 = new ProjectWizardControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl7.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl7); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl7; imageListTabMain.Images.Add(newControl7.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl7.Dock = DockStyle.Fill; ToolboxControls.Add(newControl7); // load configuration LoadConfiguration(); SetupTrayIcon(true); CommandLineArgs = args; } catch (Exception exception) { ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.Critical, CurrentLanguageID); errorForm.ShowDialog(this); } }
/// <summary> /// Runtime Ctor /// </summary> /// <param name="args">commandline argument array</param> public MainForm(string[] args) { try { InitializeComponent(); ToolboxControls = new List<IToolboxControl>(); ResizeControls(); // setup about labelVersionText.Text = String.Format("Version {0}", AssemblyInfo.AssemblyVersion); labelVersionHint.Text = String.Format("Version {0}", AssemblyInfo.AssemblyVersion); labelCopyrightText.Text = AssemblyInfo.AssemblyCopyright; linkLabelCompany.Text = AssemblyInfo.AssemblyCompany; // load controls IntPtr dummyTabPageInsertDoesntWorkWithout = this.tabControlMain.Handle; OfficeCompatibilityControl newControl1 = new OfficeCompatibilityControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl1.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl1); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl1; imageListTabMain.Images.Add(newControl1.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl1.Dock = DockStyle.Fill; ToolboxControls.Add(newControl1); ApplicationObserverControl newControl2 = new ApplicationObserverControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl2.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl2); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl2; imageListTabMain.Images.Add(newControl2.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl2.Dock = DockStyle.Fill; ToolboxControls.Add(newControl2); RegistryEditorControl newControl3 = new RegistryEditorControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl3.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl3); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl3; imageListTabMain.Images.Add(newControl3.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl3.Dock = DockStyle.Fill; ToolboxControls.Add(newControl3); AddinGuardControl newControl4 = new AddinGuardControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl4.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl4); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl4; imageListTabMain.Images.Add(newControl4.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl4.Dock = DockStyle.Fill; ToolboxControls.Add(newControl4); OfficeUIControl newControl6 = new OfficeUIControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl6.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl6); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl6; imageListTabMain.Images.Add(newControl6.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl6.Dock = DockStyle.Fill; ToolboxControls.Add(newControl6); OutlookSecurityControl newControl5 = new OutlookSecurityControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl5.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl5); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl5; imageListTabMain.Images.Add(newControl5.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl5.Dock = DockStyle.Fill; ToolboxControls.Add(newControl5); ProjectWizardControl newControl7 = new ProjectWizardControl(); tabControlMain.TabPages.Insert(tabControlMain.TabPages.Count - 1, newControl7.ControlCaption); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Controls.Add(newControl7); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].Tag = newControl7; imageListTabMain.Images.Add(newControl7.Icon); tabControlMain.TabPages[tabControlMain.TabPages.Count - 2].ImageIndex = imageListTabMain.Images.Count - 1; newControl7.Dock = DockStyle.Fill; ToolboxControls.Add(newControl7); // load configuration LoadConfiguration(); SetupTrayIcon(true); CommandLineArgs = args; } catch (Exception exception) { ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.Critical, CurrentLanguageID); errorForm.ShowDialog(this); } }