예제 #1
0
        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);
        }
예제 #2
0
        public void Init(string token)
        {
            if (token == null)
            {
                throw new ArgumentNullException(nameof(token));
            }

            var profileModels = _settingsStorage
                                .GetValue <string>(SettingsKeys.Profiles)
                                .FromJson <ICollection <ProfileModel> >(JsonConverter);

            ProfileModel = profileModels.SingleOrDefault(pm => pm.Token == token);

            RestAPIViewModel.InitRestAPI();
            RestAPIViewModel.CameraName = ProfileModel.Name;
            RestAPIViewModel.SelectedPlaybackStartsEvent += HandleSelectedPlaybackStartsEvent;
        }