Ejemplo n.º 1
0
        private void RemoveFile(TreeNode node, bool bDelete = false)
        {
            if (node == null)
            {
                return;
            }

            TreeNode parent = node.Parent;

            if (parent == null || (node.Nodes.Count > 0))
            {
                return;
            }

            string path = ProjectUtils.GetFilePathForTreeNodeItem(node.Parent.Text, node.Text);

            if (ProjectUtils.RemoveFile(node.Text, node.Parent.Text))
            {
                WindowHandler.DeregisterWindow(node.Text, node.Parent.Text);
                parent.Nodes.Remove(node);

                if (bDelete && File.Exists(path))
                {
                    try
                    {
                        File.Delete(path);
                    }
                    catch
                    {
                        LoggingUtils.LogEvent(string.Format("Unable to delete file {0}!", path));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void MenuStripFileOnClose(object sender, EventArgs e)
        {
            TreeNode node = projectTreeView.GetNodeAt(projectTreeView.PointToClient(fileMenuStrip.Bounds.Location));

            if (node == null)
            {
                return;
            }

            if (node.Parent == null || (node.Nodes.Count > 0))
            {
                return;
            }

            WindowHandler.DeregisterWindow(node.Text, node.Parent.Text);
        }
Ejemplo n.º 3
0
 private void menuFileClose_Click(object sender, EventArgs e)
 {
     WindowHandler.DeregisterWindow();
 }