Exemplo n.º 1
0
 public ChoiceSubscriptionSourceCommand(
     FollowManager followManager,
     DialogService dialogService)
 {
     FollowManager = followManager;
     DialogService = dialogService;
 }
Exemplo n.º 2
0
        public ActionResult Del_Follow(int cid)
        {
            int           uid = Convert.ToInt32(Session["User_id"].ToString());
            FollowManager fm  = new FollowManager();

            fm.Del_Follow(cid, uid);
            return(RedirectToAction("Follow_List"));
        }
Exemplo n.º 3
0
 private void Start()
 {
     moveable         = false;
     animator         = gameObject.GetComponent <Animator>();
     followManager    = gameObject.GetComponent <FollowManager>();
     collisionCounter = damageCounter = 0;
     stop             = false;
 }
Exemplo n.º 4
0
        public ActionResult Follow_List()
        {
            int           uid = Convert.ToInt32(Session["User_id"].ToString());
            FollowManager fm  = new FollowManager();
            var           da  = fm.FindByuid(uid);

            return(PartialView(da));
        }
Exemplo n.º 5
0
        public FavoriteItemViewModel(FollowItemInfo feedList, FollowManager followMan, PageManager pageManager)
        {
            Title    = feedList.Name;
            ItemType = feedList.FollowItemType;
            SourceId = feedList.Id;

            _PageManager   = pageManager;
            _FollowManager = followMan;
        }
Exemplo n.º 6
0
        public ActionResult Del_Follow1(int Comic_id)
        {
            int           User_id = Convert.ToInt32(Session["User_id"].ToString());
            FollowManager fm      = new FollowManager();

            fm.Del_Follow(Comic_id, User_id);
            var          da = Session["User_name"].ToString();
            Comic_detail cd = new Comic_detail(Comic_id, da, 1);

            return(PartialView("Add_Follow", cd));
        }
Exemplo n.º 7
0
        public FavoriteListViewModel(string label, IFollowInfoGroup followGroup, FollowManager followMan, PageManager pageManager)
        {
            Label         = label;
            FollowGroup   = followGroup;
            FollowManager = followMan;
            PageManager   = pageManager;
            IsSyncFailed  = FollowGroup.IsFailedUpdate;

            Items = followGroup.FollowInfoItems?
                    .ToReadOnlyReactiveCollection(x => ItemVMFactory(x))
                    ?? new ReadOnlyObservableCollection <FavoriteItemViewModel>(new ObservableCollection <FavoriteItemViewModel>());
            ItemCount = Items?.ObserveProperty(x => x.Count).ToReadOnlyReactiveProperty()
                        ?? new ReactiveProperty <int>(0).ToReadOnlyReactiveProperty();
        }
Exemplo n.º 8
0
 public CommunityPageViewModel(Services.PageManager pageManager,
                               NiconicoSession niconicoSession,
                               CommunityFollowProvider followProvider,
                               CommunityProvider communityProvider,
                               FollowManager followManager,
                               NiconicoFollowToggleButtonService followToggleButtonService
                               )
     : base(pageManager)
 {
     NiconicoSession           = niconicoSession;
     FollowProvider            = followProvider;
     CommunityProvider         = communityProvider;
     FollowToggleButtonService = followToggleButtonService;
 }
        internal void SetFollowTarget(IFollowable followTarget)
        {
            _nowProcessFollow.Value = true;

            try
            {
                _followTarget.Value   = followTarget;
                _isFollowTarget.Value = FollowManager.IsFollowItem(followTarget);
            }
            finally
            {
                _nowProcessFollow.Value = false;
            }
        }
Exemplo n.º 10
0
    //跟随玩家
    public void FollowPlayer(GameObject follower, float distanceAway, float distanceUp, float speed)
    {
        FollowManager followManager = follower.GetComponent <FollowManager>();

        if (followManager == null)
        {
            return;
        }
        if (!followManager.followable)
        {
            followManager.followable = true;
            follow = FollowPlayerAction.GetSSAction(distanceAway, distanceUp, speed);
            RunAction(follower, follow, this);
        }
    }
