Esempio n. 1
0
        public FormDatabase(IDatabase database, ArchAngel.Providers.EntityModel.Model.MappingLayer.MappingSet mappingSet)
        {
            InitializeComponent();

            Instance = this;

            ArchAngel.Interfaces.SharedData.AboutToSave += new EventHandler(SharedData_AboutToSave);
            modelChanges1.RefreshCalled += new EventHandler(RefreshWasCalled);

            labelTablePrefixes.Top    = ucDatabaseInformation1.BottomOfControls + 20;
            textBoxTablePrefixes.Top  = labelTablePrefixes.Top;
            labelColumnPrefixes.Top   = textBoxTablePrefixes.Bottom + 5;
            textBoxColumnPrefixes.Top = labelColumnPrefixes.Top;

            labelTableSuffixes.Top    = textBoxColumnPrefixes.Bottom + 5;
            textBoxTableSuffixes.Top  = labelTableSuffixes.Top;
            labelColumnSuffixes.Top   = textBoxTableSuffixes.Bottom + 5;
            textBoxColumnSuffixes.Top = labelColumnSuffixes.Top;

            buttonResync.Top         = textBoxColumnSuffixes.Bottom + 20;
            buttonTestConnection.Top = buttonResync.Top;

            if (DesignMode)
            {
                return;
            }

            superTabConnectionSettings.SelectedTab = superTabItemConnection;
            MappingSet = mappingSet;
            ucDatabaseInformation1.UsernameChanged             += (sender, e) => UsernameChanged.RaiseEvent(sender, e);
            ucDatabaseInformation1.PasswordChanged             += (sender, e) => PasswordChanged.RaiseEvent(sender, e);
            ucDatabaseInformation1.SelectedDatabaseChanged     += (sender, e) => SelectedDatabaseChanged.RaiseEvent(sender, e);
            ucDatabaseInformation1.SelectedDatabaseTypeChanged += (sender, e) => SelectedDatabaseTypeChanged.RaiseEvent(sender, e);
            ucDatabaseInformation1.ServerNameChanged           += (sender, e) => ServerNameChanged.RaiseEvent(sender, e);

            Database = database;

            if (Database != null)
            {
                labelHeader.Text = Database.Name;
            }
            else
            {
                labelHeader.Text = "No Database Selected";
            }

            PopulatePrefixes();

            buttonImport.Enabled = false;
        }
Esempio n. 2
0
        public ucDatabaseInformation()
        {
            InitializeComponent();

            ArchAngel.Interfaces.SharedData.AboutToSave += new EventHandler(SharedData_AboutToSave);

            //panel1.Width = buttonBrowse.Right + checkBoxDirect.Left;

            if (DesignMode)
            {
                return;
            }

            Populate();

            this.ForeColor      = Color.White;
            labelPort.ForeColor = Color.White;

            labelTestStatus.Text = "";

            // See below
            //comboBoxServers.SelectedIndexChanged += comboBoxServers_DropDownChange;
            //comboBoxDatabases.SelectedIndexChanged += comboBoxDatabases_DropDownChange;
            //comboBoxSchemas.SelectedIndexChanged += comboBoxSchemas_DropDownChange;

            EventHandler invalidateDatabase = (s, e) => InvalidateDatabaseCache = true;

            comboBoxServers.TextChanged                  += invalidateDatabase;
            comboBoxServers.SelectedIndexChanged         += invalidateDatabase;
            checkBoxUseIntegratedSecurity.CheckedChanged += invalidateDatabase;
            textBoxFilename.TextChanged                  += invalidateDatabase;
            textBoxPassword.TextChanged                  += invalidateDatabase;
            textBoxUserName.TextChanged                  += invalidateDatabase;
            textBoxPort.TextChanged        += invalidateDatabase;
            textBoxServiceName.TextChanged += invalidateDatabase;

            checkBoxUseIntegratedSecurity.CheckedChanged += checkBoxUseIntegratedSecurity_CheckedChanged;
            comboBoxDatabaseTypes.SelectedIndexChanged   += comboBoxDatabaseTypes_SelectedIndexChanged;
            textBoxFilename.TextChanged          += textBoxFilename_TextChanged;
            comboBoxDatabases.TextChanged        += comboBoxDatabases_TextChanged;
            comboBoxServers.SelectedIndexChanged += (s, e) => ServerNameChanged.RaiseEventEx(this);
            textBoxPassword.TextChanged          += (s, e) => PasswordChanged.RaiseEventEx(this);
            textBoxUserName.TextChanged          += (s, e) => UsernameChanged.RaiseEventEx(this);

            worker.DoWork += worker_DoWork;

            SetSecurityInputEnabledStatus();
        }