Пример #1
0
        protected override async void Execute(object parameter)
        {
            var hohoemaApp = HohoemaCommnadHelper.GetHohoemaApp();
            var playlist   = hohoemaApp.Playlist;

            var dialogService = App.Current.Container.Resolve <Services.HohoemaDialogService>();
            var data          = new Dialogs.MylistGroupEditData()
            {
            };
            var result = await dialogService.GetTextAsync("新しいローカルマイリストを作成", "ローカルマイリスト名", "", (s) => !string.IsNullOrWhiteSpace(s));

            if (result != null)
            {
                var newMylist = playlist.CreatePlaylist(Guid.NewGuid().ToString(), result);

                Debug.WriteLine("ローカルマイリスト作成:" + newMylist.Label);

                if (parameter is Interfaces.IVideoContent || parameter is string)
                {
                    if (newMylist.AddItemCommand?.CanExecute(parameter) ?? false)
                    {
                        newMylist.AddItemCommand.Execute(parameter);
                    }
                }
            }
        }
Пример #2
0
        protected override async void Execute(object parameter)
        {
            var data = new Dialogs.MylistGroupEditData()
            {
            };
            var result = await DialogService.ShowCreateMylistGroupDialogAsync(data);

            if (result)
            {
                var mylistCreateResult = await UserMylistManager.AddMylist(data.Name, data.Description, data.IsPublic, data.MylistDefaultSort, data.IconType);

                Debug.WriteLine("マイリスト作成:" + mylistCreateResult);
            }

            var mylist = UserMylistManager.Mylists.FirstOrDefault(x => x.Label == data.Name);

            if (mylist == null)
            {
                return;
            }

            if (parameter is Interfaces.IVideoContent content)
            {
                await mylist.AddItem(content.Id);
            }
            else if (parameter is string videoId)
            {
                await mylist.AddItem(videoId);
            }
        }
Пример #3
0
        protected override async void Execute(object parameter)
        {
            var hohoemaApp    = HohoemaCommnadHelper.GetHohoemaApp();
            var mylistManager = hohoemaApp.UserMylistManager;

            var dialogService = App.Current.Container.Resolve <Services.HohoemaDialogService>();
            var data          = new Dialogs.MylistGroupEditData()
            {
            };
            var result = await dialogService.ShowCreateMylistGroupDialogAsync(data);

            if (result)
            {
                var mylistCreateResult = await mylistManager.AddMylist(data.Name, data.Description, data.IsPublic, data.MylistDefaultSort, data.IconType);

                Debug.WriteLine("マイリスト作成:" + mylistCreateResult);
            }

            if (parameter is Interfaces.IVideoContent || parameter is string)
            {
                var mylist = mylistManager.UserMylists.FirstOrDefault(x => x.Label == data.Name);
                if (mylist.AddItemCommand?.CanExecute(parameter) ?? false)
                {
                    mylist.AddItemCommand.Execute(parameter);
                }
            }
        }
Пример #4
0
        protected override async void Execute(object parameter)
        {
            var currentMethod = System.Reflection.MethodBase.GetCurrentMethod();
            //Microsoft.AppCenter.Analytics.Analytics.TrackEvent($"{currentMethod.DeclaringType.Name}#{currentMethod.Name}");

            var data = new Dialogs.MylistGroupEditData()
            {
            };
            var result = await DialogService.ShowCreateMylistGroupDialogAsync(data);

            if (result)
            {
                var mylist = await UserMylistManager.AddMylist(data.Name, data.Description, data.IsPublic, data.DefaultSortKey, data.DefaultSortOrder);

                if (mylist == null)
                {
                    return;
                }

                if (parameter is IVideoContent content)
                {
                    await mylist.AddItem(content);
                }
                else if (parameter is IEnumerable <IVideoContent> items)
                {
                    await mylist.AddItem(items);
                }
            }
        }
        public async Task <ContentManageResult> UpdateMylist(string myylistId, Dialogs.MylistGroupEditData editData)
        {
            if (myylistId == "0")
            {
                throw new Exception();
            }

            return(await ContextActionAsync(async context =>
            {
                return await context.User.UpdateMylistGroupAsync(
                    myylistId,
                    editData.Name,
                    editData.Description,
                    editData.IsPublic,
                    editData.MylistDefaultSort,
                    editData.IconType
                    );
            }));
        }
        protected override async void Execute(object parameter)
        {
            var data = new Dialogs.MylistGroupEditData()
            {
            };
            var result = await DialogService.GetTextAsync("新しいローカルマイリストを作成", "ローカルマイリスト名", "", (s) => !string.IsNullOrWhiteSpace(s));

            if (result != null)
            {
                var localMylist = new Models.LocalMylist.LocalMylistGroup(Guid.NewGuid().ToString(), result);
                LocalMylistManager.Mylists.Add(localMylist);

                Debug.WriteLine("ローカルマイリスト作成:" + result);

                if (parameter is Interfaces.IVideoContent content)
                {
                    await localMylist.AddMylistItem(content.Id);
                }
                else if (parameter is string itemId)
                {
                    await localMylist.AddMylistItem(itemId);
                }
            }
        }
Пример #7
0
 public Task <ContentManageResult> UpdateMylist(Dialogs.MylistGroupEditData editData)
 {
     return(_loginUserMylistProvider.UpdateMylist(Id, editData));
 }