Exemplo n.º 1
0
        /// <summary>
        /// Read the configuration data from the configuration file into the controls
        /// </summary>
        /// <param name="configuration"></param>
        private void ReadConfigurationData(Configuration configuration)
        {
            if (configuration == null)
            {
                return;
            }

            IEnumerator enumerator = managerStorageTypes.Items.GetEnumerator();

            while (enumerator.MoveNext())
            {
                ManagerStorageTypeDropdownItem item = (ManagerStorageTypeDropdownItem)enumerator.Current;

                if (item.StorageType == configuration.DbType)
                {
                    managerStorageTypes.SelectedItem = item;
                }
            }

            databaseServer.Text      = configuration.DbServer;
            databaseName.Text        = configuration.DbName;
            tbDatabaseDirectory.Text = Path.GetDirectoryName(configuration.DbFilePath);
            tbDatabaseName.Text      = Path.GetFileName(configuration.DbFilePath);
            databaseUsername.Text    = configuration.DbUsername;
            databasePassword.Text    = configuration.DbPassword;
        }
Exemplo n.º 2
0
        private void managerStorageTypes_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ManagerStorageTypeDropdownItem item = (ManagerStorageTypeDropdownItem)managerStorageTypes.SelectedItem;

            if (item.StorageType == ManagerStorageEnum.InMemory)
            {
                // remove the last two tabs if there
                databaseLocationTab.Visible = false;
                if (tabs.TabPages.IndexOf(databaseLocationTab) != -1)
                {
                    tabs.TabPages.RemoveAt(tabs.TabPages.IndexOf(databaseLocationTab));
                }

                databaseUserTab.Visible = false;
                if (tabs.TabPages.IndexOf(databaseUserTab) != -1)
                {
                    tabs.TabPages.RemoveAt(tabs.TabPages.IndexOf(databaseUserTab));
                }

                storageTypeNext.Visible = false;
            }
            else
            {
                databaseLocationTab.Visible = true;
                databaseUserTab.Visible     = true;

                storageTypeNext.Visible = true;
            }

            SetControlStatus();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Update the configuration object from the form data.
        /// </summary>
        /// <param name="configuration"></param>
        private void UpdateConfigurationFromForm(Configuration configuration)
        {
            ManagerStorageTypeDropdownItem item = (ManagerStorageTypeDropdownItem)managerStorageTypes.SelectedItem;

            configuration.DbType     = item.StorageType;
            configuration.DbServer   = databaseServer.Text;
            configuration.DbName     = databaseName.Text;
            configuration.DbUsername = databaseUsername.Text;
            configuration.DbPassword = databasePassword.Text;
        }
Exemplo n.º 4
0
        private void storageTypeNext_Click(object sender, EventArgs e)
        {
            ManagerStorageTypeDropdownItem item = (ManagerStorageTypeDropdownItem)managerStorageTypes.SelectedItem;

            if (item.StorageType == ManagerStorageEnum.db4o)
            {
                MakeTabVisible(databaseFileLocationTab);
            }
            else
            {
                MakeTabVisible(databaseLocationTab);
            }
            SetControlStatus();
        }