Exemple #1
0
        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));
        }
Exemple #2
0
        private void RestoreCurrentFragmentsFromBundle(IMvxJsonConverter serializer, Bundle savedInstanceState)
        {
            var json             = savedInstanceState.GetString(SavedCurrentFragmentsKey);
            var currentFragments = serializer.DeserializeObject <Dictionary <int, string> >(json);

            _currentFragments = currentFragments;
        }
Exemple #3
0
 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
     };
 }
Exemple #5
0
        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 LoginViewModel(IAuthenticationService authenticationService,
			IRemoteConferenceService remoteConferenceService,
						IMvxJsonConverter jsonConverter, 
						IDatabaseService databaseService, 
						HttpClient httpClient)
		{
			_remoteConferenceService = remoteConferenceService;
			_databaseService = databaseService;
			_jsonConverter = jsonConverter;
			_authenticationService = authenticationService;
			_httpClient = httpClient;
		}
Exemple #9
0
        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);
        }
Exemple #10
0
        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);
            }
        }
Exemple #12
0
        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);
        }
Exemple #13
0
 public CodeCampService(IFileManager fileManager, IMvxJsonConverter jsonConverter, ICampDataClient client)
 {
     _fileManager   = fileManager;
     _jsonConverter = jsonConverter;
     _client        = client;
 }
Exemple #14
0
        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;
        }
Exemple #15
0
 public HttpService(IMvxJsonConverter jsonConverter)
 {
     _jsonConverter = jsonConverter;
 }
Exemple #16
0
 public SimpleRestService(IMvxJsonConverter jsonConverter)
 {
     _jsonConverter = jsonConverter;
 }
Exemple #17
0
 public QueueEntity(IQueuedCommand command, IMvxJsonConverter jsonConverter)
 {
     this.CommandTypeName = command.GetType().FullName;
     this.SerializedObject = jsonConverter.SerializeObject(command);
 }
Exemple #18
0
 protected BaseViewModel(IMvxMessenger messenger, IMvxJsonConverter jsonConverter)
 {
     Messenger     = messenger;
     JsonConverter = jsonConverter;
 }
		public ConferencesViewModel(IMvxJsonConverter converter)
		{
			_converter = converter;
			Task.WhenAll(Task.Run(() => GetConferences()));
		}
Exemple #20
0
 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;
 }
Exemple #22
0
 public LoginViewModel(IMvxMessenger messenger, IMvxJsonConverter jsonConverter)
     : base(messenger, jsonConverter)
 {
 }
Exemple #23
0
 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);
        }
Exemple #27
0
 public RestClient()
 {
     _jsonConverter = new MvxJsonConverter();
 }
Exemple #28
0
 public DataService(IHttpClientService httpClientService)
 {
     _client     = httpClientService.GetHttpClient();
     _serializer = Mvx.IoCProvider.Resolve <IMvxJsonConverter>();
 }
Exemple #29
0
 public RestAPIViewModel(IMvxMessenger messenger, IMvxJsonConverter jsonConverter) : base(messenger, jsonConverter)
 {
     RestAPIInstance = Mvx.Resolve <IIrisRestAPI>();
 }
Exemple #30
0
 public MyShowsApi(IWebApiService webApiService, IMvxJsonConverter jsonConverter, IDataManager dataManager, ICryptographyMD5 cryptographyMD5)
     : base(webApiService, jsonConverter)
 {
     this.dataManager = dataManager;
     this.cryptographyMD5 = cryptographyMD5;
 }
 public CampDataClient(IMvxJsonConverter jsonConverter)
 {
     _jsonConverter = jsonConverter;
 }
Exemple #32
0
 public static T FromJson <T>(this string json, IMvxJsonConverter jsonConverter) where T : class
 {
     return(jsonConverter.DeserializeObject <T>(json));
 }
Exemple #33
0
        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)
            });
        }
Exemple #34
0
 public static string ToJson <T>(this T @object, IMvxJsonConverter jsonConverter) where T : class
 {
     return(jsonConverter.SerializeObject(@object));
 }
Exemple #35
0
 public RestClient(IMvxJsonConverter jsonConverter)
 {
     _jsonConverter = jsonConverter;
 }
 public CodeCampService(IFileManager fileManager, IMvxJsonConverter jsonConverter, ICampDataClient client)
 {
     _fileManager = fileManager;
     _jsonConverter = jsonConverter;
     _client = client;
 }
Exemple #37
0
 /// <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;
 }
Exemple #38
0
 public SoftwareManagerBase(IMvxJsonConverter jsonConverter)
 {
     JsonConverter = jsonConverter;
 }
Exemple #39
0
        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;
		}