/// <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"; }
public AddContactInfoViewModel(IMvxFileStore fileStore, IWorkService workService) { _fileStore = fileStore; _workService = workService; GetLocationFromTextFile(); ContactInfo = new ContactInfo(); }
/// <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(); }
public GodsService(ISimpleRestService simpleRestService, IMvxFileStore fileStore, IMvxJsonConverter jsonConverter) { _simpleRestService = simpleRestService; _FileStore = fileStore; _JsonConverter = jsonConverter; _Path = _FileStore.PathCombine("SmiteApp", "gods.json"); }
public DependencyViewModel(IMyService myService, IMvxFileStore fileStore) { _myService = myService; _fileStore = fileStore; MyCommand = new MvxCommand(MyCommandExecute); }
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; }
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(); }
public DatabaseManager(IMvxSqliteConnectionFactory connectionFactory, IMvxFileStore fileStore) { this.connectionFactory = connectionFactory; this.fileStore = fileStore; CreateDatabase(); MigrateDatabase(); }
public FollowService(IMvxFileStore fileService, ILocalDataService localDbService, IMvxMessenger messenger) { _messenger = messenger; _localDbService = localDbService; _fileService = fileService; ReadFollows(); }
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; }
public LogDetailViewModel(IMvxMessenger messenger, ILogFetcher fetcher, IMvxFileStore fileStore) { this.fileStore = fileStore; this.fetcher = fetcher; messengerToken = messenger.Subscribe <LogMessage>(UpdateData); }
public TabHomeViewModel(IRecipeService recipeService, IMvxFileStore fileStore, IMvxNavigationService navigationService) { this._navigationService = navigationService; this._fileStore = fileStore; this._recipeService = recipeService; GetMorningJuice(); GetAfternoonJuice(); GetEveningJuice(); }
/// <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" }); }
public BackupManager(IBackupService backupService, IMvxFileStore fileStore, ISettingsManager settingsManager, IConnectivity connectivity) { this.backupService = backupService; this.fileStore = fileStore; this.settingsManager = settingsManager; this.connectivity = connectivity; }
public BackupManager(IRepositoryManager repositoryManager, IBackupService backupService, IMvxFileStore fileStore, IDatabaseManager databaseManager) { this.repositoryManager = repositoryManager; this.backupService = backupService; this.fileStore = fileStore; this.databaseManager = databaseManager; }
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>(); }
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); }
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); }
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)); }
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>(); }
public JsonFileRepository(IMvxFileStore fileStore, string dbName) { if (fileStore == null) { throw new ArgumentNullException("fileStore"); } this.fileStore = fileStore; this.dBName = dbName; CollectionName = typeof(T).Name; LoadJSONFile(); }
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(); }
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(); } }
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(); }
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(); } } } }
public ImageCache(IMvxFileStore fileStore) { _fileStore = fileStore; }
public StatePersistenceService(IMvxFileStore fileStore) { _fileStore = fileStore; }
public PetStoreService(IMvxFileStore fileStore) { _fileStore = fileStore; }
/// <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; }
public MockAlertService(IMvxFileStore fileService, ILocalDataService localDbService, IMvxMessenger messenger) : base() { //AddAlerts("701", new[] { "7" }); }
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; }
public TagFileTest(string dest) { this.dest = dest; this.fileService = Mvx.Resolve <IMvxFileStore>(); }
public FileBasedPersistenceContext(string dataFolder, IJsonSerializer serializer, IMvxFileStore fileStore) { DataFolder = dataFolder; Serializer = serializer; FileStore = fileStore; }
public DataFile(IMvxFileStore fileStore) { m_fileStore = fileStore; }