Ejemplo n.º 1
0
        public static PathCommand Parse(string sequence, PathLocationInfo pathLocationInfo = null)
        {
            PathCommand pathCommand = new PathCommand();

            pathCommand.ParseCore(sequence);
            return(pathCommand);
        }
Ejemplo n.º 2
0
 public Location(PointF location, PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this()
 {
     locationCore               = location;
     pathLocationInfoCore       = locationInfo;
     useRelativeCoordinatesCore = useRelativeCoordinates;
     CommandType = commandType;
 }
Ejemplo n.º 3
0
 protected override void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo)
 {
     for (int i = 0, j = 0; i < coordinates.Length; i += 2, j++)
     {
         PointF   point    = new PointF(Convert.ToSingle(coordinates[i], CultureInfo.InvariantCulture), Convert.ToSingle(coordinates[i + 1], CultureInfo.InvariantCulture));
         Location location = new Location(point, CommandType, pathLocationInfo, UseRelativeCoordinates);
         AddLocation(location);
     }
 }
Ejemplo n.º 4
0
 protected override void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo)
 {
     foreach (string coordinate in coordinates)
     {
         PointF   point    = new PointF(Convert.ToSingle(coordinate, CultureInfo.InvariantCulture), 0);
         Location location = new Location(point, CommandType, pathLocationInfo, UseRelativeCoordinates);
         location.UnitType = LocationUnitType.Y;
         AddLocation(location);
     }
 }
