Пример #1
0
        public bool SetStorageData(StorageData storageData)
        {
            var fileName = GetFileName(storageData.InstanceId);

            var resultStr = storageData.Value.ToString("E", CultureInfo.CreateSpecificCulture("en-US"));

            File.WriteAllText(fileName, resultStr);

            return(true);
        }
Пример #2
0
        public StorageData LoadStorageData(StorageData storageData)
        {
            var text = File.ReadAllText(GetFileName(storageData.InstanceId));

            return(new StorageData()
            {
                InstanceId = storageData.InstanceId,
                Value = double.Parse(text, CultureInfo.CreateSpecificCulture("en-US"))
            });
        }
Пример #3
0
        public bool ClearStorageData(StorageData storageData)
        {
            var fileName = GetFileName(storageData.InstanceId);

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            return(true);
        }