本文整理汇总了C#中ISettings.AddValue方法的典型用法代码示例。如果您正苦于以下问题:C# ISettings.AddValue方法的具体用法?C# ISettings.AddValue怎么用?C# ISettings.AddValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettings
的用法示例。
在下文中一共展示了ISettings.AddValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public static void Initialize(IMainForm mainForm)
{
Settings.mainForm = mainForm;
Settings.settings = mainForm.MainSettings;
string excludedDirs = string.Join(",",ProjectTreeView.ExcludedDirectories);
string excludedFileTypes = string.Join(",",ProjectTreeView.ExcludedFileTypes);
// create keys if necessary with default values
if (!settings.HasKey(SETTING_RECENTPROJECTS))
settings.AddValue(SETTING_RECENTPROJECTS, "");
if (!settings.HasKey(SETTING_MAXRECENTPROJECTS))
settings.AddValue(SETTING_MAXRECENTPROJECTS,"7");
if (!settings.HasKey(SETTING_LASTOPENPROJECT))
settings.AddValue(SETTING_LASTOPENPROJECT, "");
if (!settings.HasKey(SETTING_EXCLUDEDDIRECTORIES))
settings.AddValue(SETTING_EXCLUDEDDIRECTORIES, excludedDirs);
if (!settings.HasKey(SETTING_EXCLUDEDFILETYPES))
settings.AddValue(SETTING_EXCLUDEDFILETYPES, excludedFileTypes);
if (!settings.HasKey(SETTING_CREATEPROJECTDIR))
settings.AddValue(SETTING_CREATEPROJECTDIR,"true");
if (!settings.HasKey(SETTING_NEWPROJECTDEFAULTDIR))
settings.AddValue(SETTING_NEWPROJECTDEFAULTDIR,PathHelper.ProjectsDirectory);
if (!settings.HasKey(SETTING_SHOWPROJECTCLASSPATHS))
settings.AddValue(SETTING_SHOWPROJECTCLASSPATHS,"true");
if (!settings.HasKey(SETTING_SHOWGLOBALCLASSPATHS))
settings.AddValue(SETTING_SHOWGLOBALCLASSPATHS,"false");
if (!settings.HasKey(SETTING_RESTORETREESTATE))
settings.AddValue(SETTING_RESTORETREESTATE,"true");
excludedDirs = settings.GetValue(SETTING_EXCLUDEDDIRECTORIES);
excludedFileTypes = settings.GetValue(SETTING_EXCLUDEDFILETYPES);
ProjectTreeView.ExcludedDirectories = excludedDirs.Split(',');
ProjectTreeView.ExcludedFileTypes = excludedFileTypes.Split(',');
}