Пример #1
0
        public override object InitialClone()
        {
            var c = (ReplaceWidget)base.InitialClone();

            c.NewWidget         = (Widget)NewWidget?.Clone();
            c.NewWidgetStart    = (InnerWidgetLocation)NewWidgetStart?.Clone();
            c.OldWidgetEnd      = (InnerWidgetLocation)OldWidgetEnd?.Clone();
            c.NewWidgetMovement = NewWidgetMovement;
            c.OldWidgetMovement = OldWidgetMovement;
            c.DisposeOld        = DisposeOld;
            return(c);
        }
Пример #2
0
        protected override void Initialize()
        {
            Parent.SendToContainer();
            Parent.ParentWidget.Insert(0, NewWidget);

            _new_widget_snapping_policy_prev = NewWidget.SnappingPolicy;
            NewWidget.SnappingPolicy         = DiagonalDirections2D.None;

            var new_widget_target_area = NewWidget.Area;

            NewWidget.Area = NewWidgetStart.GetLocation(Parent, NewWidget);

            _old_widget_area = new PropertyTransitionAction <RectangleF>(nameof(Widget.Area), OldWidgetEnd.GetLocation(Parent, Parent), OldWidgetMovement);
            _new_widget_area = new PropertyTransitionAction <RectangleF>(nameof(Widget.Area), new_widget_target_area, NewWidgetMovement);

            Parent.Actions.Add(_old_widget_area);
            NewWidget.Actions.Add(_new_widget_area);
        }