Пример #1
0
        public new RoundedRectProperty Clone()
        {
            RoundedRectProperty rrp = new RoundedRectProperty();

            rrp.Antialias = this.Antialias;

            rrp.PenWidth     = this.PenWidth;
            rrp.StrokeColor  = this.StrokeColor;
            rrp.LineDash     = this.LineDash;
            rrp.StartLineCap = this.StartLineCap;
            rrp.EndLineCap   = this.EndLineCap;
            rrp.PenAlign     = this.PenAlign;
            rrp.HowLineJoin  = this.HowLineJoin;

            rrp.PaintType = this.PaintType;
            rrp.FillType  = this.FillType;
            rrp.FillColor = this.FillColor;

            rrp.RadiusAll = this.RadiusAll;
            rrp.RadiusTL  = this.RadiusTL;
            rrp.RadiusTR  = this.RadiusTR;
            rrp.RadiusBR  = this.RadiusBR;
            rrp.RadiusBL  = this.RadiusBL;

            return(rrp);
        }
Пример #2
0
 public RoundedRectShape(EPKernel container, RoundedRectProperty pro)
     : base(container, pro)
 {
     _pro = pro;
     initialValue();
 }
Пример #3
0
 protected override void AfterPropertyChanged(BaseProperty oldValue, BaseProperty newValue)
 {
     _pro = (RoundedRectProperty)newValue;
     base.AfterPropertyChanged(oldValue, newValue);
 }
Пример #4
0
        private void CheckShapeProperty()
        {
            if (currentTool != ToolType.ShapeSelect || SelectedShapesCount != 1)
            {
                return;
            }

            bool         diff    = false;
            BaseProperty basepro = shapesList[selectedShapesIndexList[0]].ShapeProperty;

            if (proCollector.Antialias != basepro.Antialias)
            {
                proCollector.Antialias = basepro.Antialias;
                diff = true;
            }

            if (basepro is IndicatorArrowProperty)
            {
                IndicatorArrowProperty ip = (IndicatorArrowProperty)basepro;
                if (ip.LineColor != proCollector.StrokeColor ||
                    ip.LineSize != proCollector.IndicatorLineSize)
                {
                    diff = true;
                    proCollector.StrokeColor       = ip.LineColor;
                    proCollector.IndicatorLineSize = ip.LineSize;
                }
            }

            if (basepro is StrokableProperty)
            {
                StrokableProperty sp = (StrokableProperty)basepro;
                if (proCollector.PenWidth != sp.PenWidth ||
                    proCollector.StrokeColor != sp.StrokeColor ||
                    proCollector.LineDash != sp.LineDash ||
                    proCollector.StartLineCap != sp.StartLineCap ||
                    proCollector.EndLineCap != sp.EndLineCap ||
                    proCollector.PenAlign != sp.PenAlign ||
                    proCollector.HowLineJoin != sp.HowLineJoin)
                {
                    diff = true;
                    proCollector.PenWidth     = sp.PenWidth;
                    proCollector.StrokeColor  = sp.StrokeColor;
                    proCollector.LineDash     = sp.LineDash;
                    proCollector.StartLineCap = sp.StartLineCap;
                    proCollector.EndLineCap   = sp.EndLineCap;
                    proCollector.PenAlign     = sp.PenAlign;
                    proCollector.HowLineJoin  = sp.HowLineJoin;
                }
            }

            if (basepro is FillableProperty)
            {
                FillableProperty fp = (FillableProperty)basepro;
                if (proCollector.PaintType != fp.PaintType ||
                    proCollector.FillColor != fp.FillColor ||
                    proCollector.FillType != fp.FillType)
                {
                    diff = true;
                    proCollector.PaintType = fp.PaintType;
                    proCollector.FillColor = fp.FillColor;
                    proCollector.FillType  = fp.FillType;
                }
            }

            if (basepro is RoundedRectProperty)
            {
                RoundedRectProperty rp = (RoundedRectProperty)basepro;
                if (proCollector.RadiusAll != rp.RadiusAll)
                {
                    diff = true;
                    proCollector.RadiusAll = rp.RadiusAll;
                }
            }

            if (diff)
            {
                OnPropertyCollectorChanged(EventArgs.Empty);
            }
        }