public IDrawKeeper Create(EDrawKeeperType type) { switch (type) { case EDrawKeeperType.Internal: return(new InternalKeeper()); case EDrawKeeperType.File: return(new FileKeeperIOS()); case EDrawKeeperType.SQLite: { var path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); var dbPath = System.IO.Path.Combine(path, "ormbase.db3"); return(new SQLiteKepper(dbPath)); } case EDrawKeeperType.Realm: return(new RealmKeeper()); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
private UIAlertAction CreateLoadImageAction(string message, EDrawKeeperType loadType) { var loadAction = UIAlertAction.Create(message, UIAlertActionStyle.Default, action => { _drawKeeper = new DrawKeeperFactory().Create(loadType); LoadFile(); }); return(loadAction); }
private UIAlertAction CreateSaveToFileAction(string message, EDrawKeeperType loadType) { var loadAction = UIAlertAction.Create(message, UIAlertActionStyle.Default, action => { _drawKeeper = new DrawKeeperFactory().Create(loadType); _drawKeeper.Save(_drawModel); }); return(loadAction); }
private void SaveFile(EDrawKeeperType saveType) { _drawKeeper = new DrawKeeperFactory().Create(saveType); _drawKeeper.Save(_drawModel); }
private void LoadDataFromFile(EDrawKeeperType loadType) { _drawKeeper = new DrawKeeperFactory().Create(loadType); LoadFile(); }