本文整理汇总了C#中ISettings.SaveSetting方法的典型用法代码示例。如果您正苦于以下问题:C# ISettings.SaveSetting方法的具体用法?C# ISettings.SaveSetting怎么用?C# ISettings.SaveSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettings
的用法示例。
在下文中一共展示了ISettings.SaveSetting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveEntriesToSettings
private void SaveEntriesToSettings( ISettings settings )
{
string prefix = "Gui.RecentProjects";
while( fileEntries.Count > MaxFiles )
fileEntries.RemoveAt( fileEntries.Count - 1 );
for( int index = 0; index < MaxSize; index++ )
{
string keyName = GetRecentFileKey( prefix, index + 1 );
if ( index < fileEntries.Count )
settings.SaveSetting( keyName, fileEntries[index].Path );
else
settings.RemoveSetting( keyName );
}
// Remove legacy entries here
settings.RemoveGroup("RecentProjects");
}
示例2: SaveEntriesToSettings
private void SaveEntriesToSettings( ISettings settings )
{
string prefix = Environment.Version.Major >= 2
? "RecentProjects.V2"
: "RecentProjects.V1";
while( fileEntries.Count > MaxFiles )
fileEntries.RemoveAt( fileEntries.Count - 1 );
for( int index = 0; index < MaxSize; index++ )
{
string keyName = GetRecentFileKey( prefix, index + 1 );
if ( index < fileEntries.Count )
settings.SaveSetting( keyName, fileEntries[index].Path );
else
settings.RemoveSetting( keyName );
}
}