Ejemplo n.º 1
0
 private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     if (e.Node.Nodes[0].Text == "")
     {
         var response = HTTPRequestHelper.PostUrl(txtServerUrl.Text + "?command=dir&path=" + e.Node.FullPath);
         var list     = JasonToObject(response);
         e.Node.Nodes[0].Remove();
         AddNodes(e.Node, list);
     }
 }
Ejemplo n.º 2
0
        private void btnGetRooTFiles_Click(object sender, EventArgs e)
        {
            var response = HTTPRequestHelper.PostUrl(txtServerUrl.Text + "?command=dir");
            var list     = JasonToObject(response);


            treeView1.Nodes.Clear();
            string parentDir = Path.GetDirectoryName(list[0].FileName);
            var    pNode     = treeView1.Nodes.Add(parentDir, parentDir);

            AddNodes(pNode, list);
        }
Ejemplo n.º 3
0
        private void btnDeleteFile_Click(object sender, EventArgs e)
        {
            selectedNodes = new List <TreeNode>();
            CallNodesSelector();
            string result  = "";
            bool   carryOn = false;

            foreach (var node in selectedNodes)
            {
                Application.DoEvents();

                if (result != "Yes To All")
                {
                    CutsomMessage customMsg = new CutsomMessage();
                    customMsg.msg = node.FullPath;
                    customMsg.ShowDialog();
                    result = customMsg.result;
                    customMsg.Dispose();
                    if (result == "Yes To All" || result == "Yes")
                    {
                        carryOn = true;
                    }
                    if (result == "No")
                    {
                        carryOn = false;
                    }

                    if (result == "Cancel")
                    {
                        return;
                    }
                }
                if (carryOn)
                {
                    var response = HTTPRequestHelper.PostUrl(txtServerUrl.Text + "?command=delete&path=" + node.FullPath);
                    if (response == "done")
                    {
                        node.Remove();
                    }
                    else
                    {
                        MessageBox.Show(response);
                    }
                }
            }
        }