public void Write(EncryptedWorkspace workspace, StringWriter writer)
        {
            string json = JsonConvert.SerializeObject(workspace,
                                                      IndentOutput == true ? Formatting.Indented : Formatting.None,
                                                      new Newtonsoft.Json.Converters.StringEnumConverter(),
                                                      new PaperSizeJsonConverter());

            writer.WriteLine(json);
        }
Exemplo n.º 2
0
        public EncryptedWorkspace Read(StringReader reader)
        {
            EncryptedWorkspace workspace = JsonConvert.DeserializeObject <EncryptedWorkspace>(
                reader.ReadToEnd(),
                new Newtonsoft.Json.Converters.StringEnumConverter(),
                new PaperSizeJsonConverter(),
                new EncryptionStrategyJsonConverter());

            return(workspace);
        }