Exemple #1
0
            public FloatEntry(Section section)
            {
                Verify.Argument.IsNotNull(section, nameof(section));

                _bounds = section.GetValue <Rectangle>("Bounds");
                _root   = ToLayout(section.GetSection("Root"));
            }
Exemple #2
0
        /// <summary>Capture current tool layout of specified <paramref name="viewDockService"/>.</summary>
        /// <param name="viewDockService">The tool dock service.</param>
        /// <exception cref="ArgumentNullException"><paramref name="viewDockService"/> == <c>null</c>.</exception>
        public ViewLayout(ViewDockService viewDockService)
        {
            Verify.Argument.IsNotNull(viewDockService, nameof(viewDockService));

            var grid = viewDockService.Grid;

            _root = ToLayout(grid.RootControl);

            if (grid.LeftSide != null)
            {
                _left = new SideEntry(grid.LeftSide);
            }
            if (grid.TopSide != null)
            {
                _top = new SideEntry(grid.TopSide);
            }
            if (grid.RightSide != null)
            {
                _right = new SideEntry(grid.RightSide);
            }
            if (grid.BottomSide != null)
            {
                _bottom = new SideEntry(grid.BottomSide);
            }
            _floats = new List <FloatEntry>();
            foreach (var floatingViewForm in grid.FloatingViewForms)
            {
                _floats.Add(new FloatEntry(floatingViewForm));
            }
        }
Exemple #3
0
            public FloatEntry(FloatingViewForm floatingForm)
            {
                Verify.Argument.IsNotNull(floatingForm, nameof(floatingForm));

                _bounds = floatingForm.Bounds;
                _root   = ToLayout(floatingForm.RootControl);
            }
Exemple #4
0
        /// <summary>Capture current tool layout of specified <paramref name="viewDockService"/>.</summary>
        /// <param name="viewDockService">The tool dock service.</param>
        /// <exception cref="ArgumentNullException"><paramref name="viewDockService"/> == <c>null</c>.</exception>
        public ViewLayout(ViewDockService viewDockService)
        {
            Verify.Argument.IsNotNull(viewDockService, "viewDockService");

            var grid = viewDockService.Grid;

            _root = ToLayout(grid.RootControl);

            if(grid.LeftSide != null)
            {
                _left = new SideEntry(grid.LeftSide);
            }
            if(grid.TopSide != null)
            {
                _top = new SideEntry(grid.TopSide);
            }
            if(grid.RightSide != null)
            {
                _right = new SideEntry(grid.RightSide);
            }
            if(grid.BottomSide != null)
            {
                _bottom = new SideEntry(grid.BottomSide);
            }
            _floats = new List<FloatEntry>();
            foreach(var floatingViewForm in grid.FloatingViewForms)
            {
                _floats.Add(new FloatEntry(floatingViewForm));
            }
        }
Exemple #5
0
        /// <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, nameof(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));
                }
            }
        }
Exemple #6
0
        /// <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));
                }
            }
        }
Exemple #7
0
            public FloatEntry(Section section)
            {
                Verify.Argument.IsNotNull(section, "section");

                _bounds = section.GetValue<Rectangle>("Bounds");
                _root = ToLayout(section.GetSection("Root"));
            }
Exemple #8
0
            public FloatEntry(FloatingViewForm floatingForm)
            {
                Verify.Argument.IsNotNull(floatingForm, "floatingForm");

                _bounds = floatingForm.Bounds;
                _root = ToLayout(floatingForm.RootControl);
            }