Beispiel #1
0
        static A0DbMdl()
        {
            try
            {
                _asc = JsonIsoFileSerializer.Load <AzureSqlCredentials>();

#if StillInitializing
                if (_asc?.Usr == _rgn)
                {
                    return;
                }
                JsonIsoFileSerializer.Save <AzureSqlCredentials>(new AzureSqlCredentials {
                    Key = _key, Usr = _rgn
                });
                _asc = JsonIsoFileSerializer.Load <AzureSqlCredentials>();
#endif
            }
            catch (Exception ex) { ex.Log(); }
        }
        public static void Save()
        {
            if (_instance == null)
            {
                return;              //tu: ignore autosaves before fully rehydrated from the [iso] store.
            }
            switch (_storMode)
            {
            default:
            case StorageMode.OneDriveU: JsonFileSerializer.Save(_instance, _pathfile); break;

            case StorageMode.OneDrAlex: JsonFileSerializer.Save(_instance, _pathfile); break;

            case StorageMode.IsoProgDt: JsonIsoFileSerializer.Save(_instance); break;

            case StorageMode.IsoUsrLcl: JsonIsoFileSerializer.Save(_instance, null, IsoConst.ULocA); break;

            case StorageMode.IsoUsrRoa: JsonIsoFileSerializer.Save(_instance, null, IsoConst.URoaA); break;
            }
        }