Пример #1
0
        public static PathCommand Parse(string sequence, PathLocationInfo pathLocationInfo = null)
        {
            PathCommand pathCommand = new PathCommand();

            pathCommand.ParseCore(sequence);
            return(pathCommand);
        }
Пример #2
0
 public Location(PointF location, PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this()
 {
     locationCore               = location;
     pathLocationInfoCore       = locationInfo;
     useRelativeCoordinatesCore = useRelativeCoordinates;
     CommandType = commandType;
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
        }
Пример #6
0
 protected virtual void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo) { }
Пример #7
0
 public MoveToCommandArgs(PathCommandType commandType, Location[] locations, PathLocationInfo pathLocationInfo) : base(commandType) {
     locationsCore = locations.ToList();
     PathLocationInfo = pathLocationInfo;
 }
Пример #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;
 }
Пример #9
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo) {
     string[] coordinates = sequence.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
     ParseCore(coordinates, pathLocationInfo);
 }
Пример #10
0
 public Location(PointF location, PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this() {
     locationCore = location;
     pathLocationInfoCore = locationInfo;
     useRelativeCoordinatesCore = useRelativeCoordinates;
     CommandType = commandType;
 }
Пример #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);
        }
Пример #12
0
 public void SetPathLocationInfo(PathLocationInfo pathLocationInfo)
 {
     pathLocationInfoCore = pathLocationInfo;
 }
Пример #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);
     }
 }
Пример #14
0
 public RenderedPathInfo(PathAppearance appearance, PathLocationInfo pathLocationInfo = null)
 {
     appearanceCore   = appearance;
     pathCore         = new GraphicsPath();
     locationInfoCore = pathLocationInfo ?? new PathLocationInfo();
 }
Пример #15
0
 protected virtual Location CreateLocation(PathLocationInfo pathLocationInfo)
 {
     return(new Location(CommandType, pathLocationInfo, UseRelativeCoordinates));
 }
Пример #16
0
 public MoveToCommandArgs(PathCommandType commandType, Location[] locations, PathLocationInfo pathLocationInfo) : base(commandType)
 {
     locationsCore    = locations.ToList();
     PathLocationInfo = pathLocationInfo;
 }
Пример #17
0
 protected virtual void ParseCore(string[] coordinates, PathLocationInfo pathLocationInfo)
 {
 }
Пример #18
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo)
 {
     string[] coordinates = sequence.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
     ParseCore(coordinates, pathLocationInfo);
 }
Пример #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);
     }
 }
Пример #20
0
 public void SetPathLocationInfo(PathLocationInfo pathLocationInfo) {
     pathLocationInfoCore = pathLocationInfo;
 }
Пример #21
0
 protected virtual Location CreateLocation(PathLocationInfo pathLocationInfo) {
     return new Location(CommandType, pathLocationInfo, UseRelativeCoordinates);
 }
Пример #22
0
 public Location(PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this(PointF.Empty, commandType, locationInfo, useRelativeCoordinates)
 {
 }
Пример #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);
 }
Пример #24
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo = null) {
     Type = GetPathCommandType(sequence.First());
     Args = PathCommandArgs.Parse(Type, sequence);
 }
Пример #25
0
 public Location(PathCommandType commandType, PathLocationInfo locationInfo, bool useRelativeCoordinates) : this(PointF.Empty, commandType, locationInfo, useRelativeCoordinates) {
 }
Пример #26
0
 protected virtual void ParseCore(string sequence, PathLocationInfo pathLocationInfo = null)
 {
     Type = GetPathCommandType(sequence.First());
     Args = PathCommandArgs.Parse(Type, sequence);
 }
Пример #27
0
 public RenderedPathInfo(PathAppearance appearance, PathLocationInfo pathLocationInfo = null) {
     appearanceCore = appearance;
     pathCore = new GraphicsPath();
     locationInfoCore = pathLocationInfo ?? new PathLocationInfo();
 }
Пример #28
0
 public static PathCommand Parse(string sequence, PathLocationInfo pathLocationInfo = null) {
     PathCommand pathCommand = new PathCommand();
     pathCommand.ParseCore(sequence);
     return pathCommand;
 }