/// <summary>
        ///     Setting language files will be loaded from disk or from embedded resource, then load resources
        /// </summary>
        /// <param name="mvxFileStore"></param>
        /// <param name="resourceLoader"></param>
        /// <param name="deviceType"></param>
        /// <param name="defaultLanguage">
        ///     When not null and not empty, use this as the default languagecode instead of the current
        ///     CultureInfo
        /// </param>
        public void Initialize(IMvxFileStore mvxFileStore, IMvxResourceLoader resourceLoader, DeviceSizeType deviceType = DeviceSizeType.Phone, string defaultLanguage = "")
        {
            _defaultLanguage = defaultLanguage;

            UserSettingsLoader = new UserSettingsLoader <T>(mvxFileStore, resourceLoader);
            UserSettingsLoader.Initialize(SettingFolder, SettingFile);

            // We need type of device because sometime, the text of Phone and Tablet is difference
            switch (deviceType)
            {
            case DeviceSizeType.Phone:
            {
                _keyPrefix = "";
                break;
            }

            case DeviceSizeType.Tablet:
            {
                _keyPrefix = "Tablet#";
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException();
            }
            }

            LoadResources();
        }
    string currentkey_temp_dev = "AthulHarikumar00";        //This static key is not being used it is a just a place holder

    public PersistantStorageHelper()
    {
        this._mvxFileStore      = Mvx.Resolve <IMvxFileStore>();
        this._mvxFileStoreAsync = Mvx.Resolve <IMvxFileStoreAsync>();
        bcEngine.SetPadding(new Pkcs7Padding());
        currentkey_temp_dev = Constants.PassPhrase.Substring(4, 12) + "Road";
    }
Esempio n. 3
0
 public AddContactInfoViewModel(IMvxFileStore fileStore, IWorkService workService)
 {
     _fileStore   = fileStore;
     _workService = workService;
     GetLocationFromTextFile();
     ContactInfo = new ContactInfo();
 }
Esempio n. 4
0
        /// <summary>
        ///     Creates a new Database manager object
        /// </summary>
        /// <param name="connectionFactory">The connection factory who creates the connection for each plattform.</param>
        /// <param name="fileStore">An FileStore abstraction to access the file system on each plattform.</param>
        public DatabaseManager(IMvxSqliteConnectionFactory connectionFactory, IMvxFileStore fileStore)
        {
            this.connectionFactory = connectionFactory;
            this.fileStore         = fileStore;

            CreateDatabase();
        }
Esempio n. 5
0
 public GodsService(ISimpleRestService simpleRestService, IMvxFileStore fileStore, IMvxJsonConverter jsonConverter)
 {
     _simpleRestService = simpleRestService;
     _FileStore = fileStore;
     _JsonConverter = jsonConverter;
     _Path = _FileStore.PathCombine("SmiteApp", "gods.json");
 }
Esempio n. 6
0
        public DependencyViewModel(IMyService myService, IMvxFileStore fileStore)
        {
            _myService = myService;
            _fileStore = fileStore;

            MyCommand = new MvxCommand(MyCommandExecute);
        }
Esempio n. 7
0
        public LogManager(IChatManager chatManager, ICharacterManager characterManager, IMessageManager messageManager, IEventManager eventManager, IMvxFileStore fileManager)
        {
            this.fileManager = fileManager;
            var settings = AppSettings.Instance.Logging;

            serializer = new MessageSerializer(characterManager);
            eventSerializerSettings = new JsonSerializerSettings {
                Converters          = new JsonConverter[] { new CharacterConverter(characterManager), new ChannelMemberConverter(characterManager), new ChannelConverter() },
                TypeNameHandling    = TypeNameHandling.Auto,
                SerializationBinder = new EventSerializationBinder()
            };
            if (settings.LogDirectory == null)
            {
                return;
            }
            eventsLogFile          = Path.Combine(settings.LogDirectory, "EventLog");
            chatManager.Connected += () => {
                logDirectory = Path.Combine(settings.LogDirectory, chatManager.OwnCharacterName);
                fileManager.EnsureFolderExists(logDirectory);
            };
            messageManager.CharacterMessageReceived += (character, message) => {
                if (settings.LogPrivate)
                {
                    LogMessage(GetLogFile(GetLogId(character), false), message);
                }
            };
            messageManager.ChannelMessageReceived += (channel, message) => {
                var isAd = message.MessageType == Message.Type.Ad;
                if (isAd && settings.LogAds || !isAd && settings.LogChannels)
                {
                    LogMessage(GetLogFile(GetLogId(channel), isAd), message);
                }
            };
            eventManager.NewEvent += NewEvent;
        }
