本文整理汇总了C#中Section.GetCreateSection方法的典型用法代码示例。如果您正苦于以下问题:C# Section.GetCreateSection方法的具体用法?C# Section.GetCreateSection怎么用?C# Section.GetCreateSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section.GetCreateSection方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigurationService
internal ConfigurationService()
{
var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
_configPath = Path.Combine(appData, AppFolderName);
_configFileName = Path.Combine(_configPath, ConfigFileName);
if(!Directory.Exists(_configPath))
{
try
{
Directory.CreateDirectory(_configPath);
}
catch(Exception exc)
{
if(exc.IsCritical())
{
throw;
}
LoggingService.Global.Error(exc);
}
}
_configuration = LoadConfig(ConfigFileName, "Configuration");
_rootSection = _configuration.RootSection;
_guiSection = _rootSection.GetCreateSection("Gui");
_globalSection = _rootSection.GetCreateSection("Global");
_viewsSection = _rootSection.GetCreateSection("Tools");
_providersSection = _rootSection.GetCreateSection("Providers");
_repositoryManagerSection = _rootSection.GetCreateSection("RepositoryManager");
}
示例2: Search
//.........这里部分代码省略.........
start = (start - 1);
if(start < 0) start += count;
end = (start + 1) % count;
}
while(start != end)
{
var item = _lstReferences.Items[start];
var revItem = item as IRevisionPointerListItem;
if(revItem != null)
{
if(TestItem(revItem, search))
{
item.FocusAndSelect();
return true;
}
}
if(direction == 1)
{
start = (start + 1) % count;
}
else
{
--start;
if(start < 0) start = count - 1;
}
}
return false;
}
public bool SearchFirst(SearchOptions search)
{
Verify.Argument.IsNotNull(search, "search");
return Search(-1, search, 1);
}
public bool SearchNext(SearchOptions search)
{
Verify.Argument.IsNotNull(search, "search");
if(search.Text.Length == 0) return true;
if(_lstReferences.SelectedItems.Count == 0)
{
return Search(-1, search, 1);
}
var start = _lstReferences.Items.IndexOf(_lstReferences.SelectedItems[0]);
return Search(start, search, 1);
}
public bool SearchPrevious(SearchOptions search)
{
Verify.Argument.IsNotNull(search, "search");
if(search.Text.Length == 0) return true;
if(_lstReferences.SelectedItems.Count == 0) return Search(-1, search, 1);
var start = _lstReferences.Items.IndexOf(_lstReferences.SelectedItems[0]);
return Search(start, search, -1);
}
public bool SearchToolBarVisible
{
get { return _searchToolbar != null && _searchToolbar.Visible; }
set
{
if(value)
{
ShowSearchToolBar();
}
else
{
HideSearchToolBar();
}
}
}
private void ShowSearchToolBar()
{
if(_searchToolbar == null)
{
AddBottomToolStrip(_searchToolbar = new ReferencesSearchToolBar(this));
}
_searchToolbar.FocusSearchTextBox();
}
private void HideSearchToolBar()
{
if(_searchToolbar != null)
{
RemoveToolStrip(_searchToolbar);
_searchToolbar.Dispose();
_searchToolbar = null;
}
}
*/
protected override void SaveMoreViewTo(Section section)
{
base.SaveMoreViewTo(section);
var listNode = section.GetCreateSection("ReferenceList");
_lstReferences.SaveViewTo(listNode);
}
示例3: SaveRepositoryConfig
protected override void SaveRepositoryConfig(Section section)
{
if(Guid == Guids.ContextualDiffViewGuid)
{
var node = section.GetCreateSection("ContextualDiffOptions");
node.SetValue<int>("Context", _options.Context);
node.SetValue<bool>("IgnoreWhitespace", _options.IgnoreWhitespace);
node.SetValue<bool>("UsePatienceAlgorithm", _options.UsePatienceAlgorithm);
node.SetValue<string>("ViewMode", ViewMode.ToString());
}
base.SaveRepositoryConfig(section);
}
示例4: SaveTo
public static void SaveTo(Section section)
{
Verify.Argument.IsNotNull(section, "section");
var appearanceNode = section.GetCreateSection("Appearance");
if(GitterApplication.TextRenderer == GitterApplication.GdiTextRenderer)
{
appearanceNode.SetValue("TextRenderer", "GDI");
}
else if(GitterApplication.TextRenderer == GitterApplication.GdiPlusTextRenderer)
{
appearanceNode.SetValue("TextRenderer", "GDI+");
}
var servicesNode = section.GetCreateSection("Services");
var spellingNode = servicesNode.GetCreateSection("Spelling");
SpellingService.SaveTo(spellingNode);
var featuresSection = section.GetCreateSection("IntegrationFeatures");
GitterApplication.IntegrationFeatures.SaveTo(featuresSection);
}
示例5: SaveMoreViewTo
protected override void SaveMoreViewTo(Section section)
{
base.SaveMoreViewTo(section);
var layoutNode = section.GetCreateSection("Layout");
layoutNode.SetValue("ShowDetails", ShowDetails);
var listNode = section.GetCreateSection("RevisionList");
RevisionListBox.SaveViewTo(listNode);
}
示例6: SaveMoreViewTo
protected override void SaveMoreViewTo(Section section)
{
base.SaveMoreViewTo(section);
var listNode = section.GetCreateSection("RepositoryList");
_lstLocalRepositories.SaveViewTo(listNode);
var itemsNode = listNode.GetCreateEmptySection("Items");
int id = 0;
foreach(var item in _lstLocalRepositories.Items)
{
var repoItem = item as RepositoryListItem;
if(repoItem != null)
{
var link = repoItem.DataContext;
link.SaveTo(itemsNode.GetCreateSection("Repository" + id.ToString(CultureInfo.InvariantCulture)));
++id;
}
}
}
示例7: SaveRepositoryConfig
protected override void SaveRepositoryConfig(Section section)
{
base.SaveRepositoryConfig(section);
var logOptionsNode = section.GetCreateSection("LogOptions");
LogOptions.SaveTo(logOptionsNode);
}
示例8: SaveMoreViewTo
protected override void SaveMoreViewTo(Section section)
{
base.SaveMoreViewTo(section);
var listSection = section.GetCreateSection("ConfigParameterList");
_lstConfig.SaveViewTo(listSection);
}
示例9: SaveViewTo
public void SaveViewTo(Section section)
{
Verify.Argument.IsNotNull(section, "section");
var columnsSection = section.GetCreateSection("Columns");
columnsSection.Clear();
foreach(var column in Columns)
{
var columnSection = columnsSection.CreateSection(column.IdentificationString);
column.SaveTo(columnSection);
}
SaveMoreViewTo(section);
}
示例10: SaveMoreViewTo
protected override void SaveMoreViewTo(Section section)
{
base.SaveMoreViewTo(section);
section.SetValue<bool>("TreeMode", _treeMode);
var stagedListSection = section.GetCreateSection("StagedList");
_lstStaged.SaveViewTo(stagedListSection);
var unstagedListSection = section.GetCreateSection("UnstagedList");
_lstUnstaged.SaveViewTo(unstagedListSection);
}
示例11: SaveTo
/// <summary>Save configuration to <paramref name="section"/>.</summary>
/// <param name="section"><see cref="Section"/> for storing configuration.</param>
public void SaveTo(Section section)
{
Verify.Argument.IsNotNull(section, "section");
if(ActiveGitAccessorProvider != null)
{
section.SetValue<string>("AccessorProvider", ActiveGitAccessorProvider.Name);
if(GitAccessor != null)
{
var gitAccessorSection = section.GetCreateSection(ActiveGitAccessorProvider.Name);
GitAccessor.SaveTo(gitAccessorSection);
}
}
_configSection = section;
}
示例12: SaveMoreViewTo
protected override void SaveMoreViewTo(Section section)
{
base.SaveMoreViewTo(section);
var listNode = section.GetCreateSection("SubmodulesList");
_lstSubmodules.SaveViewTo(listNode);
}