コード例 #1
0
        protected override VisualGroup CreateVisual(IRenderContext context, IStripe stripe)
        {
            IRectangle  layout  = stripe.Layout.ToRectD();
            GeneralPath outline = CreatePath(stripe, layout);
            var         visual  = outline.CreatePath(StripeDescriptor.BackgroundBrush,
                                                     new Pen(StripeDescriptor.BorderBrush, StripeDescriptor.BorderThickness.Left),
                                                     null, FillMode.Always);

            var cc = new VisualGroup();

            cc.Add(visual);
            cc.SetCanvasArrangeRect(layout.ToRectD());
            return(cc);
        }
コード例 #2
0
        protected override VisualGroup UpdateVisual(IRenderContext context, VisualGroup oldVisual, IStripe stripe)
        {
            IRectangle layout      = stripe.Layout.ToRectD();
            var        rect        = CanvasControl.GetCanvasControlArrangeRect(oldVisual);
            var        arrangeRect = layout.ToRectD();

            if (rect.Width != arrangeRect.Width || rect.Height != arrangeRect.Height)
            {
                GeneralPath outline = CreatePath(stripe, layout);
                var         oldPath = (Path)oldVisual.Children[0];
                outline.UpdatePath(oldPath, StripeDescriptor.BackgroundBrush,
                                   new Pen(StripeDescriptor.BorderBrush, StripeDescriptor.BorderThickness.Left),
                                   null, FillMode.Always);
            }
            oldVisual.SetCanvasArrangeRect(arrangeRect);
            return(oldVisual);
        }
コード例 #3
0
 public void Reshape(IRectangle newRectangle)
 {
     tightRect = newRectangle.ToRectD();
     rectangle.Reshape(tightRect.GetEnlarged(Margins));
     invalid = false;
 }