Exemplo n.º 11
0
    protected void BTNoff_Click(object sender, EventArgs e)
    {
        LinkButton follow_id = (LinkButton)sender;
        Follow     fw        = new Follow();

        fw.accountId = new Guid(follow_id.CommandArgument);
        Guid fan_id;

        fan_id   = new Guid(Request.Cookies["account_id"].Value);
        fw.fanId = fan_id;
        FollowManager fm = new FollowManager();

        if (fm.Delete(fw))
        {
            Response.Redirect("Followlist.aspx");
        }
    }
Exemplo n.º 12
0
 public CommunityPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     AppearanceSettings appearanceSettings,
     Services.PageManager pageManager,
     NiconicoSession niconicoSession,
     CommunityFollowProvider followProvider,
     CommunityProvider communityProvider,
     FollowManager followManager,
     NiconicoFollowToggleButtonService followToggleButtonService
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     _appearanceSettings      = appearanceSettings;
     PageManager               = pageManager;
     NiconicoSession           = niconicoSession;
     FollowProvider            = followProvider;
     CommunityProvider         = communityProvider;
     FollowToggleButtonService = followToggleButtonService;
 }
Exemplo n.º 13
0
        public FollowManagePageViewModel(
            PageManager pageManager,
            NiconicoSession niconicoSession,
            FollowManager followManager
            )
            : base(pageManager)
        {
            NiconicoSession = niconicoSession;
            FollowManager   = followManager;

            Lists = new ObservableCollection <FavoriteListViewModel>();

            NowUpdatingFavList = new ReactiveProperty <bool>();

            UpdateFavListCommand = new DelegateCommand <FavoriteListViewModel>((favListVM) =>
            {
                NowUpdatingFavList.Value = true;
                try
                {
                    favListVM.FollowGroup.SyncFollowItems().ConfigureAwait(false);
                }
                catch
                {
                    Debug.WriteLine($"{favListVM.FollowGroup.FollowItemType} のFollow List更新に失敗");
                }
                finally
                {
                    NowUpdatingFavList.Value = false;
                }
            });


            if (NiconicoSession.IsLoggedIn)
            {
                Lists.Add(new FavoriteListViewModel("ユーザー", FollowManager.User, FollowManager, PageManager));
                Lists.Add(new FavoriteListViewModel("マイリスト", FollowManager.Mylist, FollowManager, PageManager));
                Lists.Add(new FavoriteListViewModel("タグ", FollowManager.Tag, FollowManager, PageManager));
                Lists.Add(new FavoriteListViewModel("コミュニティ", FollowManager.Community, FollowManager, PageManager));
                Lists.Add(new FavoriteListViewModel("チャンネル", FollowManager.Channel, FollowManager, PageManager));
            }
        }
        public FollowManagePageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            NiconicoSession niconicoSession,
            FollowManager followManager
            )
        {
            ApplicationLayoutManager = applicationLayoutManager;
            PageManager     = pageManager;
            NiconicoSession = niconicoSession;
            FollowManager   = followManager;

            NowUpdatingFavList = new ReactiveProperty <bool>();

            UpdateFavListCommand = new DelegateCommand <IFollowInfoGroup>(async(group) =>
            {
                NowUpdatingFavList.Value = true;
                try
                {
                    await FollowManager.SyncAll();
                }
                catch
                {
                    Debug.WriteLine($"{group.FollowItemType} のFollow List更新に失敗");
                }
                finally
                {
                    NowUpdatingFavList.Value = false;
                }
            });


            FollowGroups = new ObservableCollection <IFollowInfoGroup>()
            {
                FollowManager.User,
                FollowManager.Mylist,
                FollowManager.Tag,
                FollowManager.Community,
                FollowManager.Channel,
            };
        }
        private async Task <bool> ConfirmRemovingFollow()
        {
            var followTarget = FollowTarget.Value;

            // Note: IsFollowTargetを使うと意図した動作にならない
            // これはToggleButtonにTwoWayバインディングを適用してないとチェック状態をVM側から書き戻せない動作に対するものだが
            // その影響でここに来る段階で IsFollowTarget.Value が false になってしまう
            // この問題を回避するため、FollowManagerによるフォロー済みチェックを行う形を取っている
            // if (!IsFollowTarget.Value) { return false; }

            if (!FollowManager.IsFollowItem(followTarget))
            {
                return(false);
            }

            return(await DialogService.ShowMessageDialog(
                       "",
                       "ConfirmRemoveFollow_DialogTitle".Translate(),
                       "RemoveFollow".Translate(),
                       "Cancel".Translate()
                       ));
        }
        private async Task <bool> ConfirmRemovingFollow()
        {
            var followTarget = FollowTarget.Value;

            // Note: IsFollowTargetを使うと意図した動作にならない
            // これはToggleButtonにTwoWayバインディングを適用してないとチェック状態をVM側から書き戻せない動作に対するものだが
            // その影響でここに来る段階で IsFollowTarget.Value が false になってしまう
            // この問題を回避するため、FollowManagerによるフォロー済みチェックを行う形を取っている
            // if (!IsFollowTarget.Value) { return false; }

            if (!FollowManager.IsFollowItem(followTarget))
            {
                return(false);
            }

            return(await DialogService.ShowMessageDialog(
                       "",
                       $"『{followTarget.Label}』のフォローを解除してもいいですか? ",
                       "フォロー解除",
                       "キャンセル"
                       ));
        }
        public ActionResult RequestFollow(int following_id)
        {
            FollowManager fm = new FollowManager();
            Follow        f  = new Follow()
            {
                Following = following_id,
                Follower  = (Session["user"] as User).Id,
            };

            fm.Insert(f);
            Notification not = new Notification()
            {
                Comment   = "",
                Date      = DateTime.Now,
                FromWho   = (Session["user"] as User).Id,
                ToWho     = following_id,
                Type      = 2,
                projectid = -1,
            };

            nm.Insert(not);
            return(View());
        }
