Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

working on reading coordinates from file

  • Loading branch information...
commit 08b9fbd1e257159f2529e3e766cd78a5c010cee0 1 parent a54da62
Stanislav Palatnik authored
17 GeometryTest/MainWindow.xaml.cs
... ... @@ -1,5 +1,6 @@
1 1 using System;
2 2 using System.Collections.Generic;
  3 +using System.IO;
3 4 using System.Linq;
4 5 using System.Text;
5 6 using System.Threading.Tasks;
@@ -40,7 +41,21 @@ private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
40 41
41 42 private void Create_Polygon_From_File(object sender, RoutedEventArgs e)
42 43 {
43   -
  44 + Polygon p1 = new Polygon();
  45 + if (!File.Exists("input.txt"))
  46 + {
  47 + Console.WriteLine("input.txt does not exist.");
  48 + return;
  49 + }
  50 + using (StreamReader sr = File.OpenText("input.txt"))
  51 + {
  52 + String input;
  53 + while ((input = sr.ReadLine()) != null)
  54 + {
  55 + Console.WriteLine(input);
  56 + }
  57 + Console.WriteLine("The end of the stream has been reached.");
  58 + }
44 59 }
45 60
46 61 private void Calculate_Vertex_Guards(object sender, RoutedEventArgs e)
9 GeometryTest/Models/CoordinatePoint.cs
@@ -8,5 +8,14 @@ namespace GeometryTest
8 8 {
9 9 class CoordinatePoint
10 10 {
  11 + private int Xcoord{ get;set;}
  12 + private int Ycoord { get; set; }
  13 + private enum color { Blue, Red, Yellow };
  14 +
  15 + public enum getColor(){
  16 + return this.color;
  17 + }
  18 +
  19 + public void setColor(enumCo
11 20 }
12 21 }
1  GeometryTest/Models/Polygon.cs
@@ -8,5 +8,6 @@ namespace GeometryTest
8 8 {
9 9 class Polygon
10 10 {
  11 + List<CoordinatePoint> vertices = new List<CoordinatePoint>();
11 12 }
12 13 }

0 comments on commit 08b9fbd

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