public virtual void RestoreCacheConfiguration(Bundle savedInstanceState, IMvxJsonConverter serializer) { if (savedInstanceState == null) { return; } EnableOnFragmentPoppedCallback = savedInstanceState.GetBoolean(SavedFragmentCacheConfigurationEnabledFragmentPoppedCallbackState, true); // restore what fragments we have registered - and informations about registered fragments. string jsonSerializedMvxCachedFragmentInfosToRestore; if (Build.VERSION.SdkInt >= BuildVersionCodes.HoneycombMr1) { jsonSerializedMvxCachedFragmentInfosToRestore = savedInstanceState.GetString(SavedFragmentCacheConfiguration, string.Empty); } else { jsonSerializedMvxCachedFragmentInfosToRestore = savedInstanceState.GetString(SavedFragmentCacheConfiguration); } // there are no registered fragments at this moment, skip restore if (string.IsNullOrEmpty(jsonSerializedMvxCachedFragmentInfosToRestore)) { return; } var serializedMvxCachedFragmentInfos = serializer.DeserializeObject <Dictionary <string, TSerializableMvxCachedFragmentInfo> >(jsonSerializedMvxCachedFragmentInfosToRestore); _lookup = serializedMvxCachedFragmentInfos.ToDictionary(x => x.Key, keyValuePair => MvxCachedFragmentInfoFactory.ConvertSerializableFragmentInfo(keyValuePair.Value as SerializableMvxCachedFragmentInfo)); }
private void RestoreCurrentFragmentsFromBundle(IMvxJsonConverter serializer, Bundle savedInstanceState) { var json = savedInstanceState.GetString(SavedCurrentFragmentsKey); var currentFragments = serializer.DeserializeObject <Dictionary <int, string> >(json); _currentFragments = currentFragments; }
public GodsService(ISimpleRestService simpleRestService, IMvxFileStore fileStore, IMvxJsonConverter jsonConverter) { _simpleRestService = simpleRestService; _FileStore = fileStore; _JsonConverter = jsonConverter; _Path = _FileStore.PathCombine("SmiteApp", "gods.json"); }
public SoftwareManager(IMvxJsonConverter jsonConverter) : base(jsonConverter) { CurrentVersion = new SoftwareVersion { Name = CurrentPackage.VersionName, Number = CurrentPackage.VersionCode }; }
public QuadCellViewModel(QuadViewModel quadViewModel, IOnvifServiceAggregator onvifServiceAggregator, IMvxMessenger messenger, ISettings settingsStorage, IMvxJsonConverter jsonConverter) { _quadViewModel = quadViewModel; _onvifServiceAggregator = onvifServiceAggregator; _messenger = messenger; _settingsStorage = settingsStorage; _jsonConverter = jsonConverter; MediaPlayerViewModel = new MediaPlayerViewModel(messenger); }
public SimpleRestClient(IMvxJsonConverter jsonConverter) { _jsonConverter = jsonConverter; if (String.IsNullOrWhiteSpace(MediaType)) { MediaType = "application/json"; } if (DefaultParameters == null) { DefaultParameters = new RestParameters(); } }
public LoginViewModel(IAuthenticationService authenticationService, IRemoteConferenceService remoteConferenceService, IMvxJsonConverter jsonConverter, IDatabaseService databaseService, HttpClient httpClient) { _remoteConferenceService = remoteConferenceService; _databaseService = databaseService; _jsonConverter = jsonConverter; _authenticationService = authenticationService; _httpClient = httpClient; }
public virtual void SaveFragmentCacheConfigurationState(Bundle outState, IMvxJsonConverter serializer) { if (outState == null) { return; } var mvxCachedFragmentInfosToSave = CreateMvxCachedFragmentInfosToSave(); string serializedMvxCachedFragmentInfosToSave = serializer.SerializeObject(mvxCachedFragmentInfosToSave); outState.PutString(SavedFragmentCacheConfiguration, serializedMvxCachedFragmentInfosToSave); outState.PutBoolean(SavedFragmentCacheConfigurationEnabledFragmentPoppedCallbackState, EnableOnFragmentPoppedCallback); }
private static void RestoreViewModelsFromBundle(IMvxJsonConverter serializer, Bundle savedInstanceState) { IMvxSavedStateConverter savedStateConverter; IMvxMultipleViewModelCache viewModelCache; IMvxViewModelLoader viewModelLoader; if (!Mvx.TryResolve(out savedStateConverter)) { Mvx.Trace("Could not resolve IMvxSavedStateConverter, won't be able to convert saved state"); return; } if (!Mvx.TryResolve(out viewModelCache)) { Mvx.Trace("Could not resolve IMvxMultipleViewModelCache, won't be able to convert saved state"); return; } if (!Mvx.TryResolve(out viewModelLoader)) { Mvx.Trace("Could not resolve IMvxViewModelLoader, won't be able to load ViewModel for caching"); return; } // Harder ressurection, just in case we were killed to death. var json = savedInstanceState.GetString(SavedFragmentTypesKey); if (string.IsNullOrEmpty(json)) { return; } var savedState = serializer.DeserializeObject <Dictionary <string, Type> >(json); foreach (var item in savedState) { var bundle = savedInstanceState.GetBundle(item.Key); if (bundle.IsEmpty) { continue; } var mvxBundle = savedStateConverter.Read(bundle); var request = MvxViewModelRequest.GetDefaultRequest(item.Value); // repopulate the ViewModel with the SavedState and cache it. var vm = viewModelLoader.LoadViewModel(request, mvxBundle); viewModelCache.Cache(vm, item.Key); } }
private static void RestoreViewModelsFromBundle(IMvxJsonConverter serializer, Bundle savedInstanceState) { IMvxSavedStateConverter savedStateConverter; IMvxMultipleViewModelCache viewModelCache; IMvxViewModelLoader viewModelLoader; if (!Mvx.TryResolve(out savedStateConverter)) { Mvx.Trace("Could not resolve IMvxSavedStateConverter, won't be able to convert saved state"); return; } if (!Mvx.TryResolve(out viewModelCache)) { Mvx.Trace("Could not resolve IMvxMultipleViewModelCache, won't be able to convert saved state"); return; } if (!Mvx.TryResolve(out viewModelLoader)) { Mvx.Trace("Could not resolve IMvxViewModelLoader, won't be able to load ViewModel for caching"); return; } // Harder ressurection, just in case we were killed to death. var json = savedInstanceState.GetString(SavedFragmentTypesKey); if (string.IsNullOrEmpty(json)) return; var savedState = serializer.DeserializeObject<Dictionary<string, Type>>(json); foreach (var item in savedState) { var bundle = savedInstanceState.GetBundle(item.Key); if (bundle.IsEmpty) continue; var mvxBundle = savedStateConverter.Read(bundle); var request = MvxViewModelRequest.GetDefaultRequest(item.Value); // repopulate the ViewModel with the SavedState and cache it. var vm = viewModelLoader.LoadViewModel(request, mvxBundle); viewModelCache.Cache(vm, item.Key); } }
public RestDemoViewModel(IMvxNavigationService navigationService , IMvxJsonConverter mvxJsonConverter , IRestClient restClient , IMvxRestClient mvxRestClient , IMvxJsonRestClient mvxJsonRestClient , IHttpService httpService , IBaseHttpService baseHttpService) { _navigationService = navigationService; _mvxJsonConverter = mvxJsonConverter; _restClient = restClient; _mvxRestClient = mvxRestClient; _mvxJsonRestClient = mvxJsonRestClient; _httpSvc = httpService; _baseHttpSvc = baseHttpService; //var items = _artistService.GetAll(); //Items = new MvxObservableCollection<Artist>(); //_items.AddRange(items); }
public CodeCampService(IFileManager fileManager, IMvxJsonConverter jsonConverter, ICampDataClient client) { _fileManager = fileManager; _jsonConverter = jsonConverter; _client = client; }
public PTZControlViewModel(MvxViewModel parentViewModel, IOnvifServiceAggregator onvifServiceAggregator, IMvxMessenger messenger, IMvxJsonConverter jsonConverter) : base(messenger, jsonConverter) { if (parentViewModel == null) { throw new ArgumentNullException(nameof(parentViewModel)); } _onvifServiceAggregator = onvifServiceAggregator; _parentViewModel = parentViewModel; }
public HttpService(IMvxJsonConverter jsonConverter) { _jsonConverter = jsonConverter; }
public SimpleRestService(IMvxJsonConverter jsonConverter) { _jsonConverter = jsonConverter; }
public QueueEntity(IQueuedCommand command, IMvxJsonConverter jsonConverter) { this.CommandTypeName = command.GetType().FullName; this.SerializedObject = jsonConverter.SerializeObject(command); }
protected BaseViewModel(IMvxMessenger messenger, IMvxJsonConverter jsonConverter) { Messenger = messenger; JsonConverter = jsonConverter; }
public ConferencesViewModel(IMvxJsonConverter converter) { _converter = converter; Task.WhenAll(Task.Run(() => GetConferences())); }
public MvxQueue(ISQLiteConnectionFactory factory, IMvxJsonConverter jsonConverter) { _jsonConverter = jsonConverter; _connection = factory.Create("queue.db"); _connection.CreateTable<QueueEntity>(); }
public RestClient(IMvxJsonConverter jsonConverter, IMvxLog mvxLog) { _jsonConverter = jsonConverter; _mvxLog = mvxLog; }
public LoginViewModel(IMvxMessenger messenger, IMvxJsonConverter jsonConverter) : base(messenger, jsonConverter) { }
public SvccService(IMvxJsonConverter jsonConverter, IMvxFileStore fileStore) { _jsonConverter = jsonConverter; _fileStore = fileStore; }
public ConferenceService(HttpClient httpClient, IMvxJsonConverter jsonConverter) { _httpClient = httpClient; _jsonConverter = jsonConverter; }
public CampDataClient(IMvxJsonConverter jsonConverter) { _jsonConverter = jsonConverter; }
public PlaybackViewModel(IOnvifServiceAggregator onvifServiceAggregator, IMvxMessenger messenger, IMvxJsonConverter jsonConverter, ISettings settingsStorage) : base(messenger, jsonConverter) { _onvifServiceAggregator = onvifServiceAggregator; _settingsStorage = settingsStorage; MediaPlayerViewModel = new MediaPlayerViewModel(messenger, true); RestAPIViewModel = new RestAPIViewModel(messenger, jsonConverter); }
public RestClient() { _jsonConverter = new MvxJsonConverter(); }
public DataService(IHttpClientService httpClientService) { _client = httpClientService.GetHttpClient(); _serializer = Mvx.IoCProvider.Resolve <IMvxJsonConverter>(); }
public RestAPIViewModel(IMvxMessenger messenger, IMvxJsonConverter jsonConverter) : base(messenger, jsonConverter) { RestAPIInstance = Mvx.Resolve <IIrisRestAPI>(); }
public MyShowsApi(IWebApiService webApiService, IMvxJsonConverter jsonConverter, IDataManager dataManager, ICryptographyMD5 cryptographyMD5) : base(webApiService, jsonConverter) { this.dataManager = dataManager; this.cryptographyMD5 = cryptographyMD5; }
public static T FromJson <T>(this string json, IMvxJsonConverter jsonConverter) where T : class { return(jsonConverter.DeserializeObject <T>(json)); }
public QuadViewModel(IOnvifServiceAggregator onvifServiceAggregator, IMvxMessenger messenger, IMvxJsonConverter jsonConverter, ISettings settingsStorage) : base(messenger, jsonConverter) { _settingsStorage = settingsStorage; QuadCellViewModels = new ReadOnlyCollection <QuadCellViewModel>(new List <QuadCellViewModel> { new QuadCellViewModel(this, onvifServiceAggregator, messenger, settingsStorage, jsonConverter), new QuadCellViewModel(this, onvifServiceAggregator, messenger, settingsStorage, jsonConverter), new QuadCellViewModel(this, onvifServiceAggregator, messenger, settingsStorage, jsonConverter), new QuadCellViewModel(this, onvifServiceAggregator, messenger, settingsStorage, jsonConverter) }); }
public static string ToJson <T>(this T @object, IMvxJsonConverter jsonConverter) where T : class { return(jsonConverter.SerializeObject(@object)); }
public RestClient(IMvxJsonConverter jsonConverter) { _jsonConverter = jsonConverter; }
/// <summary> /// Creates a new instance of the FeedbackDataService /// </summary> /// <param name="fileStore">File store that will be used to interact with data</param> /// <param name="jsonConverter">Converter used to serialize and deserialize json</param> public FeedbackDataService(IMvxFileStore fileStore, IMvxJsonConverter jsonConverter) { _fileStore = fileStore; _jsonConverter = jsonConverter; }
public SoftwareManagerBase(IMvxJsonConverter jsonConverter) { JsonConverter = jsonConverter; }
public LiveViewModel(IOnvifServiceAggregator onvifServiceAggregator, IMvxMessenger messenger, IMvxJsonConverter jsonConverter, ISettings settingsStorage) : base(messenger, jsonConverter) { _onvifServiceAggregator = onvifServiceAggregator; _settingsStorage = settingsStorage; PTZControlViewModel = new PTZControlViewModel(this, onvifServiceAggregator, messenger, jsonConverter); MediaPlayerViewModel = new MediaPlayerViewModel(messenger); }
public ConferenceService (HttpClient httpClient, IMvxJsonConverter jsonConverter) { _httpClient = httpClient; _jsonConverter = jsonConverter; }