コード例 #1
0
 private void LoadDomainConfig(DomainConfig config)
 {
     mapPath          = config.MapPath;
     connectionString = config.ConnectionString;
     domain           = System.Reflection.Assembly.LoadFrom(config.AssemblyPath);
     FillTreeSchema();
 }
コード例 #2
0
 public void SetConfig(DomainConfig value)
 {
     this.config = value;
     textName.Text = this.config.Name;
     textMapPath.Text = this.config.MapPath;
     textAssemblyPath.Text = this.config.AssemblyPath;
     textConnectionString.Text = this.config.ConnectionString;
     LoadDomainConfigList();
 }
コード例 #3
0
 public void SetConfig(DomainConfig value)
 {
     this.config               = value;
     textName.Text             = this.config.Name;
     textMapPath.Text          = this.config.MapPath;
     textAssemblyPath.Text     = this.config.AssemblyPath;
     textConnectionString.Text = this.config.ConnectionString;
     LoadDomainConfigList();
 }
コード例 #4
0
        private void SelectDomainConfig()
        {
            if (comboDomainConfigs.SelectedItem == null)
            {
                return;
            }
            DomainConfig domainConfig = (DomainConfig)comboDomainConfigs.SelectedItem;

            textName.Text             = domainConfig.Name;
            textMapPath.Text          = domainConfig.MapPath;
            textAssemblyPath.Text     = domainConfig.AssemblyPath;
            textConnectionString.Text = domainConfig.ConnectionString;
        }
コード例 #5
0
 public void SetConfig(DomainConfig value)
 {
     this.config = value;
     textName.Text = this.config.Name;
     textMapPath.Text = this.config.MapPath;
     textAssemblyPath.Text = this.config.AssemblyPath;
     useObjectToStringCheckBox.Checked = this.config.UseObjectToString;
     textConnectionString.Text = this.config.ConnectionString;
     textUrl.Text = this.config.Url;
     domainKeyTextBox.Text = this.config.DomainKey;
     objectRelationalRadioButton.Checked = (this.config.PersistenceType == PersistenceType.ObjectRelational);
     objectServiceRadioButton.Checked = (this.config.PersistenceType == PersistenceType.ObjectService);
     objectDocumentRadioButton.Checked = (this.config.PersistenceType == PersistenceType.ObjectDocument);
     LoadDomainConfigList();
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: BackupTheBerlios/puzzle-svn
 private void LoadDomainConfig(DomainConfig config)
 {
     mapPath = config.MapPath;
     connectionString = config.ConnectionString;
     domain = System.Reflection.Assembly.LoadFrom(config.AssemblyPath);
     FillTreeSchema();
 }
コード例 #7
0
        private void LoadDomainConfig(DomainConfig config)
        {
            ClearAll();
            if (config == null)
                return;

            this.domainConfig = config;

            Connect();
            FillClassesTree();
            RefreshAll();
        }
コード例 #8
0
        private void GetSourceAndProviderType(DomainConfig config)
        {
            if (sourceTypeComboBox.SelectedIndex == 0)
                config.SourceType = SourceType.MSSqlServer ;
            else
                config.SourceType = SourceType.MSAccess ;

            if (providerTypeComboBox.SelectedIndex == 0)
                config.ProviderType = ProviderType.SqlClient ;
            else if (providerTypeComboBox.SelectedIndex == 1)
                config.ProviderType = ProviderType.OleDb ;
            else
                config.ProviderType = ProviderType.Odbc ;
        }
コード例 #9
0
        private void SaveDomainConfig()
        {
            DomainConfig config = new DomainConfig() ;
            string find = domainConfigNameTextBox.Text.ToLower();
            foreach (DomainConfig domainConfig in MainForm.domainConfigList.DomainConfigs)
            {
                if (domainConfig.Name.ToLower() == find)
                {
                    MainForm.domainConfigList.DomainConfigs.Remove(domainConfig);
                    break;
                }
            }
            config.Name = domainConfigNameTextBox.Text;

            if (localMapfileRadioButton.Checked)
            {
                config.MapPath = mapPathTextBox.Text ;

                if (useCustomSourceRadioButton.Checked)
                {
                    config.UseCustomDataSource = true ;
                    if (useWebServiceRadioButton.Checked)
                    {
                        config.PersistenceType = PersistenceType.ObjectService ;
                        config.Url = webServiceDataSourceUrlTextBox.Text ;
                        config.DomainKey = webServiceDataSourceDomainKeyTextBox.Text ;
                    }
                    else if (useXmlDocumentRadioButton.Checked)
                    {
                        config.PersistenceType = PersistenceType.ObjectDocument ;
                        config.XmlPath = xmlDocumentDataSourcePathTextBox.Text ;
                    }
                    else
                    {
                        config.PersistenceType = PersistenceType.ObjectRelational ;
                        GetSourceAndProviderType(config);
                        config.ConnectionString = connectionStringTextBox.Text ;
                    }
                }
            }
            else if (webServiceMapFileRadioButton.Checked)
            {
                config.Url = webServiceUrlTextBox.Text;
                config.DomainKey = webServiceDomainKeyTextBox.Text;
            }
            else if (wrapDbOnTheFlyRadioButton.Checked)
            {
                GetSourceAndProviderType(config);
                config.ConnectionString = connectionStringTextBox.Text ;
            }

            if (!wrapDbOnTheFlyRadioButton.Checked)
            {
                if (!generateAssemblyRadioButton.Checked)
                {
                    config.AssemblyPath = assemblyPathTextBox.Text ;
                }
            }

            MainForm.domainConfigList.DomainConfigs.Insert(0, config);
            MainForm.domainConfigList.Save(MainForm.domainConfigListPath);
        }