Settings for hoTools. It merges default settings (ActiveX.dll.config) with current settings in install directory to the current settings.
        /// <summary>
        /// Constructor
        /// </summary>
        public FrmQueryAndScript(AddinSettings settings)
        {
            InitializeComponent();
            _settings = settings;

            // Query window without script
            switch (_settings.OnlyQueryWindow) {
                case AddinSettings.ShowInWindow.AddinWindow:
                    rbOnlyQueryAddinWindow.Checked = true;
                    break;
                case AddinSettings.ShowInWindow.TabWindow:
                    rbOnlyQueryTabWindow.Checked = true;
                    break;
                default:
                    rbOnlyQueryDisableWindow.Checked = true;
                    break;
            }
            // Query window wit script
            switch (_settings.ScriptAndQueryWindow)
            {
                case AddinSettings.ShowInWindow.AddinWindow:
                    rbScriptAndQueryAddinWindow.Checked = true;
                    break;
                case AddinSettings.ShowInWindow.TabWindow:
                    rbScriptAndQueryTabWindow.Checked = true;
                    break;
                default:
                    rbScriptAndQueryDisableWindow.Checked = true;
                    break;
            }

            // Ask for update if sql file has changed
            chkIsAskForUpdate.Checked = _settings.IsAskForQueryUpdateOutside;
            // SQL editor
            txtSqlEditor.Text = _settings.SqlEditor;

            txtAddinTabToFirstActivate.Text = _settings.AddinTabToFirstActivate;

            txtSqlSearchPath.Text = _settings.SqlPaths;
        }
        /// <summary>
        /// Constructor with
        /// </summary>
        /// <param name="settings">Object with settings</param>
        /// <param name="addinControl">Object with Control</param>
        public FrmSettingsLineStyle(AddinSettings settings, AddinControlGui addinControl)
        {
            InitializeComponent();

            _settings = settings;
            _addinControl = addinControl;

          
            #region line style
            // line style
            var items = new string[]{"A Automatic","C Custom","D Direct","B Bezier curve",
                "LV Lateral Vertical","LH Lateral Horizontal","no","OR Orthogonal Rounded",
                "OS Orthogonal Square","TH Tree Horizontal","TV Tree Vertical"};
            string[] itemsActivity = new string[items.Length];
            items.CopyTo(itemsActivity, 0);

            string[] itemsStatechart = new string[items.Length];
            items.CopyTo(itemsStatechart, 0);

            string[] itemsCustom = new string[items.Length];
            items.CopyTo(itemsCustom, 0);

            string[] itemsClass = new string[items.Length];
            items.CopyTo(itemsClass, 0);

            string[] itemsComponent = new string[items.Length];
            items.CopyTo(itemsComponent, 0);

            string[] itemsUseCase = new string[items.Length];
            items.CopyTo(itemsUseCase, 0);

            string[] itemsPackage = new string[items.Length];
            items.CopyTo(itemsPackage, 0);

            string[] itemsDeployment = new string[items.Length];
            items.CopyTo(itemsDeployment, 0);

            string[] itemsCompositeStructure = new string[items.Length];
            items.CopyTo(itemsCompositeStructure, 0);



            this.cboActivityLineStyle.DataSource = itemsActivity;
            this.cboStatechartLineStyle.DataSource = itemsStatechart;
            this.cboClassLineStyle.DataSource = itemsClass; 
            this.cboComponentLineStyle.DataSource = itemsComponent;
            this.cboPackageLineStyle.DataSource = itemsPackage; 
            this.cboCustomLineStyle.DataSource = itemsCustom; 
            this.cboUseCaseLineStyle.DataSource = itemsUseCase; 
            this.cboDeploymentLineStyle.DataSource = itemsDeployment;
            this.cboCompositeStructureLineStyle.DataSource = itemsCompositeStructure; 

            this.cboActivityLineStyle.Text = settings.ActivityLineStyle;
            this.cboStatechartLineStyle.Text = settings.StatechartLineStyle;
            this.cboClassLineStyle.Text = settings.ClassLineStyle;
            this.cboComponentLineStyle.Text = settings.ComponentLineStyle;
            this.cboPackageLineStyle.Text = settings.PackageLineStyle;
            this.cboCustomLineStyle.Text = settings.CustomLineStyle;
            this.cboUseCaseLineStyle.Text = settings.UseCaseLineStyle;
            this.cboDeploymentLineStyle.Text = settings.DeploymentLineStyle;
            this.cboCompositeStructureLineStyle.Text = settings.CompositeStructureLineStyle;
            #endregion

            
            // Search
           


        }
        /// <summary>
        /// Constructor to Initialize TabControl, create ToolStripItems (New Tab from, Recent Files) with file history. 
        /// </summary>
        /// <param name="model"></param>
        /// <param name="settings"></param>
        /// <param name="components"></param>
        /// <param name="tabControl"></param>
        /// <param name="sqlTextBoxSearchTerm"></param>
        /// <param name="fileNewTabAndLoadRecentFileMenuItem">File, New Tab from recent files</param>
        /// <param name="fileLoadTabRecentFileMenuItem">File, Load Tab from recent files</param>
        /// <param name="addinTabName"></param>
        public SqlTabPagesCntrl(Model model, AddinSettings settings,
            System.ComponentModel.IContainer components,
            TabControl tabControl, TextBox sqlTextBoxSearchTerm,
            ToolStripMenuItem fileNewTabAndLoadRecentFileMenuItem,
            ToolStripMenuItem fileLoadTabRecentFileMenuItem, 
            string addinTabName)
        {
            Settings = settings;
            _model = model;
            _tabControl = tabControl;
            _components = components;
            _sqlTextBoxSearchTerm = sqlTextBoxSearchTerm;



            // Recent MenuItems to complete with items of recent files
            _fileNewTabAndLoadRecentFileMenuItem = fileNewTabAndLoadRecentFileMenuItem;
            _fileLoadTabRecentFileMenuItem = fileLoadTabRecentFileMenuItem;

            // Update text and tooltip for menu item
            _tabLoadTabFromRecentFileMenuItem.Text = MenuLoadTabFromRecentFileText;
            _tabLoadTabFromRecentFileMenuItem.ToolTipText = MenuLoadTabFromRecentFileTooltip;



            _tabNewTabFromRecentFileMenuItem.Text = MenuNewTabFromRecentText;
            _tabNewTabFromRecentFileMenuItem.ToolTipText = MenuNewTabFromRecentTooltip;

            
            LoadOpenedTabsFromLastSession();
            

            // Load recent files into ToolStripMenu
            LoadRecentFilesIntoToolStripItems();
            _addinTabName = addinTabName;

        }
        /// <summary>
        /// Constructor with
        /// </summary>
        /// <param name="settings">Object with settings</param>
        /// <param name="addinControl"></param>
        public FrmSettingsGeneral(AddinSettings settings, AddinControlGui addinControl)
        {
            InitializeComponent();
            _settings = settings;
            _addinControl = addinControl;


            #region miscellaneous
            // SQL paths
            txtSqlSearchPath.Text = _settings.SqlPaths;
            txtAddinTabToFirstActivate.Text = _settings.AddinTabToFirstActivate;

            chkLineStyleSupport.Checked = settings.IsLineStyleSupport;
            chkShortKeySupport.Checked = settings.IsShortKeySupport;
            _chkQuickSearchSupport.Checked = settings.IsQuickSearchSupport;

            chkShowServiceButtons.Checked = settings.IsShowServiceButton;
            chkShowQueryButtons.Checked = settings.IsShowQueryButton;
            chkFavoriteSupport.Checked = settings.IsFavoriteSupport;
            chkConveyedItemSupport.Checked = settings.IsConveyedItemsSupport;


            txtQuickSearch.Text = settings.QuickSearchName;
            txtFileManagerPath.Text = settings.FileManagerPath;
            chkAdvancedFeatures.Checked = settings.IsAdvancedFeatures;
            chkSvnSupport.Checked = settings.IsSvnSupport;
            chkVcSupport.Checked = settings.IsVcSupport;
            chkAdvancedPort.Checked = settings.IsAdvancedPort;
            chkAdvancedDiagramNote.Checked = settings.IsAdvancedDiagramNote;
            #endregion

            #region AutoLoadMdg
            // Initialize Auto Load MDG
            switch (_settings.AutoLoadMdgXml)
            {
                case AddinSettings.AutoLoadMdg.Basic:
                    rbAutoLoadMdgBasic.Checked = true;
                    break;
                case AddinSettings.AutoLoadMdg.Compilation:
                    rbAutoLoadMdgCompilation.Checked = true;
                    break;
                default:
                    rbAutoLoadMdgNo.Checked = true;
                    break;
            }
            #endregion

            #region LineStyleAndMoreWindow
            // Initialize LineStyle Window
            switch (_settings.LineStyleAndMoreWindow)
            {
                case AddinSettings.ShowInWindow.AddinWindow:
                    rbLineStyleAndMoreAddinWindow.Checked = true;
                    break;
                case AddinSettings.ShowInWindow.TabWindow:
                    rbLineStyleAndMoreTabWindow.Checked = true;
                    break;
                default:
                    rbLineStyleAndMoreDisableWindow.Checked = true;
                    break;
            }
            #endregion

            #region SearchAndReplaceWindow
            // Initialize Search and Replace Window
            switch (_settings.SearchAndReplaceWindow)
            {
                case AddinSettings.ShowInWindow.AddinWindow:
                    rbSearchAndReplaceAddinWindow.Checked = true;
                    break;
                case AddinSettings.ShowInWindow.TabWindow:
                    rbSearchAndReplaceTabWindow.Checked = true;
                    break;
                default:
                    rbSearchAndReplaceDisableWindow.Checked = true;
                    break;
            }
            #endregion
        }