private void RemoveFromParent(IAbcVisual oldVisualParent) { if (this.control == null) { return; } if (oldVisualParent == null) { return; } WFVisual wfVisualParent = (WFVisual)oldVisualParent; Panel panel = (Panel)wfVisualParent.control; panel.Controls.Remove(this.control); }
private void AddToParent() { if (this.control == null) { return; } IAbcVisual abcVisual = this; IAbcVisual abcVisualParent = abcVisual.VisualParent; if (abcVisualParent == null) { return; } WFVisual wfVisualParent = (WFVisual)abcVisualParent; Panel panel = (Panel)wfVisualParent.control; panel.Controls.Add(this.control); }
internal override void ArrangeOverride(AbcArrangeContext context) { IAbcCanvas abcCanvas = this; foreach (IAbcVisual abcChild in abcCanvas.Children) { AbcContextualPropertyValue arrangeSlotPropertyValue = abcChild.GetContextualPropertyValue(AbcCanvasContextualProperties.ArrangeSlotPropertyKey); context.arrangeSlot = arrangeSlotPropertyValue != null ? ((AbcContextualPropertyValue.AbcRect)arrangeSlotPropertyValue).value : abcCanvas.ArrangeSlot; WFVisual wfVisual = (WFVisual)abcChild; Control visualControl = (Control)wfVisual.control; if (visualControl != null) { visualControl.Bounds = new Rectangle((int)context.arrangeSlot.x, (int)context.arrangeSlot.y, (int)context.arrangeSlot.size.width, (int)context.arrangeSlot.size.height); } abcChild.Arrange(context); } base.ArrangeOverride(context); }