Esempio n. 8
0
 public BackupManager(ICloudBackupService cloudBackupService,
                      IMvxFileStore fileStore,
                      IConnectivityAdapter connectivity)
 {
     this.cloudBackupService = cloudBackupService;
     this.fileStore          = fileStore;
     this.connectivity       = connectivity;
 }
        public SqliteConnectionCreator(IMvxSqliteConnectionFactory connectionFactory, IMvxFileStore fileStore)
        {
            this.connectionFactory = connectionFactory;
            this.fileStore         = fileStore;

            CreateDb();
            MigrateDb();
        }
Esempio n. 10
0
        public DatabaseManager(IMvxSqliteConnectionFactory connectionFactory, IMvxFileStore fileStore)
        {
            this.connectionFactory = connectionFactory;
            this.fileStore = fileStore;

            CreateDatabase();
            MigrateDatabase();
        }
Esempio n. 11
0
        public FollowService(IMvxFileStore fileService, ILocalDataService localDbService, IMvxMessenger messenger)
        {
            _messenger = messenger;
            _localDbService = localDbService;
            _fileService = fileService;

            ReadFollows();
        }
Esempio n. 12
0
 public AddJobViewModel(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
     Job        = new Job
     {
         AccountId = Globals.AccountId
     };
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="iFileStore">file system reference</param>
 /// <param name="appSettings">Application settings</param>
 public TaskRepository(IMvxFileStore iFileStore, IAppSettings appSettings)
 {
     _iFileStore = iFileStore;
     _tasks = new List<TaskItem>();
     _lastTaskId = 0;
     //file name of tasks from repo
     _fileName = appSettings.TaskDatabaseName;
 }
Esempio n. 14
0
 public LogDetailViewModel(IMvxMessenger messenger,
                           ILogFetcher fetcher,
                           IMvxFileStore fileStore)
 {
     this.fileStore = fileStore;
     this.fetcher   = fetcher;
     messengerToken = messenger.Subscribe <LogMessage>(UpdateData);
 }
Esempio n. 15
0
 public TabHomeViewModel(IRecipeService recipeService, IMvxFileStore fileStore, IMvxNavigationService navigationService)
 {
     this._navigationService = navigationService;
     this._fileStore         = fileStore;
     this._recipeService     = recipeService;
     GetMorningJuice();
     GetAfternoonJuice();
     GetEveningJuice();
 }
Esempio n. 16
0
 /// <summary>
 /// Constructeur de la vue principale
 /// </summary>
 /// <param name="messenger"></param>
 /// <param name="fileStore"></param>
 /// <param name="fetcher"></param>
 public MainViewModel(IMvxMessenger messenger,
                      ILogFetcher fetcher,
                      IMvxFileStore fileStore)
 {
     ShowViewModel <ConnectionViewModel>();
     ShowViewModel <LogListViewModel>();
     ShowViewModel <LogDetailViewModel>();
     ShowViewModel <LogFilterViewModel>();
 }
 public MockFollowService(IMvxFileStore fileService, ILocalDataService localDbService, IMvxMessenger messenger)
     : base(fileService, localDbService, messenger)
 {
     AddFollows("701", new[] { "7" });
     AddFollows("702", new[] { "7" });
     AddFollows("705", new[] { "7" });
     AddFollows("706", new[] { "7" });
     AddFollows("707", new[] { "7" });
     AddFollows("708", new[] { "7" });
 }
Esempio n. 18
0
 public BackupManager(IBackupService backupService,
                      IMvxFileStore fileStore,
                      ISettingsManager settingsManager,
                      IConnectivity connectivity)
 {
     this.backupService   = backupService;
     this.fileStore       = fileStore;
     this.settingsManager = settingsManager;
     this.connectivity    = connectivity;
 }
Esempio n. 19
0
 public BackupManager(IRepositoryManager repositoryManager,
     IBackupService backupService,
     IMvxFileStore fileStore,
     IDatabaseManager databaseManager)
 {
     this.repositoryManager = repositoryManager;
     this.backupService = backupService;
     this.fileStore = fileStore;
     this.databaseManager = databaseManager;
 }
Esempio n. 20
0
 public BackupManager(IRepositoryManager repositoryManager,
                      IBackupService backupService,
                      IMvxFileStore fileStore,
                      IDatabaseManager databaseManager)
 {
     this.repositoryManager = repositoryManager;
     this.backupService     = backupService;
     this.fileStore         = fileStore;
     this.databaseManager   = databaseManager;
 }
Esempio n. 21
0
 public LogListViewModel(ILogFetcher fetcher,
                         IMvxFileStore fileStore,
                         IMvxMessenger messenger)
 {
     messengerToken = Mvx.Resolve <IMvxMessenger>().Subscribe <UpdateLogListMessage>(UpdateLogs);
     this.fetcher   = fetcher;
     this.fileStore = fileStore;
     this.messenger = messenger;
     LogList        = new ObservableCollection <LogListItemViewModel>();
 }
Esempio n. 22
0
        public AlertsViewModel()
        {
            _messenger = Mvx.Resolve<IMvxMessenger>();
            _service = Mvx.Resolve<IAlertService>();
            _fileService = Mvx.Resolve<IMvxFileStore>();
            _localDbService = Mvx.Resolve<ILocalDataService>();
            //			NetworkConnectionHelper = Mvx.Resolve<IConnectivity> ();
            _messenger.Subscribe<FollowsChanged>( async x => await ExecuteRefreshCommand(), MvxReference.Strong);

        }
Esempio n. 23
0
        public LoginService(string tokenPath, string clientId, string clientSecret, Uri authorizeUri, Uri redirectUri, Uri accessUri, IMvxFileStore fileStore)
        {
            ClientId = clientId;
            ClientSecret = clientSecret;
            TokenPath = tokenPath;
            AuthorizeUri = authorizeUri;
            RedirectUri = redirectUri;
            AccessUri = accessUri;

            this.fileStore = fileStore;
        }
Esempio n. 24
0
        public LoginService(string tokenPath, string clientId, string clientSecret, Uri authorizeUri, Uri redirectUri, Uri accessUri, IMvxFileStore fileStore)
        {
            ClientId     = clientId;
            ClientSecret = clientSecret;
            TokenPath    = tokenPath;
            AuthorizeUri = authorizeUri;
            RedirectUri  = redirectUri;
            AccessUri    = accessUri;

            this.fileStore = fileStore;
        }
        public NoteDataService(IMvxFileStore mvxFileStorage)
        {
            filePath = "noteStorage.json";
            converter = new MvxJsonConverter();

            storage = mvxFileStorage;
            if (!storage.Exists(filePath))
            {
                storage.WriteFile(filePath, converter.SerializeObject(Enumerable.Empty<Note>()));
            }
        }
        public LocalMappingService()
        {
            _fileStoreAsync = Mvx.Resolve<IMvxFileStoreAsync>();
            _fileStore = Mvx.Resolve<IMvxFileStore>();
            _pathProvider = Mvx.Resolve<IPathProvider>();

            _baseDir = _pathProvider.BaseDirPath;
            _mappingsDir = Path.Combine(_baseDir, "Mappings");

            _fileStore.EnsureFolderExists(_mappingsDir);
        }
Esempio n. 27
0
        public CommunicationViewModel(IMvxFileStore fileStore, IMvxMessenger messenger)
        {
            _fileStore = fileStore;

            //Se inscreve para receber mensagens de um determinado tipo
            _token = messenger.Subscribe <CommunicationMessage>(OnCommunicationMessage);

            _token.Dispose();
            //Exemplo de como enviar uma mensagem. Sim, é simples assim.
            //messenger.Publish(new CommunicationMessage(this));
        }
Esempio n. 28
0
 public BackupManager(IBackupService backupService,
                      IMvxFileStore fileStore,
                      IDatabaseManager databaseManager,
                      ISettingsManager settingsManager,
                      IPaymentRepository paymentRepository)
 {
     this.backupService     = backupService;
     this.fileStore         = fileStore;
     this.databaseManager   = databaseManager;
     this.settingsManager   = settingsManager;
     this.paymentRepository = paymentRepository;
 }
 /// <summary>
 /// setup code
 /// </summary>
 private void before_each()
 {
     //mock the appsettings and filesystem
     _fileName = "tmp.txt";
     _taskRepository = null;
     _content = "";
     
     _appSettings = Substitute.For<IAppSettings>();
     _appSettings.TaskDatabaseName.Returns(_fileName);
    _ifileStore = Substitute.For<IMvxFileStore>();
    
 }
Esempio n. 30
0
        public JsonFileRepository(IMvxFileStore fileStore, string dbName)
        {
            if (fileStore == null)
            {
                throw new ArgumentNullException("fileStore");
            }

            this.fileStore = fileStore;
            this.dBName    = dbName;

            CollectionName = typeof(T).Name;
            LoadJSONFile();
        }
Esempio n. 31
0
 public AddViewModel(
     ICollectionService collectionService,
     ILocationService locationService,
     IMvxMessenger messenger,
     IMvxPictureChooserTask pictureChooserTask, IMvxFileStore fileStore)
 {
     _collectionService  = collectionService;
     _locationService    = locationService;
     _pictureChooserTask = pictureChooserTask;
     _fileStore          = fileStore;
     _token = messenger.SubscribeOnMainThread <LocationMessage>(OnLocation);
     GetInitialLocation();
 }
 public AddViewModel(
     ICollectionService collectionService, 
     ILocationService locationService, 
     IMvxMessenger messenger, 
     IMvxPictureChooserTask pictureChooserTask, IMvxFileStore fileStore)
 {
     _collectionService = collectionService;
     _locationService = locationService;
     _pictureChooserTask = pictureChooserTask;
     _fileStore = fileStore;
     _token = messenger.SubscribeOnMainThread<LocationMessage>(OnLocation);
     GetInitialLocation();
 }
Esempio n. 33
0
 public BackupManager(IBackupService backupService,
     IMvxFileStore fileStore,
     IDatabaseManager databaseManager,
     ISettingsManager settingsManager,
     IPaymentRepository paymentRepository, 
     IConnectivity connectivity)
 {
     this.backupService = backupService;
     this.fileStore = fileStore;
     this.databaseManager = databaseManager;
     this.settingsManager = settingsManager;
     this.paymentRepository = paymentRepository;
     this.connectivity = connectivity;
 }
        public FavoritesService(IMvxFileStore fileStore, IMvxMessenger messenger)
        {
            _fileStore = fileStore;
            _messenger = messenger;

            string contents;

            if (_fileStore.TryReadTextFile(FavoritesFile, out contents))
            {
                Load(contents);
            }
            else
            {
                Save();
            }
        }
Esempio n. 35
0
        private CacheService(string credFileName)
        {
            storage          = Mvx.Resolve <IMvxFileStore>();
            asyncStorage     = Mvx.Resolve <IAsyncStorageService>();
            _indexByHttp     = new Dictionary <string, Entry>();
            _persistentFiles = new List <string>();

            //Add Files that won't be erased by the CacheCleaner
            _persistentFiles.Add(_indexFileName);
            _persistentFiles.Add(credFileName);

            loadEntries();
            checkForUnindexedFiles();
            checkForOldFiles();
            writeEntries();
        }
Esempio n. 36
0
        public MainViewModel(IMvxFileStore fileStore)
        {
            m_options = new List<string>() {"CadizDeveloper" , "CadizDeveloperJobs" , "Users"};

            m_fileStore = fileStore;

            var data = new DataFile(m_fileStore);
            data.Read();

            if (string.IsNullOrEmpty(data.AccessTokenFacebook) == true)
            {
                IFacebookService service = Mvx.GetSingleton<IFacebookService>();

                if (string.IsNullOrEmpty(service.AccessToken) == true)
                {
                    this.ShowViewModel<FacebookLoginViewModel>();
                }
                else
                {
                    data.AccessTokenFacebook = service.AccessToken;
                }
            }
        }
        /// <summary>
        /// Initialize the temp folder with every attachments copies
        /// </summary>
        public void CreateAttachmentsCopies()
        {
            IList <Log>   logs        = repo.GetAll();
            IMvxFileStore fileStore   = Mvx.Resolve <IMvxFileStore>();
            string        tempDirPath = @"./TempAttachments";

            // Create/Clear temp dir
            if (fileStore.FolderExists(tempDirPath))
            {
                fileStore.DeleteFolder(tempDirPath, true);
            }
            fileStore.EnsureFolderExists(tempDirPath);


            foreach (Log log in logs)
            {
                IList <string> attachmentsNames = repo.GetAttachmentNames(log.Id);
                if (attachmentsNames.Count > 0)
                {
                    fileStore.EnsureFolderExists(tempDirPath + "/" + log.Id);
                }
                foreach (string attachmentName in attachmentsNames)
                {
                    Stream stream = repo.GetAttachment(log.Id, attachmentName);
                    stream.Seek(0, SeekOrigin.Begin);
                    StreamReader sr = new StreamReader(stream);
                    //fileStore.WriteFile(tempDirPath + "/" + log.Id + "/" + attachmentName, sr.ReadToEnd());
                    int    b        = stream.ReadByte();
                    Stream tempFile = fileStore.OpenWrite(tempDirPath + "/" + log.Id + "/" + attachmentName);
                    while (b != -1)
                    {
                        tempFile.WriteByte((byte)b);
                        b = stream.ReadByte();
                    }
                }
            }
        }
Esempio n. 38
0
 public ImageCache(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
 }
Esempio n. 39
0
 public ImageCache(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
 }
 public StatePersistenceService(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
 }
 public PetStoreService(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
 }
Esempio n. 42
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="fileStore">Parameter to work with files</param>
 /// <param name="jsonConverter">Parameter to work with json converter</param>
 public FileStore(IMvxFileStore fileStore, IJsonConverter jsonConverter)
 {
     _fileStore     = fileStore;
     _jsonConverter = jsonConverter;
 }
 public OneDriveService(IMvxFileStore fileStore, IOneDriveAuthenticator oneDriveAuthenticator)
 {
     this.fileStore             = fileStore;
     this.oneDriveAuthenticator = oneDriveAuthenticator;
 }
Esempio n. 44
0
 public MockAlertService(IMvxFileStore fileService, ILocalDataService localDbService, IMvxMessenger messenger)
     : base()
 {
     //AddAlerts("701", new[] { "7" });
 }
Esempio n. 45
0
 public OneDriveService(IMvxFileStore fileStore, IOneDriveAuthenticator oneDriveAuthenticator)
 {
     this.fileStore = fileStore;
     this.oneDriveAuthenticator = oneDriveAuthenticator;
 }
Esempio n. 46
0
 public StatePersistenceService(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
 }
Esempio n. 47
0
 public FolderObserverService(IMvxFileStore store, IMvxMessenger hug)
 {
     this.store = store;
     this.hug = hug;
     this.knownFiles = new Dictionary<string, DateTime>(64);
 }
 public UserAuthenticationDataService(IMvxFileStore fileStore)
 {
     _fileStore = fileStore;
 }
 public LocalSiteStorage(IMvxFileStore fileStore)
 {
     FileStore = fileStore;
 }
Esempio n. 50
0
 public TagFileTest(string dest)
 {
     this.dest        = dest;
     this.fileService = Mvx.Resolve <IMvxFileStore>();
 }
Esempio n. 51
0
 public FileBasedPersistenceContext(string dataFolder, IJsonSerializer serializer, IMvxFileStore fileStore)
 {
     DataFolder = dataFolder;
     Serializer = serializer;
     FileStore  = fileStore;
 }
Esempio n. 52
0
 public DataFile(IMvxFileStore fileStore)
 {
     m_fileStore = fileStore;
 }