Example #1
0
 protected override void ModifyValue(PropertyReference propertyReference, object valueToSet, SceneNode.Modification modification, int index)
 {
     LayoutUtilities.DetectLayoutOverrides((SceneElement)this, propertyReference);
     if (this is ITextFlowSceneNode)
     {
         this.ClearPropertyOnTextRuns(propertyReference);
     }
     base.ModifyValue(propertyReference, valueToSet, modification, index);
 }
Example #2
0
 public LayoutOperation(ILayoutDesigner designer, BaseFrameworkElement child)
 {
     this.Designer             = designer;
     this.Child                = child;
     this.Settings             = new LayoutSettings();
     this.SettingsFromElement  = LayoutUtilities.GetLayoutSettingsFromElement((SceneElement)child);
     this.ExplicitOverrides    = LayoutUtilities.GetLayoutOverrides((SceneElement)child);
     this.WidthConstraintMode  = designer.GetWidthConstraintMode(child);
     this.HeightConstraintMode = designer.GetHeightConstraintMode(child);
 }
Example #3
0
        public override void FillChild(BaseFrameworkElement element)
        {
            GridElement grid = element.Parent as GridElement;

            if (grid == null)
            {
                throw new ArgumentException(ExceptionStringTable.LayoutBehaviorElementNotInGrid);
            }
            Rect gridRectFromGridBox = LayoutUtilities.GetComputedGridRectFromGridBox(LayoutUtilities.GetComputedGridBoxContainingRect(this.GetChildRect(element), grid), grid);

            this.SetChildRect(element, this.PrepareLayoutRect(gridRectFromGridBox), LayoutOverrides.None, LayoutOverrides.All, LayoutOverrides.All);
        }
Example #4
0
        private static IDiagram ThenImplementation(
            IDiagram input,
            IDiagram next,
            HorizontalAlignment?horizontalAlignment,
            VerticalAlignment?verticalAlignment,
            bool evaluateOffset)
        {
            var alignmentVector = LayoutUtilities.ComputeAlignment(next, input, verticalAlignment, horizontalAlignment);
            var offsetDiagram   = evaluateOffset ? next.Offset(alignmentVector) : next.WithOffset(alignmentVector);

            return(input.Then(offsetDiagram));
        }
Example #5
0
 public virtual void SetChildRect(BaseFrameworkElement child, Rect rect, LayoutOverrides layoutOverrides, LayoutOverrides overridesToIgnore, LayoutOverrides nonExplicitOverrides, SetRectMode setRectMode)
 {
     overridesToIgnore = this.AdjustOverrideToIgnore(child, overridesToIgnore);
     if (this.suppressLayoutRoundingCount == 0 && (LayoutRoundingHelper.GetLayoutRoundingStatus((SceneElement)child) & LayoutRoundingStatus.ShouldSnapToPixel) != LayoutRoundingStatus.Off)
     {
         rect = LayoutRoundingHelper.RoundRect(child.Platform.GeometryHelper, rect);
     }
     using (child.ViewModel.ScopeViewObjectCache())
     {
         using (GridLayoutDesigner.TryCanvasDesignMode(child, rect.Size, true, true))
         {
             LayoutUtilities.EnterLayoutMode();
             LayoutOperation layoutOperation = this.CreateLayoutOperation(child);
             if (layoutOverrides == LayoutOverrides.RecomputeDefault)
             {
                 layoutOverrides = this.InternalComputeOverrides(child, layoutOperation);
             }
             layoutOperation.SetRect(rect, layoutOverrides, overridesToIgnore, nonExplicitOverrides, setRectMode);
             LayoutUtilities.ExitLayoutMode();
         }
     }
 }
