本文整理汇总了C#中Section.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Section.GetValue方法的具体用法?C# Section.GetValue怎么用?C# Section.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RepositoryLink
public RepositoryLink(Section section)
{
Verify.Argument.IsNotNull(section, "section");
_path = section.GetValue("Path", string.Empty);
_type = section.GetValue("Type", string.Empty);
_description = section.GetValue("Description", string.Empty);
}
示例2: SelectableFont
public SelectableFont(string id, string name, Section section)
{
Verify.Argument.IsNeitherNullNorWhitespace(name, "name");
Verify.Argument.IsNotNull(section, "section");
var fontName = section.GetValue<string>("Name", null);
var size = section.GetValue<float>("Size", 0);
var style = section.GetValue<FontStyle>("Style", FontStyle.Regular);
Verify.Argument.IsTrue(fontName != null, "section", "Section does not contain a valid font name.");
Verify.Argument.IsTrue(size > 0, "section", "Section contains invalid font size.");
_font = new Font(fontName, size, style, GraphicsUnit.Point);
_id = id;
_name = name;
}
示例3: TryLoadGroupFrom
private static RepositoryGroup TryLoadGroupFrom(Section section)
{
Assert.IsNotNull(section);
var name = section.GetValue<string>("Name", string.Empty);
if(string.IsNullOrWhiteSpace(name))
{
return null;
}
var group = new RepositoryGroup(name.Trim());
LoadGroupContent(group, section);
return group;
}
示例4: LoadFrom
public void LoadFrom(Section section)
{
Verify.Argument.IsNotNull(section, "section");
var name = section.GetValue<string>("Name", null);
var size = section.GetValue<float>("Size", 0);
var style = section.GetValue<FontStyle>("Name", FontStyle.Regular);
Assert.IsNeitherNullNorWhitespace(name);
Assert.BoundedDoubleInc(0, size, 100);
if(_font.Name != name || _font.Size != size || _font.Style != style)
{
Font font = null;
try
{
font = new Font(name, size, style, GraphicsUnit.Point);
}
catch(Exception exc)
{
if(exc.IsCritical())
{
throw;
}
}
if(font != null)
{
_font = font;
}
Changed.Raise(this);
}
}
示例5: LoadMoreFrom
protected override void LoadMoreFrom(Section section)
{
base.LoadMoreFrom(section);
AlignToGraph = section.GetValue("AlignToGraph", AlignToGraph);
ShowLocalBranches = section.GetValue("ShowLocalBranches", ShowLocalBranches);
ShowRemoteBranches = section.GetValue("ShowRemoteBranches", ShowRemoteBranches);
ShowTags = section.GetValue("ShowTags", ShowTags);
ShowStash = section.GetValue("ShowStash", ShowStash);
}
示例6: LoadMoreFrom
protected override void LoadMoreFrom(Section section)
{
base.LoadMoreFrom(section);
Abbreviate = section.GetValue("Abbreviate", Abbreviate);
}
示例7: ViewEntry
public ViewEntry(Section section)
{
Verify.Argument.IsNotNull(section, "section");
_guid = section.GetValue<Guid>("Guid");
}
示例8: LoadFrom
public void LoadFrom(Section section)
{
Verify.Argument.IsNotNull(section, "section");
IsVisible = section.GetValue("Visible", _isVisible);
if(_sizeMode != ColumnSizeMode.Fill)
{
Width = section.GetValue("Width", _width);
}
LoadMoreFrom(section);
}
示例9: HostEntry
public HostEntry(Section section)
: this()
{
Verify.Argument.IsNotNull(section, "section");
_isRoot = section.GetValue<bool>("IsRoot");
_isDocumentWell = section.GetValue<bool>("IsDocumentHost");
var tools = section.GetSection("Views");
foreach(var t in tools.Sections)
{
_views.Add(new ViewEntry(t));
}
}
示例10: FloatEntry
public FloatEntry(Section section)
{
Verify.Argument.IsNotNull(section, "section");
_bounds = section.GetValue<Rectangle>("Bounds");
_root = ToLayout(section.GetSection("Root"));
}
示例11: ToLayout
private static ILayoutBase ToLayout(Section section)
{
Verify.Argument.IsNotNull(section, "section");
switch(section.GetValue<string>("Type"))
{
case "Split":
return new SplitEntry(section);
case "Host":
return new HostEntry(section);
default:
throw new ArgumentException("section");
}
}
示例12: LoadMoreFrom
protected override void LoadMoreFrom(Section section)
{
base.LoadMoreFrom(section);
DateFormat = section.GetValue("DateFormat", DateFormat);
}
示例13: LoadMoreFrom
protected override void LoadMoreFrom(Section section)
{
base.LoadMoreFrom(section);
ShowColors = section.GetValue("ShowColors", ShowColors);
}
示例14: LoadMoreViewFrom
protected override void LoadMoreViewFrom(Section section)
{
base.LoadMoreViewFrom(section);
_toolbar.TreeModeButton.Checked = _treeMode = section.GetValue<bool>("TreeMode", true);
var stagedListSection = section.TryGetSection("StagedList");
if(stagedListSection != null)
{
_lstStaged.LoadViewFrom(stagedListSection);
}
var unstagedListSection = section.TryGetSection("UnstagedList");
if(unstagedListSection != null)
{
_lstUnstaged.LoadViewFrom(unstagedListSection);
}
}
示例15: LoadFor
public bool LoadFor(IWorkingEnvironment environment, Section section)
{
Verify.Argument.IsNotNull(environment, "environment");
if(section != null)
{
var providerName = section.GetValue<string>("AccessorProvider", string.Empty);
if(!string.IsNullOrWhiteSpace(providerName))
{
ActiveGitAccessorProvider = GitAccessorProviders.FirstOrDefault(
prov => prov.Name == providerName);
}
if(ActiveGitAccessorProvider == null)
{
ActiveGitAccessorProvider = GitAccessorProviders.First();
}
var gitAccessorSection = section.TryGetSection(ActiveGitAccessorProvider.Name);
if(gitAccessorSection != null)
{
GitAccessor.LoadFrom(gitAccessorSection);
}
}
else
{
ActiveGitAccessorProvider = GitAccessorProviders.First();
}
Version gitVersion;
try
{
gitVersion = _gitAccessor.GitVersion;
}
catch(Exception exc)
{
if(exc.IsCritical())
{
throw;
}
gitVersion = null;
}
if(gitVersion == null || gitVersion < MinimumRequiredGitVersion)
{
using(var dlg = new VersionCheckDialog(environment, this, MinimumRequiredGitVersion, gitVersion))
{
dlg.Run(environment.MainForm);
gitVersion = dlg.InstalledVersion;
if(gitVersion == null || gitVersion < _minVersion)
{
return false;
}
}
}
GlobalOptions.RegisterPropertyPageFactory(
new PropertyPageFactory(
GitOptionsPage.Guid,
Resources.StrGit,
null,
PropertyPageFactory.RootGroupGuid,
env => new GitOptionsPage(env)));
GlobalOptions.RegisterPropertyPageFactory(
new PropertyPageFactory(
ConfigurationPage.Guid,
Resources.StrConfig,
null,
GitOptionsPage.Guid,
env => new ConfigurationPage(env)));
_environment = environment;
_configSection = section;
return true;
}