Beispiel #1
0
 private void InitilizePolylineSegment(Polyline polyline, PolylineSegmentDefinition segment)
 {
     if (segment.Points.Count == 1)
     {
         polyline.Points = new PointCollection()
         {
             segment.Points[0],
             segment.Points[0]
         };
         polyline.StrokeStartLineCap = PenLineCap.Round;
         polyline.StrokeEndLineCap   = PenLineCap.Round;
         polyline.StrokeThickness    = segment.Appearance.StrokeThickness * 2.0;
     }
     else
     {
         polyline.Points             = segment.Points;
         polyline.StrokeStartLineCap = PenLineCap.Flat;
         polyline.StrokeEndLineCap   = PenLineCap.Flat;
         polyline.StrokeThickness    = segment.Appearance.StrokeThickness;
     }
     polyline.Stroke          = segment.Appearance.Stroke;
     polyline.StrokeDashArray = VisualUtilities.GetStrokeDashArray(segment.Appearance.StrokeDashType);
     polyline.Effect          = segment.Appearance.Effect;
     polyline.Opacity         = segment.Appearance.Opacity;
 }
Beispiel #2
0
 private List<PolylineSegmentDefinition> GetSegmentDefinitions()
 {
     List<PolylineSegmentDefinition> list = new List<PolylineSegmentDefinition>();
     PolylineSegmentDefinition segmentDefinition = (PolylineSegmentDefinition)null;
     for (int index = 0; index < this.Points.Count; ++index)
     {
         if (ValueHelper.CanGraph(this.Points[index].X) && ValueHelper.CanGraph(this.Points[index].Y))
         {
             if (segmentDefinition != null && this.IsSameAppearance(segmentDefinition.Appearance, this.Appearances[index]))
             {
                 segmentDefinition.Points.Add(this.Points[index]);
             }
             else
             {
                 segmentDefinition = new PolylineSegmentDefinition();
                 segmentDefinition.Appearance = this.Appearances[index];
                 segmentDefinition.Points.Add(this.Points[index]);
                 list.Add(segmentDefinition);
             }
         }
     }
     return list;
 }
Beispiel #3
0
        private List <PolylineSegmentDefinition> GetSegmentDefinitions()
        {
            List <PolylineSegmentDefinition> list = new List <PolylineSegmentDefinition>();
            PolylineSegmentDefinition        segmentDefinition = (PolylineSegmentDefinition)null;

            for (int index = 0; index < this.Points.Count; ++index)
            {
                if (ValueHelper.CanGraph(this.Points[index].X) && ValueHelper.CanGraph(this.Points[index].Y))
                {
                    if (segmentDefinition != null && this.IsSameAppearance(segmentDefinition.Appearance, this.Appearances[index]))
                    {
                        segmentDefinition.Points.Add(this.Points[index]);
                    }
                    else
                    {
                        segmentDefinition            = new PolylineSegmentDefinition();
                        segmentDefinition.Appearance = this.Appearances[index];
                        segmentDefinition.Points.Add(this.Points[index]);
                        list.Add(segmentDefinition);
                    }
                }
            }
            return(list);
        }
Beispiel #4
0
 private void InitilizePolylineSegment(Polyline polyline, PolylineSegmentDefinition segment)
 {
     if (segment.Points.Count == 1)
     {
         polyline.Points = new PointCollection()
     {
       segment.Points[0],
       segment.Points[0]
     };
         polyline.StrokeStartLineCap = PenLineCap.Round;
         polyline.StrokeEndLineCap = PenLineCap.Round;
         polyline.StrokeThickness = segment.Appearance.StrokeThickness * 2.0;
     }
     else
     {
         polyline.Points = segment.Points;
         polyline.StrokeStartLineCap = PenLineCap.Flat;
         polyline.StrokeEndLineCap = PenLineCap.Flat;
         polyline.StrokeThickness = segment.Appearance.StrokeThickness;
     }
     polyline.Stroke = segment.Appearance.Stroke;
     polyline.StrokeDashArray = VisualUtilities.GetStrokeDashArray(segment.Appearance.StrokeDashType);
     polyline.Effect = segment.Appearance.Effect;
     polyline.Opacity = segment.Appearance.Opacity;
 }