-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
41 lines (34 loc) · 933 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace SheduleEV
{
class Program
{
static SheduleMasClass shed_mas = new SheduleMasClass();
static void Main(string[] args)
{
SheduleClass shed = new SheduleClass("Task1", 1);
shed_mas.Add(shed);
shed.name = "Task2";
shed.priority = 3;
shed_mas.Add(shed);
shed.name = "Task3";
shed.priority = 2;
shed_mas.Add(shed);
shed.name = "Task4";
shed.priority = 1;
shed_mas.Add(shed);
shed.name = "Task9";
shed.priority = 3;
shed_mas.Add(shed);
string json = JsonConvert.SerializeObject(shed_mas);
//Console.WriteLine(json);
shed_mas.SaveToFile(@"d:\fb.txt");
SheduleMasClass dshed_mas = new SheduleMasClass();
dshed_mas.LoadFromFile(@"d:\fb.txt");
Console.WriteLine(dshed_mas);
Console.ReadKey();
}
}
}