Example #1
0
 /// <summary>
 /// BotConfig is a singleton instance, so call this to get the current instance settings.
 /// </summary>
 /// <returns></returns>
 public static BotConfig Instance()
 {
     if (instance == null)
     {
         instance = new BotConfig();
     }
     return instance;
 }
Example #2
0
        public static void Load(string path)
        {
            
            JsonTextReader reader = new JsonTextReader(new StreamReader(path));

            JsonSerializer serializer = new JsonSerializer();
            instance = serializer.Deserialize<BotConfig>(reader);
            reader.Close();
        }
Example #3
0
        public static void Save(string path)
        {
            if (instance == null)
            {
                instance = new BotConfig();
            }

            JsonTextWriter writer = new JsonTextWriter(new StreamWriter(path));

            JsonSerializer serializer = new JsonSerializer();
            serializer.Formatting = Formatting.Indented;
            serializer.Serialize(writer, instance);
            writer.Close();

        }
Example #4
0
 public static void Clear()
 {
     instance = new BotConfig();
 }
Example #5
0
 public static void Clear()
 {
     instance = new BotConfig();
 }