public ViewModelJsonConverter(bool isPostback, JObject encryptedValues = null)
 {
     IsPostback      = isPostback;
     EncryptedValues = encryptedValues ?? new JObject();
     evReader        = EncryptedValuesReader.FromObject(EncryptedValues);
     evWriter        = new EncryptedValuesWriter(EncryptedValues.CreateWriter());
 }
Beispiel #2
0
 public ViewModelJsonConverter(bool isPostback, IViewModelSerializationMapper viewModelSerializationMapper, JObject encryptedValues = null)
 {
     IsPostback      = isPostback;
     EncryptedValues = encryptedValues ?? new JObject();
     evReader        = EncryptedValuesReader.FromObject(EncryptedValues);
     evWriter        = new EncryptedValuesWriter(EncryptedValues.CreateWriter());
     this.viewModelSerializationMapper = viewModelSerializationMapper;
 }
Beispiel #3
0
 public ViewModelJsonConverter(bool isPostback, IViewModelSerializationMapper viewModelSerializationMapper, JObject encryptedValues = null)
 {
     IsPostback      = isPostback;
     EncryptedValues = encryptedValues ?? new JObject();
     evReader        = new Lazy <EncryptedValuesReader>(() => {
         evWriter = new Lazy <EncryptedValuesWriter>(() => { throw new Exception("Can't use EncryptedValuesWriter at the same time as EncryptedValuesReader."); });
         return(new EncryptedValuesReader(EncryptedValues));
     });
     evWriter = new Lazy <EncryptedValuesWriter>(() => {
         evReader = new Lazy <EncryptedValuesReader>(() => { throw new Exception("Can't use EncryptedValuesReader at the same time as EncryptedValuesWriter."); });
         return(new EncryptedValuesWriter(EncryptedValues.CreateWriter()));
     });
     this.viewModelSerializationMapper = viewModelSerializationMapper;
 }