예제 #1
0
        private void OpenNode(TreeNodeAdv dropNode)
        {
            if (dropNode == null || dropNode.Tag is ProjectFolder || !projViewer.SelectedNodes.Contains(dropNode))
            {
                return;
            }

            ProjectFile file = dropNode.Tag as ProjectFile;

            Debug.Assert(file != null, "file != null");

            FilePath filePath = file.FileFullPath;

            if (File.Exists(filePath))
            {
                AbstractUiAction.RunCommand(new OpenFileAction(filePath));
            }
            else
            {
                if (MessageBox.Show("File no longer exists, would you like to remove from project?",
                                    "File Not Found", MessageBoxButtons.YesNo) != DialogResult.Yes)
                {
                    return;
                }

                ProjectFolder folder = file.Folder;
                folder.DeleteFile(file);
                _model.OnNodesChanged(folder);
            }
        }
예제 #2
0
        public void DeleteFile(ProjectFolder parentDir, ProjectFile file)
        {
            RemoveParseData(file.FileFullPath);
            parentDir.DeleteFile(file);

            if (ProjectFileRemoved != null)
            {
                ProjectFileRemoved(this, EventArgs.Empty);
            }
        }