-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathProgram.cs
39 lines (32 loc) · 1.36 KB
/
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
//
// Copyright (c) .NET Foundation and Contributors
// See LICENSE file in the project root for full license information.
//
using System.Diagnostics;
using System.Threading;
namespace JsonConfigurationStore
{
public class Program
{
public static void Main()
{
Debug.WriteLine("Hello world!");
ConfigurationStore configurationStore = new ConfigurationStore();
Configuration configuration = new Configuration()
{
Setting1 = "Setting 1 value",
Setting2 = "Setting 2 value",
Setting3 = "Setting 3 value"
};
Debug.WriteLine($"A configuration file does {(configurationStore.IsConfigFileExisting ? string.Empty : "not ")} exist.");
configurationStore.ClearConfig();
Debug.WriteLine("The configuration file has been deleted.");
Debug.WriteLine($"A configuration file does {(configurationStore.IsConfigFileExisting ? string.Empty : "not ")} exist.");
Debug.WriteLine("Saving configuration file");
var writeResult = configurationStore.WriteConfig(configuration);
Debug.WriteLine($"Configuration file {(writeResult ? "" : "not ")} saved properly.");
var newConfig = configurationStore.GetConfig();
Thread.Sleep(Timeout.Infinite);
}
}
}