adds writer support for commandsfile json
This commit is contained in:
parent
f8c0af2e4d
commit
b55682c72a
1 changed files with 10 additions and 0 deletions
|
|
@ -49,6 +49,16 @@ namespace BetterSecondBotShared.IO
|
|||
serializer.Serialize(writer, Config);
|
||||
}
|
||||
}
|
||||
public void WriteJsonCommands(JsonCommandsfile commandsfile, string targetfile)
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
using (StreamWriter sw = new StreamWriter(@"" + root_folder + "" + targetfile))
|
||||
using (JsonWriter writer = new JsonTextWriter(sw) { Formatting = Formatting.Indented })
|
||||
{
|
||||
serializer.Serialize(writer, commandsfile);
|
||||
}
|
||||
}
|
||||
|
||||
public void makeOld(string targetfile)
|
||||
{
|
||||
System.IO.File.Move(@""+root_folder + "" + targetfile, @"" + root_folder + "" + targetfile+".old");
|
||||
|
|
|
|||
Loading…
Reference in a new issue