当前位置: 首页>>代码示例>>C#>>正文


C# Section.GetSection方法代码示例

本文整理汇总了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));
                }
            }
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:43,代码来源:ViewLayout.cs

示例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));
                }
            }
开发者ID:Kuzq,项目名称:gitter,代码行数:13,代码来源:ViewLayout.cs

示例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));
                }
            }
开发者ID:Kuzq,项目名称:gitter,代码行数:17,代码来源:ViewLayout.cs

示例4: FloatEntry

            public FloatEntry(Section section)
            {
                Verify.Argument.IsNotNull(section, "section");

                _bounds = section.GetValue<Rectangle>("Bounds");
                _root = ToLayout(section.GetSection("Root"));
            }
开发者ID:Kuzq,项目名称:gitter,代码行数:7,代码来源:ViewLayout.cs


注:本文中的Section.GetSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。