Create() public static method

Creates a new LineFixedLength instance.
public static Create ( LineFixedLengthFlags flags = LineFixedLengthFlags.Disabled, ShapeState startTrigger = null, ShapeState endTrigger = null, double length = 15.0 ) : LineFixedLength
flags LineFixedLengthFlags The line fixed length flags.
startTrigger Core2D.Shape.ShapeState The line start point state trigger.
endTrigger Core2D.Shape.ShapeState The line end point state trigger.
length double The line fixed length.
return LineFixedLength
Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new <see cref="LineStyle"/> instance.
 /// </summary>
 /// <param name="name">The line style name.</param>
 /// <param name="isCurved">The flag indicating whether line is curved.</param>
 /// <param name="curvature">The line curvature.</param>
 /// <param name="curveOrientation">The curve orientation.</param>
 /// <param name="fixedLength">The line style fixed length.</param>
 /// <returns>The new instance of the <see cref="LineStyle"/> class.</returns>
 public static LineStyle Create(
     string name      = "",
     bool isCurved    = false,
     double curvature = 50.0,
     CurveOrientation curveOrientation = CurveOrientation.Auto,
     LineFixedLength fixedLength       = null)
 {
     return(new LineStyle()
     {
         Name = name,
         IsCurved = isCurved,
         Curvature = curvature,
         CurveOrientation = curveOrientation,
         FixedLength = fixedLength ?? LineFixedLength.Create()
     });
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses a line fixed length string.
        /// </summary>
        /// <param name="s">The line fixed length string.</param>
        /// <returns>The <see cref="LineFixedLength"/>.</returns>
        public static LineFixedLength Parse(string s)
        {
            var flags = (LineFixedLengthFlags)Enum.Parse(typeof(LineFixedLengthFlags), s, true);

            return(LineFixedLength.Create(flags));
        }