コード例 #1
0
        private void MoveDown(DataFolderViewModel dataFolderViewModel)
        {
            var index = DataFolders.IndexOf(dataFolderViewModel);

            if (index < 0 || index >= DataFolders.Count - 1)
            {
                return;
            }
            DataFolders.RemoveAt(index);
            DataFolders.Insert(index + 1, dataFolderViewModel);
        }
コード例 #2
0
        private void MoveUp(DataFolderViewModel dataFolderViewModel)
        {
            var index = DataFolders.IndexOf(dataFolderViewModel);

            if (index <= 0)
            {
                return;
            }
            DataFolders.RemoveAt(index);
            DataFolders.Insert(index - 1, dataFolderViewModel);
        }
コード例 #3
0
        public void AddFolder()
        {
            var dialog = new CommonOpenFileDialog();

            dialog.IsFolderPicker = true;
            if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
            {
                DataFolders.Insert(0, new DataFolderViewModel(this)
                {
                    Path = dialog.FileName, IsEnabled = true
                });
                UpdateArrowButtons();
            }
        }