コード例 #1
0
        private void CommandBinding_DeleteSeries(object sender, ExecutedRoutedEventArgs e)
        {
            VM_AnimeSeries_User ser = e.Parameter as VM_AnimeSeries_User;

            if (ser == null)
            {
                return;
            }

            Window parentWindow = Window.GetWindow(this);

            try
            {
                DeleteSeriesGroupForm frm = new DeleteSeriesGroupForm();
                frm.Owner = parentWindow;
                bool?result = frm.ShowDialog();

                if (result.HasValue && result.Value == true)
                {
                    //bool deleteFiles = frm.DeleteFiles;

                    Cursor = Cursors.Wait;
                    VM_ShokoServer.Instance.ShokoServices.DeleteAnimeSeries(ser.AnimeSeriesID, frm.DeleteFiles, frm.DeleteGroups);

                    VM_MainListHelper.Instance.RefreshGroupsSeriesData();
                    VM_MainListHelper.Instance.ShowChildWrappers(VM_MainListHelper.Instance.CurrentWrapper);

                    MissingSeriesCollection.Remove(ser);
                    ViewSeries.Refresh();

                    Cursor = Cursors.Arrow;
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
            finally
            {
                Cursor = Cursors.Arrow;
            }
        }