public MainForm(IPersistence persistence) { try { this.persistence = persistence; settings.StartDelayedUpdate(); // Set default font type by Windows theme to use for all controls on form this.Font = SystemFonts.IconTitleFont; InitializeComponent(); // main designer procedure this.formSettings = new FormSettings(this); this.terminalsControler = new TerminalTabsSelectionControler(this.tcTerminals, this.persistence); this.connectionsUiFactory = new ConnectionsUiFactory(this, this.terminalsControler, this.persistence); this.terminalsControler.AssingUiFactory(this.connectionsUiFactory); // Initialize FavsList outside of InitializeComponent // Inside InitializeComponent it sometimes caused the design view in VS to return errors this.InitializeFavsListControl(); // Set notifyicon icon from embedded png image this.MainWindowNotifyIcon.Icon = Icon.FromHandle(Properties.Resources.terminalsicon.GetHicon()); this.menuLoader = new FavoritesMenuLoader(this, this.persistence); this.favoriteToolBar.Visible = this.toolStripMenuItemShowHideFavoriteToolbar.Checked; this.fullScreenSwitch = new MainFormFullScreenSwitch(this); this.tabControlRemover = new TabControlRemover(this.settings, this, this.tcTerminals); this.favsList1.Persistence = this.persistence; this.AssignToolStripsToContainer(); this.ApplyControlsEnableAndVisibleState(); this.menuLoader.LoadGroups(); this.UpdateControls(); this.LoadWindowState(); this.CheckForMultiMonitorUse(); this.tcTerminals.TabControlItemDetach += new TabControlItemChangedHandler(this.TcTerminals_TabDetach); this.tcTerminals.MouseClick += new MouseEventHandler(this.TcTerminals_MouseClick); this.QuickContextMenu.ItemClicked += new ToolStripItemClickedEventHandler(QuickContextMenu_ItemClicked); this.LoadSpecialCommands(); ProtocolHandler.Register(); this.persistence.AssignSynchronizationObject(this); } catch (Exception exc) { Logging.Error("Error loading the Main Form", exc); throw; } }
internal void AssingUiFactory(ConnectionsUiFactory connectionsUiFactory) { this.connectionsUiFactory = connectionsUiFactory; }