コード例 #1
0
        private void DeleteCommandAction(object obj)
        {
            MovieFolderModel dir = (MovieFolderModel)obj;

            if (MovieFolderList.Contains(dir))
            {
                var removefiledialog = new RemoveItemDialog(dir);
                removefiledialog.ShowDialog();
                if (removefiledialog.DialogResult == true)
                {
                    MovieFolderList.Remove(dir);
                    filehaschange = true;
                    if (!RemovedFolders.Contains(dir))
                    {
                        RemovedFolders.Add(dir);
                    }
                }
            }
        }
コード例 #2
0
        private void AddCommandAction()
        {
            System.Windows.Forms.FolderBrowserDialog folderDialog =
                new System.Windows.Forms.FolderBrowserDialog();
            System.Windows.Forms.DialogResult result = folderDialog.ShowDialog();
            if (result == System.Windows.Forms.DialogResult.OK)
            {
                string           dir            = folderDialog.SelectedPath;
                MovieFolderModel moviePathModel = new MovieFolderModel(dir);
                if (!MovieFolderList.Contains(moviePathModel))
                {
                    filehaschange = true;
                    MovieFolderList.Add(moviePathModel);
                }

                if (RemovedFolders.Contains(moviePathModel))
                {
                    RemovedFolders.Remove(moviePathModel);
                }
            }
        }