Exemplo n.º 18
0
        public void MessageProcess(Event item, ReceievedMessage receivedMessage)
        {
            try
            {
                switch (item.type)
                {
                case "postback":

                    PostbackManager postbackManager = new PostbackManager();
                    postbackManager.Process(item, receivedMessage, ChannelAccessToken);
                    break;

                case "join":

                    break;

                case "message":

                    MessageManager messageManager = new MessageManager();
                    messageManager.Process(item, receivedMessage, ChannelAccessToken, bot);

                    break;


                case "follow":
                    FollowManager followManager = new FollowManager();
                    followManager.process(item, receivedMessage, ChannelAccessToken, bot);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
            }
        }
        public NotificationFollowUpdatedService(
            FollowManager followManager,
            NotificationService notificationService
            )
        {
            FollowManager       = followManager;
            NotificationService = notificationService;

            disposer = new[]
            {
                FollowManager.Mylist.FollowInfoItems.CollectionChangedAsObservable(),
                    FollowManager.User.FollowInfoItems.CollectionChangedAsObservable(),
                    FollowManager.Tag.FollowInfoItems.CollectionChangedAsObservable(),
                    FollowManager.Community.FollowInfoItems.CollectionChangedAsObservable(),
                    FollowManager.Channel.FollowInfoItems.CollectionChangedAsObservable(),
            }
            .Merge()
            .Subscribe(e =>
            {
                if (!FollowManager.IsLoginUserFollowsReady)
                {
                    return;
                }

                switch (e.Action)
                {
                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
                    {
                        var newItem = e.NewItems.Cast <FollowItemInfo>().FirstOrDefault();
                        if (newItem != null)
                        {
                            NotificationService.ShowInAppNotification(new InAppNotificationPayload()
                            {
                                Content        = $"「{newItem.Name}」をフォローしました"
                                , ShowDuration = TimeSpan.FromSeconds(4)
                            });
                        }
                    }
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
                    {
                        var item = e.OldItems.Cast <FollowItemInfo>().FirstOrDefault();
                        if (item != null)
                        {
                            NotificationService.ShowInAppNotification(new InAppNotificationPayload()
                            {
                                Content        = $"「{item.Name}」のフォローを解除しました"
                                , ShowDuration = TimeSpan.FromSeconds(4)
                            });
                        }
                    }
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
                    break;

                default:
                    break;
                }
            });
        }
        public NiconicoFollowToggleButtonService(
            IScheduler scheduler,
            FollowManager followManager,
            DialogService dialogService
            )
        {
            FollowManager = followManager;
            DialogService = dialogService;

            _followTarget     = new ReactiveProperty <IFollowable>(scheduler, null).AddTo(disposables);
            _nowProcessFollow = new ReactiveProperty <bool>(scheduler, false).AddTo(disposables);
            _isFollowTarget   = new ReactiveProperty <bool>(scheduler, false).AddTo(disposables);

            CanToggleFollow =
                new []
            {
                _followTarget.ToUnit(),
                    _isFollowTarget.ToUnit()
            }
            .CombineLatest()
            .Select(_ =>
            {
                var isFollow = _isFollowTarget.Value;
                if (_followTarget.Value == null)
                {
                    return(false);
                }

                return(isFollow
                    ? true
                    : FollowManager.CanMoreAddFollow(_followTarget.Value)
                       );
            })
            .ToReadOnlyReactiveProperty(eventScheduler: scheduler)
            .AddTo(disposables);

            ToggleFollowCommand =
                new[]
            {
                _nowProcessFollow.Select(x => !x),
                CanToggleFollow
            }
            .CombineLatestValuesAreAllTrue()
            .ToAsyncReactiveCommand()
            .AddTo(disposables);

            ToggleFollowCommand.Subscribe(async() =>
            {
                _nowProcessFollow.Value = true;

                try
                {
                    var followTarget = _followTarget.Value;
                    if (FollowManager.IsFollowItem(followTarget))
                    {
                        if (await ConfirmRemovingFollow())
                        {
                            var result = await FollowManager.RemoveFollow(followTarget);
                        }
                    }
                    else if (FollowManager.CanMoreAddFollow(followTarget))
                    {
                        await FollowManager.AddFollow(followTarget);
                    }

                    _isFollowTarget.Value = FollowManager.IsFollowItem(FollowTarget.Value);
                }
                finally
                {
                    _nowProcessFollow.Value = false;
                }

                // トグルボタンの押したらとりあえず切り替わる仕様に対応するためのコード
                // 現在のフォロー状態に応じたトグル状態を確実化する
                await Task.Delay(500);

                RaisePropertyChanged(nameof(IsFollowTarget));
            })
            .AddTo(disposables);
        }
Exemplo n.º 21
0
        protected override async void Execute(object parameter)
        {
            if (parameter is Models.Subscription.Subscription subscription)
            {
                // フォローしているアイテムから選択できるように
                // (コミュニティを除く)
                var selectableContents = FollowManager.GetAllFollowInfoGroups()
                                         .Select(x => new ChoiceFromListSelectableContainer(x.FollowItemType.Translate(),
                                                                                            x.FollowInfoItems.Where(y => y.FollowItemType != Models.FollowItemType.Community).Select(y => new SelectDialogPayload()
                {
                    Label   = y.Name,
                    Id      = y.Id,
                    Context = y
                })));

                var keywordInput = new TextInputSelectableContainer("キーワード検索", null);

                var result = await DialogService.ShowContentSelectDialogAsync(
                    $"『{subscription.Label}』へ購読を追加",
                    Enumerable.Concat <ISelectableContainer>(new[] { keywordInput }, selectableContents)
                    );

                if (result != null)
                {
                    Models.Subscription.SubscriptionSource?source = null;
                    if (result.Context is Models.FollowItemInfo followInfo)
                    {
                        Models.Subscription.SubscriptionSourceType?sourceType = null;
                        switch (followInfo.FollowItemType)
                        {
                        case Models.FollowItemType.Tag:
                            sourceType = Models.Subscription.SubscriptionSourceType.TagSearch;
                            break;

                        case Models.FollowItemType.Mylist:
                            sourceType = Models.Subscription.SubscriptionSourceType.Mylist;
                            break;

                        case Models.FollowItemType.User:
                            sourceType = Models.Subscription.SubscriptionSourceType.User;
                            break;

                        case Models.FollowItemType.Community:
                            break;

                        case Models.FollowItemType.Channel:
                            sourceType = Models.Subscription.SubscriptionSourceType.Channel;
                            break;

                        default:
                            break;
                        }

                        if (sourceType != null)
                        {
                            source = new Models.Subscription.SubscriptionSource(result.Label, sourceType.Value, result.Id);
                        }
                    }
                    else
                    {
                        source = new Models.Subscription.SubscriptionSource(result.Label, Models.Subscription.SubscriptionSourceType.KeywordSearch, result.Id);
                    }

                    if (subscription.AddSource.CanExecute(source))
                    {
                        subscription.AddSource.Execute(source);
                    }
                }
            }
        }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == GameTags.Player.ToString() && FollowTarget == null)
        {
            switch (MyType)
            {
            case CollectibleType.GENERICKEY:
            case CollectibleType.SPECIALKEY:
                //This is commanding the Collectible To start its pickup animation and put itself relative to the parent... Subject to change
                #region Old

                /*
                 * if (GetComponent<AnimController>() != null)
                 * {
                 *  transform.parent.parent = collision.transform;
                 *  transform.parent.localPosition = new Vector2(0, 0.5f);
                 *  GetComponent<AnimController>().ForceTrigger(AnimTriggers.EXMovement);
                 * }
                 * //Then since you're a key, Toggle the Portal to turn on.
                 * if (Portal != null)Portal.ToggleOn();
                 * else { Debug.LogWarning("This Key does not have a portal to target"); }
                 * //Destruction is handled with the end of the animation.
                 * //Destroy(this.gameObject);
                 */
                #endregion

                //So if the player collides with
                #region Tell the item what it's supposed to be following
                //FollowTarget = collision.gameObject;
                //collision.GetComponent<FollowManager>().AddObject(this.gameObject);
                //followDistance = collision.GetComponent<FollowManager>().GetFollowDistance(this.gameObject);
                FollMan = collision.GetComponent <FollowManager>();
                FollMan.AddObject(this.gameObject);
                #endregion
                break;

            case CollectibleType.TEMPSHOT:
                AbilitySlot = Mathf.Clamp(AbilitySlot, 0, 2);
                AuxNumber   = Mathf.Clamp(AuxNumber, 0, 200);
                collision.GetComponent <ActionInput>().SetTempAbility(AbilitySlot, MyAbility, AuxNumber);
                break;

            case CollectibleType.SHOTOVERRIDE:
                AbilitySlot = Mathf.Clamp(AbilitySlot, 0, 2);
                AuxNumber   = Mathf.Clamp(AuxNumber, 0, 200);
                collision.GetComponent <ActionInput>().OverrideBaseShot(AbilitySlot, MyAbility, AuxNumber);
                break;

            case CollectibleType.POWERUP:
                break;

            case CollectibleType.COLLECTIBLE:
                //So if it's a collectible it needs to talk to the Game Manager and tell it to update the current stage.
                break;

            default:
                Debug.Log("What the heck?");
                break;
            }
        }

        else if (FoundLock && collision.GetComponent <ToggleButton>())
        {
            ToggleButton Butt = FollowTarget.GetComponent <ToggleButton>();
            if (Butt.GetButtonType() == ButtonType.GenericLocked &&
                MyType == CollectibleType.GENERICKEY)
            {
                Debug.Log("I've found a generic Lock");
                Butt.Activate();
                this.gameObject.SetActive(false);
                FollMan.RemoveObject(this.gameObject);
            }
            else if (Butt.GetButtonType() == ButtonType.SpecialLocked &&
                     MyType == CollectibleType.SPECIALKEY &&
                     TargetToToggle.gameObject == Butt.gameObject)
            {
                Debug.Log("I've found a Special Lock");
                Butt.Activate();
                this.gameObject.SetActive(false);
                FollMan.RemoveObject(this.gameObject);
                //Debug.Log("I've Found the specialized Lock");
            }
        }
    }