Example #6
0
        public void SetRect(Rect rect, LayoutOverrides layoutOverrides, LayoutOverrides overridesToIgnore, LayoutOverrides nonExplicitOverrides, SetRectMode setRectMode)
        {
            if (this.Child.Visual == null)
            {
                return;
            }
            this.LayoutOverrides      = layoutOverrides;
            this.OverridesToIgnore    = overridesToIgnore;
            this.NonExplicitOverrides = nonExplicitOverrides;
            this.SetRectMode          = setRectMode;
            LayoutOverrides explicitOverrides = this.ExplicitOverrides;

            if (this.RoundBeforeSettingChildRect)
            {
                double num1 = (this.LayoutOverrides & LayoutOverrides.Width) == LayoutOverrides.None || (this.OverridesToIgnore & LayoutOverrides.Width) != LayoutOverrides.None ? 0.0 : 0.00045;
                double num2 = (this.LayoutOverrides & LayoutOverrides.Height) == LayoutOverrides.None || (this.OverridesToIgnore & LayoutOverrides.Height) != LayoutOverrides.None ? 0.0 : 0.00045;
                double x    = RoundingHelper.RoundLength(rect.Left - num1);
                double y    = RoundingHelper.RoundLength(rect.Top - num2);
                double num3 = RoundingHelper.RoundLength(rect.Right + num1);
                double num4 = RoundingHelper.RoundLength(rect.Bottom + num2);
                rect = new Rect(x, y, RoundingHelper.RoundLength(num3 - x), RoundingHelper.RoundLength(num4 - y));
            }
            this.ChildRect = rect;
            this.ComputeIdealSlotRect();
            this.SetSlotRectChanges();
            this.UpdateChildRectWithinSlot();
            this.ComputeIdealAlignment();
            this.SetAlignmentChanges();
            this.ComputeIdealSize();
            this.SetSizeChanges();
            this.ComputeIdealMargin();
            this.SetMarginChanges();
            this.ExplicitOverrides &= ~this.NonExplicitOverrides;
            if (this.ExplicitOverrides == explicitOverrides)
            {
                return;
            }
            LayoutUtilities.SetLayoutOverrides((SceneElement)this.Child, this.ExplicitOverrides);
        }
