Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();

            Variables = json.Read(jsonPath);

            if (Variables != null)
            {
                _Lines  = Variables.l;
                _points = Variables.p;
            }


            centerX        = (float)grid.Width / 2;
            centerY        = (float)grid.Height / 2;
            timer.Interval = new TimeSpan(0, 0, 0, 0, 30);


            _lines = real.MakeLine(_Lines, _lines, _points, centerX, centerY);

            foreach (Line line in _lines)
            {
                grid.Children.Add(line);
            }

            real.MakeUnvsible(_Lines, _lines, _points);
        }
Beispiel #2
0
        public JsonFormat Read(string jsonPath)
        {
            var        jsonContent         = File.ReadAllText(jsonPath);
            JsonFormat deserializedProduct = JsonConvert.DeserializeObject <JsonFormat>(jsonContent);

            return(deserializedProduct);
        }
Beispiel #3
0
        public void safeRotation(JsonFormat Variables, List <Cordinate> points, List <Lines> linesV, string jsonPath)
        {
            Variables = new JsonFormat
            {
                p = points,
                l = linesV
            };

            Json json = new Json();

            json.Wirte(Variables, jsonPath);
        }
Beispiel #4
0
        public void Wirte(JsonFormat json, string jsonPath)
        {
            string jsonSring = JsonConvert.SerializeObject(json);

            File.WriteAllText(jsonPath, jsonSring);
        }