Exemplo n.º 23
0
 public FavoriteListViewModel(FollowManager followMan)
 {
     FollowManager = followMan;
 }
Exemplo n.º 24
0
        public MylistPageViewModel(
            Services.PageManager pageManager,
            NiconicoSession niconicoSession,
            MylistProvider mylistProvider,
            UserProvider userProvider,
            FollowManager followManager,
            LoginUserMylistProvider loginUserMylistProvider,
            NGSettings ngSettings,
            UserMylistManager userMylistManager,
            LocalMylistManager localMylistManager,
            Services.HohoemaPlaylist hohoemaPlaylist,
            SubscriptionManager subscriptionManager,
            Services.DialogService dialogService,
            NiconicoFollowToggleButtonService followToggleButtonService,
            Services.Helpers.MylistHelper mylistHelper,
            Commands.Subscriptions.CreateSubscriptionGroupCommand createSubscriptionGroupCommand
            )
            : base(pageManager)
        {
            NiconicoSession         = niconicoSession;
            MylistProvider          = mylistProvider;
            UserProvider            = userProvider;
            FollowManager           = followManager;
            LoginUserMylistProvider = loginUserMylistProvider;
            NgSettings                     = ngSettings;
            UserMylistManager              = userMylistManager;
            LocalMylistManager             = localMylistManager;
            HohoemaPlaylist                = hohoemaPlaylist;
            SubscriptionManager            = subscriptionManager;
            DialogService                  = dialogService;
            FollowToggleButtonService      = followToggleButtonService;
            MylistHelper                   = mylistHelper;
            CreateSubscriptionGroupCommand = createSubscriptionGroupCommand;
            Mylist       = new ReactiveProperty <Interfaces.IMylist>();
            MylistOrigin = new ReactiveProperty <Services.PlaylistOrigin>();

            /*
             * IsFavoriteMylist = new ReactiveProperty<bool>(mode: ReactivePropertyMode.DistinctUntilChanged)
             *  .AddTo(_CompositeDisposable);
             * CanChangeFavoriteMylistState = new ReactiveProperty<bool>()
             *  .AddTo(_CompositeDisposable);
             *
             *
             * IsFavoriteMylist
             *  .Where(x => PlayableList.Value.Id != null)
             *  .Subscribe(async x =>
             *  {
             *      if (PlayableList.Value.Origin != PlaylistOrigin.OtherUser) { return; }
             *
             *      if (_NowProcessFavorite) { return; }
             *
             *      _NowProcessFavorite = true;
             *
             *      CanChangeFavoriteMylistState.Value = false;
             *      if (x)
             *      {
             *          if (await FavoriteMylist())
             *          {
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り登録しました.");
             *          }
             *          else
             *          {
             *              // お気に入り登録に失敗した場合は状態を差し戻し
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り登録に失敗");
             *              IsFavoriteMylist.Value = false;
             *          }
             *      }
             *      else
             *      {
             *          if (await UnfavoriteMylist())
             *          {
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り解除しました.");
             *          }
             *          else
             *          {
             *              // お気に入り解除に失敗した場合は状態を差し戻し
             *              Debug.WriteLine(_MylistTitle + "のマイリストをお気に入り解除に失敗");
             *              IsFavoriteMylist.Value = true;
             *          }
             *      }
             *
             *      CanChangeFavoriteMylistState.Value =
             *          IsFavoriteMylist.Value == true
             || FollowManager.CanMoreAddFollow(FollowItemType.Mylist);
             ||
             ||
             ||     _NowProcessFavorite = false;
             || })
             || .AddTo(_CompositeDisposable);
             ||
             ||
             ||UnregistrationMylistCommand = SelectedItems.ObserveProperty(x => x.Count)
             || .Where(_ => IsUserOwnerdMylist)
             || .Select(x => x > 0)
             || .ToReactiveCommand(false);
             ||
             ||UnregistrationMylistCommand.Subscribe(async _ =>
             ||{
             || if (PlayableList.Value.Origin == PlaylistOrigin.Local)
             || {
             ||     var localMylist = PlayableList.Value as LegacyLocalMylist;
             ||     var items = SelectedItems.ToArray();
             ||
             ||     foreach (var item in items)
             ||     {
             ||         localMylist.Remove(item.PlaylistItem);
             ||         IncrementalLoadingItems.Remove(item);
             ||     }
             || }
             || else if (PlayableList.Value.Origin == PlaylistOrigin.LoginUser)
             || {
             ||     var mylistGroup = HohoemaApp.UserMylistManager.GetMylistGroup(PlayableList.Value.Id);
             ||
             ||     var items = SelectedItems.ToArray();
             ||
             ||
             ||     var action = AsyncInfo.Run<uint>(async (cancelToken, progress) =>
             ||     {
             ||         uint progressCount = 0;
             ||         int successCount = 0;
             ||         int failedCount = 0;
             ||
             ||         Debug.WriteLine($"マイリストに追加解除を開始...");
             ||         foreach (var video in items)
             ||         {
             ||             var unregistrationResult = await mylistGroup.Unregistration(
             ||                 video.RawVideoId
             ||                 , withRefresh: false );
             ||
             ||             if (unregistrationResult == ContentManageResult.Success)
             ||             {
             ||                 successCount++;
             ||             }
             ||             else
             ||             {
             ||                 failedCount++;
             ||             }
             ||
             ||             progressCount++;
             ||             progress.Report(progressCount);
             ||
             ||             Debug.WriteLine($"{video.Label}[{video.RawVideoId}]:{unregistrationResult.ToString()}");
             ||         }
             ||
             ||         // 登録解除結果を得るためリフレッシュ
             ||         await mylistGroup.Refresh();
             ||
             ||
             ||         // ユーザーに結果を通知
             ||         var titleText = $"「{mylistGroup.Label}」から {successCount}件 の動画が登録解除されました";
             ||         var toastService = App.Current.Container.Resolve<NotificationService>();
             ||         var resultText = $"";
             ||         if (failedCount > 0)
             ||         {
             ||             resultText += $"\n登録解除に失敗した {failedCount}件 は選択されたままです";
             ||         }
             ||         toastService.ShowToast(titleText, resultText);
             ||
             ||         // 登録解除に失敗したアイテムだけを残すように
             ||         // マイリストから除外された動画を選択アイテムリストから削除
             ||         foreach (var item in SelectedItems.ToArray())
             ||         {
             ||             if (false == mylistGroup.CheckRegistratedVideoId(item.RawVideoId))
             ||             {
             ||                 SelectedItems.Remove(item);
             ||                 IncrementalLoadingItems.Remove(item);
             ||             }
             ||         }
             ||
             ||         Debug.WriteLine($"マイリストに追加解除完了---------------");
             ||     });
             ||
             ||     await PageManager.StartNoUIWork("マイリストに追加解除", items.Length, () => action);
             ||
             || }
             ||
             ||
             ||});
             ||
             ||
             */
        }
Exemplo n.º 25
0
 public FollowRemoveCommand(FollowManager followManager, DialogService dialogService)
 {
     _followManager = followManager;
     _dialogService = dialogService;
 }