本文整理汇总了C#中Section.GetSection方法的典型用法代码示例。如果您正苦于以下问题:C# Section.GetSection方法的具体用法?C# Section.GetSection怎么用?C# Section.GetSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section.GetSection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewLayout
/// <summary>
/// Initializes a new instance of the <see cref="ViewLayout"/> class.
/// </summary>
/// <param name="section">The section.</param>
public ViewLayout(Section section)
{
Verify.Argument.IsNotNull(section, "section");
_root = ToLayout(section.GetSection("Root"));
var sides = section.TryGetSection("Sides");
if(sides != null)
{
var left = sides.TryGetSection("Left");
if(left != null)
{
_left = new SideEntry(AnchorStyles.Left, left);
}
var top = sides.TryGetSection("Top");
if(top != null)
{
_top = new SideEntry(AnchorStyles.Top, top);
}
var right = sides.TryGetSection("Right");
if(right != null)
{
_right = new SideEntry(AnchorStyles.Right, right);
}
var bottom = sides.TryGetSection("Bottom");
if(bottom != null)
{
_bottom = new SideEntry(AnchorStyles.Bottom, bottom);
}
}
var floats = section.TryGetSection("Floats");
if(floats != null)
{
foreach(var f in floats.Sections)
{
_floats.Add(new FloatEntry(f));
}
}
}
示例2: 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));
}
}
示例3: SplitEntry
public SplitEntry(Section section)
: this()
{
Verify.Argument.IsNotNull(section, "section");
_orientation = section.GetValue<Orientation>("Orientation");
var splitters = section.GetSection("Splitters");
foreach(var s in splitters.Parameters)
{
_splitters.Add((double)s.Value);
}
var cells = section.GetSection("Cells");
foreach(var c in cells.Sections)
{
_cells.Add(ToLayout(c));
}
}
示例4: FloatEntry
public FloatEntry(Section section)
{
Verify.Argument.IsNotNull(section, "section");
_bounds = section.GetValue<Rectangle>("Bounds");
_root = ToLayout(section.GetSection("Root"));
}