コード例 #1
0
        protected override void BeginObjectLoad(Guid objectGuid)
        {
            var filePath   = JsonDiskSaveProvider.GetSavePath(objectGuid);
            var binaryText = File.ReadAllText(filePath);

            //decrypt the file and write it back to the file
            File.WriteAllText(filePath, JsonBinaryDiskSaveProvider.DecryptString(binaryText));
            //let the baseclass read it
            base.BeginObjectLoad(objectGuid);
            //encrypt it again
            File.WriteAllText(filePath, binaryText);
        }
コード例 #2
0
        protected override void BeginObjectLoad(Guid objectGuid)
        {
            var serializerSettings = new JsonSerializerSettings {
                Converters = new List <JsonConverter> {
                    new DictionaryConverter()
                }
            };

            using (StreamReader streamReader = File.OpenText(JsonDiskSaveProvider.GetSavePath(objectGuid)))
                using (JsonTextReader reader = new JsonTextReader(streamReader))
                {
                    _openObject       = (JObject)JToken.ReadFrom(reader);
                    _objectEnumerator = _openObject.GetEnumerator();
                }
        }
コード例 #3
0
 protected override bool DoesSaveExist(GuidComponent guidComponent)
 {
     return(File.Exists(JsonDiskSaveProvider.GetSavePath(guidComponent.GetGuid())));
 }