本文整理汇总了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";
//.........这里部分代码省略.........