当前位置: 首页>>代码示例>>C#>>正文


C# ConfigFile.Clear方法代码示例

本文整理汇总了C#中ConfigFile.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigFile.Clear方法的具体用法?C# ConfigFile.Clear怎么用?C# ConfigFile.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigFile的用法示例。


在下文中一共展示了ConfigFile.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateSolutionWizardConfiguration

        /// <summary>
        /// Creates a ConfigFile with all the settings that will be needed for parsing the
        /// variables in the files that will be written out by the solution wizard.
        /// </summary>
        /// <returns></returns>
        private ConfigFile CreateSolutionWizardConfiguration()
        {
            ConfigFile config = new ConfigFile();

            config.Clear();

            try
            {
                config["sysinfo.currentuser"] = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            }
            catch { }
            config["sysinfo.currentdate"] = DateTime.Now.ToLongDateString();

            config["android.apptitle"] = "Android/VS v" + AndroMDA.VS80AddIn.VS80AddIn.ADD_IN_VERSION;
            config["android.version"] = AndroMDA.VS80AddIn.VS80AddIn.ADD_IN_VERSION;

            config["solution.name"] = VSSolutionUtils.GetSolutionName(m_applicationObject.Solution);
            config["solution.path"] = VSSolutionUtils.GetSolutionPath(m_applicationObject.Solution);

            config["application.name"] = txtApplicationName.Text;
            config["application.name.nospaces"] = txtApplicationName.Text.Replace(" ", string.Empty);
            config["application.version"] = "1.0";
            config["application.versioncontrol"] = ddlVersionControl.SelectedItem.ToString();

            config["application.andromda.bootstrap"] = ddlAndroMDABootstrap.SelectedItem.ToString();
            config["application.andromda.version"] = txtAndroMDAVersion.Text;

            config["application.dotnetcartridges.version"] = txtDotNetCartridgesVersion.Text;

            config["application.model.filename.unzipped"] = config["application.name.nospaces"] + ".Model.xmi";
            if (cbUseZippedModel.Checked)
            {
                config["application.model.filename"] = config["application.name.nospaces"] + ".Model.xmi.zip";
                config["application.model.uri"] = config["application.name.nospaces"] + ".Model.xmi.zip!" + config["application.name.nospaces"] + ".Model.xmi";
            }
            else
            {
                config["application.model.filename"] = config["application.name.nospaces"] + ".Model.xmi";
                config["application.model.uri"] = config["application.name.nospaces"] + ".Model.xmi";
            }
            config["application.model.zipped"] = BoolToString(cbUseZippedModel.Checked);

            config["projects.common.name"] = usrCommonProject.ProjectName;
            config["projects.common.dir"] = usrCommonProject.ProjectName;
            config["projects.common.create"] = BoolToString(usrCommonProject.CreateNewProject);

            config["projects.core.name"] = usrCoreProject.ProjectName;
            config["projects.core.dir"] = usrCoreProject.ProjectName;
            config["projects.core.create"] = BoolToString(usrCoreProject.CreateNewProject);

            config["projects.schemaexport.name"] = txtSchemaExportProject.Text;
            config["projects.schemaexport.dir"] = txtSchemaExportProject.Text;
            config["projects.schemaexport.create"] = BoolToString(cbCreateSchemaExport.Checked);

            config["projects.tests.configure"] = BoolToString(cbConfigureUnitTestingProject.Checked);
            config["projects.tests.name"] = usrTestProject.ProjectName;
            config["projects.tests.dir"] = usrTestProject.ProjectName;
            config["projects.tests.create"] = BoolToString(usrTestProject.CreateNewProject);
            config["projects.tests.scenariounit"] = BoolToString(cbScenarioUnitSupport.Checked);

            config["projects.web.configure"] = BoolToString(cbConfigureWebProject.Checked);
            string webname = usrWebProject.ProjectName.Trim('\\');
            if (!usrWebProject.CreateNewProject)
            {
                webname = webname.Substring(webname.LastIndexOf('\\') + 1);
            }
            config["projects.web.name"] = webname;
            config["projects.web.dir"] = usrWebProject.ProjectName;
            config["projects.web.create"] = BoolToString(usrWebProject.CreateNewProject);
            config["projects.web.usenhibernateconfig"] = BoolToString(cbUseNHibernateConfig.Checked);
            config["projects.web.addmembership"] = BoolToString(cbAddMembershipSupport.Checked);
            config["cartridges.aspnet.configure"] = BoolToString(cbConfigureASPNETCartridge.Checked);

            config["projects.web.common.configure"] = BoolToString(cbConfigureWebCommonProject.Checked);
            config["projects.web.common.name"] = usrWebCommonProject.ProjectName;
            config["projects.web.common.dir"] = usrWebCommonProject.ProjectName;
            config["projects.web.common.create"] = BoolToString(usrWebCommonProject.CreateNewProject);

            config["database.name"] = txtApplicationName.Text.Replace(" ", string.Empty).Replace(".", string.Empty);

            config["solution.path"] = VSSolutionUtils.GetSolutionPath(m_applicationObject.Solution);

            // TODO: Support all database types that NHibernate supports
            switch (ddlDatabaseType.SelectedItem.ToString())
            {
                case "Microsoft SQL Server 2005":
                    config["database.mappingtype"] = "MSSQL";
                    config["database.hibernatedialect"] = "net.sf.hibernate.dialect.SQLServerDialect";
                    config["database.nhibernatedialect"] = "NHibernate.Dialect.MsSql2005Dialect";
                    config["hibernate.connection.driver_class"] = "NHibernate.Driver.SqlClientDriver";
                    break;
                case "Microsoft SQL Server 2000":
                    config["database.mappingtype"] = "MSSQL";
                    config["database.hibernatedialect"] = "net.sf.hibernate.dialect.SQLServerDialect";
                    config["database.nhibernatedialect"] = "NHibernate.Dialect.MsSql2000Dialect";
//.........这里部分代码省略.........
开发者ID:siwiwit,项目名称:andromda,代码行数:101,代码来源:MDASolutionWizard.cs


注:本文中的ConfigFile.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。