Esempio n. 1
0
 public static void Save(IVertexSource vertexSource, string pathAndFileName, bool oldStyle = true)
 {
     if (oldStyle)
     {
         using (StreamWriter outFile = new StreamWriter(pathAndFileName))
         {
             vertexSource.rewind(0);
             double x;
             double y;
             ShapePath.FlagsAndCommand flagsAndCommand = vertexSource.vertex(out x, out y);
             do
             {
                 outFile.WriteLine("{0}, {1}, {2}", x, y, flagsAndCommand.ToString());
                 flagsAndCommand = vertexSource.vertex(out x, out y);
             }while (flagsAndCommand != ShapePath.FlagsAndCommand.Stop);
         }
     }
     else
     {
         using (StreamWriter outFile = new StreamWriter(pathAndFileName))
         {
             foreach (VertexData vertexData in vertexSource.Vertices())
             {
                 outFile.WriteLine("{0}, {1}, {2}", vertexData.position.X, vertexData.position.Y, vertexData.command.ToString());
             }
         }
     }
 }
Esempio n. 2
0
 public override string ToString()
 {
     return(command.ToString());
 }