Ejemplo n.º 5
0
        protected override void ParseCore(string[] args, PathLocationInfo pathLocationInfo)
        {
            radiusCore.Width  = Convert.ToSingle(args[0], CultureInfo.InvariantCulture);
            radiusCore.Height = Convert.ToSingle(args[1], CultureInfo.InvariantCulture);
            XAxisRotation     = Convert.ToBoolean(Convert.ToInt32(args[2], CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
            LargeArcFlag      = Convert.ToBoolean(Convert.ToInt32(args[3], CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
            SweepFlag         = Convert.ToBoolean(Convert.ToInt32(args[4], CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
            PointF location = new PointF(Convert.ToSingle(args[5], CultureInfo.InvariantCulture), Convert.ToSingle(args[6], CultureInfo.InvariantCulture));

            locationCore = new Location(location, CommandType, pathLocationInfo, UseRelativeCoordinates);
        }
Ejemplo n.º 6
0
 protected virtual void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo) { }
Ejemplo n.º 7
0
 public MoveToCommandArgs(PathCommandType commandType, Location[] locations, PathLocationInfo pathLocationInfo) : base(commandType) {
     locationsCore = locations.ToList();
     PathLocationInfo = pathLocationInfo;
 }
Ejemplo n.º 8
0
 public static PathCommandArgs Parse(PathCommandType commandType, string sequence, PathLocationInfo pathLocationInfo = null) {
     PathCommandArgs commandArgs = CreateInstance(commandType);
     commandArgs.PathLocationInfo = pathLocationInfo;
     commandArgs.UseRelativeCoordinates = Char.IsLower(sequence.First());
     commandArgs.ParseCore(sequence.Substring(1), pathLocationInfo);
     return commandArgs;
 }
Ejemplo n.º 9
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo) {
     string[] coordinates = sequence.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
     ParseCore(coordinates, pathLocationInfo);
 }
Ejemplo n.º 10
0
 public Location(PointF location, PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this() {
     locationCore = location;
     pathLocationInfoCore = locationInfo;
     useRelativeCoordinatesCore = useRelativeCoordinates;
     CommandType = commandType;
 }
Ejemplo n.º 11
0
        public static PathCommandArgs Parse(PathCommandType commandType, string sequence, PathLocationInfo pathLocationInfo = null)
        {
            PathCommandArgs commandArgs = CreateInstance(commandType);

            commandArgs.PathLocationInfo       = pathLocationInfo;
            commandArgs.UseRelativeCoordinates = Char.IsLower(sequence.First());
            commandArgs.ParseCore(sequence.Substring(1), pathLocationInfo);
            return(commandArgs);
        }
Ejemplo n.º 12
0
 public void SetPathLocationInfo(PathLocationInfo pathLocationInfo)
 {
     pathLocationInfoCore = pathLocationInfo;
 }
Ejemplo n.º 13
0
 protected override void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo) {
     foreach(string coordinate in coordinates) {
         PointF point = new PointF(Convert.ToSingle(coordinate, CultureInfo.InvariantCulture), 0);
         Location location = new Location(point, CommandType, pathLocationInfo, UseRelativeCoordinates);
         location.UnitType = LocationUnitType.Y;
         AddLocation(location);
     }
 }
Ejemplo n.º 14
0
 public RenderedPathInfo(PathAppearance appearance, PathLocationInfo pathLocationInfo = null)
 {
     appearanceCore   = appearance;
     pathCore         = new GraphicsPath();
     locationInfoCore = pathLocationInfo ?? new PathLocationInfo();
 }
Ejemplo n.º 15
0
 protected virtual Location CreateLocation(PathLocationInfo pathLocationInfo)
 {
     return(new Location(CommandType, pathLocationInfo, UseRelativeCoordinates));
 }
Ejemplo n.º 16
0
 public MoveToCommandArgs(PathCommandType commandType, Location[] locations, PathLocationInfo pathLocationInfo) : base(commandType)
 {
     locationsCore    = locations.ToList();
     PathLocationInfo = pathLocationInfo;
 }
Ejemplo n.º 17
0
 protected virtual void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo)
 {
 }
Ejemplo n.º 18
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo)
 {
     string[] coordinates = sequence.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
     ParseCore(coordinates, pathLocationInfo);
 }
Ejemplo n.º 19
0
 protected override void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo) {
     for(int i = 0, j = 0; i < coordinates.Length; i += 2, j++) {
         PointF point = new PointF(Convert.ToSingle(coordinates[i], CultureInfo.InvariantCulture), Convert.ToSingle(coordinates[i + 1], CultureInfo.InvariantCulture));
         Location location = new Location(point, CommandType, pathLocationInfo, UseRelativeCoordinates);
         AddLocation(location);
     }
 }
Ejemplo n.º 20
0
 public void SetPathLocationInfo(PathLocationInfo pathLocationInfo) {
     pathLocationInfoCore = pathLocationInfo;
 }
Ejemplo n.º 21
0
 protected virtual Location CreateLocation(PathLocationInfo pathLocationInfo) {
     return new Location(CommandType, pathLocationInfo, UseRelativeCoordinates);
 }
Ejemplo n.º 22
0
 public Location(PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this(PointF.Empty, commandType, locationInfo, useRelativeCoordinates)
 {
 }
Ejemplo n.º 23
0
 protected override void ParseCore(string[] args, PathLocationInfo pathLocationInfo) {
     radiusCore.Width = Convert.ToSingle(args[0], CultureInfo.InvariantCulture);
     radiusCore.Height = Convert.ToSingle(args[1], CultureInfo.InvariantCulture);
     XAxisRotation = Convert.ToBoolean(Convert.ToInt32(args[2], CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
     LargeArcFlag = Convert.ToBoolean(Convert.ToInt32(args[3], CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
     SweepFlag = Convert.ToBoolean(Convert.ToInt32(args[4], CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);
     PointF location = new PointF(Convert.ToSingle(args[5], CultureInfo.InvariantCulture), Convert.ToSingle(args[6], CultureInfo.InvariantCulture));
     locationCore = new Location(location, CommandType, pathLocationInfo, UseRelativeCoordinates);
 }
Ejemplo n.º 24
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo = null) {
     Type = GetPathCommandType(sequence.First());
     Args = PathCommandArgs.Parse(Type, sequence);
 }
Ejemplo n.º 25
0
 public Location(PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this(PointF.Empty, commandType, locationInfo, useRelativeCoordinates) {
 }
Ejemplo n.º 26
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo = null)
 {
     Type = GetPathCommandType(sequence.First());
     Args = PathCommandArgs.Parse(Type, sequence);
 }
Ejemplo n.º 27
0
 public RenderedPathInfo(PathAppearance appearance, PathLocationInfo pathLocationInfo = null) {
     appearanceCore = appearance;
     pathCore = new GraphicsPath();
     locationInfoCore = pathLocationInfo ?? new PathLocationInfo();
 }
Ejemplo n.º 28
0
 public static PathCommand Parse(string sequence, PathLocationInfo pathLocationInfo = null) {
     PathCommand pathCommand = new PathCommand();
     pathCommand.ParseCore(sequence);
     return pathCommand;
 }