Exemple #1
0
 protected override void Execute(object parameter)
 {
     if (parameter is Interfaces.IVideoContent video)
     {
         if (video.ProviderId != null)
         {
             _ngSettings.RemoveNGVideoOwnerId(video.ProviderId);
         }
     }
 }
Exemple #2
0
        private void UnregistrationHiddenVideoOwnerButton_Click(object sender, RoutedEventArgs e)
        {
            IsRevealHiddenVideo = false;
            VideoHiddenInfo     = null;

            if (DataContext is Interfaces.IVideoContent video)
            {
                _ngSettings.RemoveNGVideoOwnerId(video.ProviderId);
            }
        }
Exemple #3
0
        public UserInfoPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            UserProvider userProvider,
            NGSettings ngSettings,
            Models.NiconicoSession niconicoSession,
            SubscriptionManager subscriptionManager,
            UserMylistManager userMylistManager,
            HohoemaPlaylist hohoemaPlaylist,
            PageManager pageManager,
            MylistRepository mylistRepository,
            ExternalAccessService externalAccessService,
            NiconicoFollowToggleButtonService followToggleButtonService,
            Commands.Subscriptions.CreateSubscriptionGroupCommand createSubscriptionGroupCommand
            )
        {
            NiconicoSession                = niconicoSession;
            SubscriptionManager            = subscriptionManager;
            UserMylistManager              = userMylistManager;
            HohoemaPlaylist                = hohoemaPlaylist;
            PageManager                    = pageManager;
            _mylistRepository              = mylistRepository;
            ExternalAccessService          = externalAccessService;
            FollowToggleButtonService      = followToggleButtonService;
            CreateSubscriptionGroupCommand = createSubscriptionGroupCommand;
            ApplicationLayoutManager       = applicationLayoutManager;
            UserProvider                   = userProvider;
            NgSettings = ngSettings;

            HasOwnerVideo = true;

            VideoInfoItems = new ObservableCollection <VideoInfoControlViewModel>();

            OpenUserVideoPageCommand = VideoInfoItems.ObserveProperty(x => x.Count)
                                       .Select(x => x > 0)
                                       .ToReactiveCommand()
                                       .AddTo(_CompositeDisposable);

            OpenUserVideoPageCommand.Subscribe(x =>
            {
                PageManager.OpenPageWithId(HohoemaPageType.UserVideo, UserId);
            })
            .AddTo(_CompositeDisposable);

            IsNGVideoOwner = new ReactiveProperty <bool>(false, ReactivePropertyMode.DistinctUntilChanged);

            IsNGVideoOwner.Subscribe(isNgVideoOwner =>
            {
                if (isNgVideoOwner)
                {
                    NgSettings.AddNGVideoOwnerId(UserId, UserName);
                    IsNGVideoOwner.Value = true;
                    Debug.WriteLine(UserName + "をNG動画投稿者として登録しました。");
                }
                else
                {
                    NgSettings.RemoveNGVideoOwnerId(UserId);
                    IsNGVideoOwner.Value = false;
                    Debug.WriteLine(UserName + "をNG動画投稿者の指定を解除しました。");
                }
            });
        }