Beispiel #1
0
        public FrmViewSource(ApplicationState appState, ProcedureObject procedureObject)
        {
            _appState               = appState;
            _procedureObject        = procedureObject;
            _baseFormPresenter      = new BaseFormPresenter(this);
            _frmViewSourcePresenter = new FrmViewSourcePresenter(this);

            InitializeComponent();

            var eventArgs = _appState.GetFormLocationAndPosition(this);

            DoFormLoad(this, eventArgs);
        }
Beispiel #2
0
        public FrmLogin(string server, ApplicationState appState)
        {
            _appState          = appState;
            _baseFormPresenter = new BaseFormPresenter(this);
            _frmLoginPresenter = new FrmLoginPresenter(this);

            InitializeComponent();

            var eventArgs = _appState.GetFormLocationAndPosition(this);

            DoFormLoad(this, eventArgs);

            _server = server;
            rbWindowsLogon.Checked   = _appState.LastUsedLoginMethod == ApplicationState.LastUsedLoginMethods.WindowsLogon;
            rbSqlServerLogon.Checked = _appState.LastUsedLoginMethod == ApplicationState.LastUsedLoginMethods.SqlServerLogon;
        }
        public FrmSqlServerSearcher()
        {
            _appState          = ApplicationState.ReadApplicationState();
            _baseFormPresenter = new BaseFormPresenter(this);
            var searches = new DAL.Searches(_appState);

            _frmSqlServerSearcherPresenter = new FrmSqlServerSearcherPresenter(this, searches);

            InitializeComponent();

            var eventArgs = _appState.GetFormLocationAndPosition(this);

            DoFormLoad(this, eventArgs);
            if (EnableDisableBtnConnect != null)
            {
                EnableDisableBtnConnect(null, EventArgs.Empty);
            }
            _appState.ReadComboBoxElements(cmbServer, _appState.Servers, (server, i) => cmbServer.Items.Add(server));
            _appState.ReadComboBoxElements(cmbFindText, _appState.PreviousSearches, (query, i) => cmbFindText.Items.Add(query));
            chkTables.Checked           = _appState.LookInTables;
            chkIndexes.Checked          = _appState.LookInIndexes;
            chkViews.Checked            = _appState.LookInViews;
            chkStoredProcedures.Checked = _appState.LookInStoredProcedures;
            chkFunctions.Checked        = _appState.LookInFunctions;
            chkMatchCase.Checked        = _appState.MatchCase;
            if (_appState.NameColumnWith > 0)
            {
                colName.Width = _appState.NameColumnWith;
            }
            if (_appState.ValueColumnWith > 0)
            {
                colValue.Width = _appState.ValueColumnWith;
            }
            if (_appState.ServerPropertyNameColumnWith > 0)
            {
                colServerPropertyName.Width = _appState.ServerPropertyNameColumnWith;
            }
            if (_appState.ServerPropertyValueColumnWith > 0)
            {
                colServerPropertyValue.Width = _appState.ServerPropertyValueColumnWith;
            }
            EnableDisableControls();
        }