Esempio n. 1
0
        void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e)
        {
            switch (e.PropertyCode)
            {
            case SashModel.PARENT_PROPERTY_CODE:
                Bounds = SurfaceParent().Model.Bounds;
                break;

            case SashModel.SASH_TYPE_PROPERTY_CODE:
                Repaint();
                break;

            case SashModel.CHILD_PROPERTY_CODE:
                RemoveAllChildren();
                Surface              = Model.SurfaceChild;
                Surface.Frame        = SurfaceParent().Frame;
                Surface.Model.Bounds = InnerBounds;
                AddChild(Surface);
                break;

            case SashModel.CODE_PROPERTY_CODE:
                Repaint();
                break;
            }
            Surface.ParentBoundsChanged();
        }
Esempio n. 2
0
        public static void RemoveShiftLeftMullion(Mullion mullion)
        {
            if (mullion == null || mullion.PreviousSurface() == null)
            {
                throw new ArgumentException("Invalid argument provided.");
            }

            if (mullion.Parent.ChildrenCount == 3)
            {
                mullion.Parent.RemoveAllChildren();
                return;
            }
            Surface previousSurface = mullion.PreviousSurface();
            Surface nextSurface     = mullion.NextSurface();

            float x      = nextSurface.Model.X;
            float y      = nextSurface.Model.Y;
            float width  = nextSurface.Model.Width;
            float height = nextSurface.Model.Height;

            if (mullion.Model.Orientation == Domain.Entities.Orientation.Vertical)
            {
                x = previousSurface.Model.X;
            }
            else if (mullion.Model.Orientation == Domain.Entities.Orientation.Horizontal)
            {
                y = previousSurface.Model.Y;
            }
            PNodeList nodeList = new PNodeList();

            nodeList.Add(mullion);
            nodeList.Add(previousSurface);
            mullion.Parent.RemoveChildren(nodeList);

            nextSurface.Model.Bounds = new System.Drawing.RectangleF(x, y, width, height);
            nextSurface.ParentBoundsChanged();
            Mullion nextMullion = nextSurface.NextMullion();
            Mullion prevMullion = nextSurface.PreviousMullion();

            if (nextMullion != null)
            {
                nextMullion.ParentBoundsChanged();
            }
            else if (prevMullion != null)
            {
                prevMullion.ParentBoundsChanged();
            }
        }