コード例 #1
0
        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);
            }
        }
コード例 #2
0
        private UIAlertAction CreateLoadImageAction(string message, EDrawKeeperType loadType)
        {
            var loadAction = UIAlertAction.Create(message, UIAlertActionStyle.Default, action => {
                _drawKeeper = new DrawKeeperFactory().Create(loadType);
                LoadFile();
            });

            return(loadAction);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 private void SaveFile(EDrawKeeperType saveType)
 {
     _drawKeeper = new DrawKeeperFactory().Create(saveType);
     _drawKeeper.Save(_drawModel);
 }
コード例 #5
0
 private void LoadDataFromFile(EDrawKeeperType loadType)
 {
     _drawKeeper = new DrawKeeperFactory().Create(loadType);
     LoadFile();
 }