Skip to content
Browse files

working on reading coordinates from file

  • Loading branch information...
1 parent a54da62 commit 08b9fbd1e257159f2529e3e766cd78a5c010cee0 @stanpalatnik committed Mar 18, 2012
Showing with 26 additions and 1 deletion.
  1. +16 −1 GeometryTest/MainWindow.xaml.cs
  2. +9 −0 GeometryTest/Models/CoordinatePoint.cs
  3. +1 −0 GeometryTest/Models/Polygon.cs
View
17 GeometryTest/MainWindow.xaml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -40,7 +41,21 @@ private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
private void Create_Polygon_From_File(object sender, RoutedEventArgs e)
{
-
+ Polygon p1 = new Polygon();
+ if (!File.Exists("input.txt"))
+ {
+ Console.WriteLine("input.txt does not exist.");
+ return;
+ }
+ using (StreamReader sr = File.OpenText("input.txt"))
+ {
+ String input;
+ while ((input = sr.ReadLine()) != null)
+ {
+ Console.WriteLine(input);
+ }
+ Console.WriteLine("The end of the stream has been reached.");
+ }
}
private void Calculate_Vertex_Guards(object sender, RoutedEventArgs e)
View
9 GeometryTest/Models/CoordinatePoint.cs
@@ -8,5 +8,14 @@ namespace GeometryTest
{
class CoordinatePoint
{
+ private int Xcoord{ get;set;}
+ private int Ycoord { get; set; }
+ private enum color { Blue, Red, Yellow };
+
+ public enum getColor(){
+ return this.color;
+ }
+
+ public void setColor(enumCo
}
}
View
1 GeometryTest/Models/Polygon.cs
@@ -8,5 +8,6 @@ namespace GeometryTest
{
class Polygon
{
+ List<CoordinatePoint> vertices = new List<CoordinatePoint>();
}
}

0 comments on commit 08b9fbd

Please sign in to comment.
Something went wrong with that request. Please try again.