Exemple #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;
        }
        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;
        }