Example #7
0
        internal virtual void x46ff430ed3944e0f(xedb4922162c60d3d.DockTarget x11d58b056c032b03)
        {
            IComponentChangeService service1 = (IComponentChangeService)this.GetService(typeof(IComponentChangeService));
            bool flag;

            if ((uint)flag - (uint)flag > uint.MaxValue)
            {
                goto label_36;
            }
            else
            {
                goto label_37;
            }
label_1:
            bool x49cf4e0157d9436c;

            if ((uint)x49cf4e0157d9436c + (uint)x49cf4e0157d9436c > uint.MaxValue || x11d58b056c032b03.type == xedb4922162c60d3d.DockTargetType.AlreadyActioned)
            {
                return;
            }
            IDesignerHost       service2;
            DesignerTransaction transaction = service2.CreateTransaction("Move DockControl");
            ControlLayoutSystem xf333586e50dccad2;
            DockControl         selectedControl;
            ISelectionService   service3;

            try
            {
                if (this.x0467b00af7810f0c.Manager != null)
                {
                    goto label_32;
                }
label_31:
                Control control1 = (Control)null;
                goto label_33;
label_32:
                control1 = this.x0467b00af7810f0c.Manager.DockSystemContainer;
label_33:
                Control control2 = control1;
label_28:
                if ((uint)x49cf4e0157d9436c + (uint)x49cf4e0157d9436c > uint.MaxValue)
                {
                    goto label_5;
                }
                else
                {
                    goto label_29;
                }
label_4:
                service1.OnComponentChanged((object)control2, (MemberDescriptor)TypeDescriptor.GetProperties((object)control2)["Controls"], (object)null, (object)null);
label_5:
                transaction.Commit();
                if (((x49cf4e0157d9436c ? 1 : 0) | int.MaxValue) != 0)
                {
                    if (true)
                    {
                        return;
                    }
                    goto label_31;
                }
                else
                {
                    goto label_14;
                }
label_10:
                if (x11d58b056c032b03.dockContainer == null)
                {
                    if (x11d58b056c032b03.type == xedb4922162c60d3d.DockTargetType.CreateNewContainer)
                    {
                        if (control2 != null)
                        {
                            goto label_9;
                        }
label_7:
                        xf333586e50dccad2.x6b145af772038ef2(selectedControl.Manager, selectedControl, x49cf4e0157d9436c, x11d58b056c032b03);
                        service2.Container.Add((IComponent)selectedControl.LayoutSystem.DockContainer);
                        if (control2 != null)
                        {
                            goto label_4;
                        }
                        else
                        {
                            goto label_5;
                        }
label_9:
                        service1.OnComponentChanging((object)control2, (MemberDescriptor)TypeDescriptor.GetProperties((object)control2)["Controls"]);
                        if (true)
                        {
                            goto label_7;
                        }
                        else
                        {
                            goto label_4;
                        }
                    }
                    else
                    {
                        goto label_5;
                    }
                }
                else
                {
                    service1.OnComponentChanging((object)x11d58b056c032b03.dockContainer, (MemberDescriptor)TypeDescriptor.GetProperties((object)x11d58b056c032b03.dockContainer)["LayoutSystem"]);
                    xf333586e50dccad2.x6b145af772038ef2(x11d58b056c032b03.dockContainer.Manager, selectedControl, x49cf4e0157d9436c, x11d58b056c032b03);
                    service1.OnComponentChanged((object)x11d58b056c032b03.dockContainer, (MemberDescriptor)TypeDescriptor.GetProperties((object)x11d58b056c032b03.dockContainer)["LayoutSystem"], (object)null, (object)null);
                    goto label_5;
                }
label_14:
                service1.OnComponentChanged((object)control2, (MemberDescriptor)TypeDescriptor.GetProperties((object)control2)["Controls"], (object)null, (object)null);
label_27:
                if (((x49cf4e0157d9436c ? 1 : 0) | int.MaxValue) != 0)
                {
                    goto label_10;
                }
                else
                {
                    goto label_28;
                }
label_29:
                if (false)
                {
                    goto label_20;
                }
                else
                {
                    goto label_22;
                }
label_18:
                do
                {
                    service1.OnComponentChanging((object)this.x0467b00af7810f0c, (MemberDescriptor)TypeDescriptor.GetProperties((object)this.x0467b00af7810f0c)["Manager"]);
                    service1.OnComponentChanging((object)this.x0467b00af7810f0c, (MemberDescriptor)TypeDescriptor.GetProperties((object)this.x0467b00af7810f0c)["LayoutSystem"]);
                    if (!x49cf4e0157d9436c)
                    {
                        if (true)
                        {
                            LayoutUtilities.xf1cbd48a28ce6e74(selectedControl);
                            if (true)
                            {
                                goto label_26;
                            }
                        }
                        else
                        {
                            goto label_31;
                        }
                    }
                    else
                    {
                        goto label_19;
                    }
                }while ((uint)x49cf4e0157d9436c + (uint)x49cf4e0157d9436c < 0U);
                goto label_22;
label_13:
                service1.OnComponentChanged((object)this.x0467b00af7810f0c, (MemberDescriptor)TypeDescriptor.GetProperties((object)this.x0467b00af7810f0c)["LayoutSystem"], (object)null, (object)null);
                service1.OnComponentChanged((object)this.x0467b00af7810f0c, (MemberDescriptor)TypeDescriptor.GetProperties((object)this.x0467b00af7810f0c)["Manager"], (object)null, (object)null);
                if (control2 == null)
                {
                    goto label_10;
                }
                else
                {
                    goto label_14;
                }
label_19:
                LayoutUtilities.x4487f2f8917e3fd0(xf333586e50dccad2);
                goto label_13;
label_26:
                if ((uint)x49cf4e0157d9436c - (uint)x49cf4e0157d9436c >= 0U)
                {
                    goto label_13;
                }
                else
                {
                    goto label_27;
                }
label_20:
                if (control2 == null)
                {
                    goto label_18;
                }
label_21:
                service1.OnComponentChanging((object)control2, (MemberDescriptor)TypeDescriptor.GetProperties((object)control2)["Controls"]);
                if ((uint)x49cf4e0157d9436c + (uint)x49cf4e0157d9436c < 0U)
                {
                    goto label_4;
                }
                else
                {
                    goto label_18;
                }
label_22:
                if (control2 != null)
                {
                    service3.SetSelectedComponents((ICollection) new object[1]
                    {
                        (object)this.x0467b00af7810f0c.Manager.DockSystemContainer
                    }, SelectionTypes.Replace);
                    goto label_20;
                }
                else
                {
                    service3.SetSelectedComponents((ICollection) new object[1]
                    {
                        (object)service2.RootComponent
                    }, SelectionTypes.Replace);
                    if (((x49cf4e0157d9436c ? 1 : 0) & 0) == 0)
                    {
                        goto label_20;
                    }
                    else
                    {
                        goto label_21;
                    }
                }
            }
            catch
            {
                transaction.Cancel();
                return;
            }
label_36:
            x49cf4e0157d9436c = this.x531514c39973cbc6.x59ae058c4a0dec87 == null;
            selectedControl   = xf333586e50dccad2.SelectedControl;
            this.xf6aefb7d0abb95ba();
            if (x11d58b056c032b03 == null || x11d58b056c032b03.type == xedb4922162c60d3d.DockTargetType.None)
            {
                return;
            }
            goto label_1;
label_37:
            service2          = (IDesignerHost)this.GetService(typeof(IDesignerHost));
            service3          = (ISelectionService)this.GetService(typeof(ISelectionService));
            xf333586e50dccad2 = (ControlLayoutSystem)this.x531514c39973cbc6.xf333586e50dccad2;
            if ((uint)flag > uint.MaxValue)
            {
                goto label_1;
            }
            else
            {
                goto label_36;
            }
        }
Example #8
0
 protected override void ComputeIdealSlotRect()
 {
     this.Settings.GridBox = LayoutUtilities.GetComputedGridBoxContainingRect(this.ChildRect, this.parentGrid);
     this.SlotRect         = LayoutUtilities.GetComputedGridRectFromGridBox(this.Settings.GridBox, this.parentGrid);
 }