Example #1
0
        private void IFSBrowser_Load(object sender, EventArgs e)
        {
            Boolean  exists;
            TreeNode node;

            if (IBMi.IsConnected())
            {
                new Thread((ThreadStart) delegate
                {
                    exists = IBMi.DirExists(RootDirectory);
                    this.Invoke((MethodInvoker) delegate
                    {
                        if (exists)
                        {
                            node                    = new TreeNode(RootDirectory, new[] { new TreeNode("Loading..", 2, 2) });
                            node.Tag                = RootDirectory;
                            node.ImageIndex         = 0;
                            node.SelectedImageIndex = 0;
                            files.Nodes.Add(node);
                        }
                        else
                        {
                            files.Nodes.Add(new TreeNode("Home directory (" + RootDirectory + ") does not exist.", 3, 3));
                        }
                    });
                }).Start();
            }
            else
            {
                files.Nodes.Add(new TreeNode("IFS Browsing only works when connected to the remote system.", 3, 3));
            }
        }
Example #2
0
        public void Reload()
        {
            Boolean       exists;
            TreeNode      node;
            List <string> DirList = new List <string>();

            files.Nodes.Clear();
            if (IBMi.IsConnected())
            {
                new Thread((ThreadStart) delegate
                {
                    DirList.Add(IBMi.CurrentSystem.GetValue("homeDir"));
                    foreach (string dir in IBMi.CurrentSystem.GetValue("IFS_LINKS").Split('|'))
                    {
                        if (dir.Trim() != "")
                        {
                            DirList.Add(dir);
                        }
                    }

                    foreach (string dir in DirList)
                    {
                        if (dir.Trim() != "")
                        {
                            if (dir.Trim() == "")
                            {
                                continue;
                            }

                            exists = IBMi.DirExists(dir);
                            this.Invoke((MethodInvoker) delegate
                            {
                                if (exists)
                                {
                                    node                    = new TreeNode(dir, new[] { new TreeNode("Loading..", 2, 2) });
                                    node.Tag                = dir;
                                    node.ImageIndex         = 0;
                                    node.SelectedImageIndex = 0;
                                    files.Nodes.Add(node);
                                }
                                else
                                {
                                    files.Nodes.Add(new TreeNode("Directory '" + dir + "' was not located.", 3, 3));
                                }
                            });
                        }
                    }
                }).Start();
            }
            else
            {
                files.Nodes.Add(new TreeNode("IFS Browsing only works when connected to the remote system.", 3, 3));
            }
        }
Example #3
0
 private void open_Click(object sender, EventArgs e)
 {
     if (path.Text == "")
     {
         MessageBox.Show("Path cannot be blank");
     }
     else
     {
         if (!IBMi.DirExists(path.Text))
         {
             IBMi.CreateDirecory(path.Text);
             this.Close();
         }
         else
         {
             MessageBox.Show("Chosen path already exists.");
         }
     }
 }
Example #4
0
        private void IFSBrowser_Load(object sender, EventArgs e)
        {
            Boolean  exists;
            TreeNode node;

            if (IBMi.IsConnected())
            {
                new Thread((ThreadStart) delegate
                {
                    foreach (string dir in DirList)
                    {
                        if (dir.Trim() == "")
                        {
                            continue;
                        }

                        exists = IBMi.DirExists(dir);
                        this.Invoke((MethodInvoker) delegate
                        {
                            if (exists)
                            {
                                node                    = new TreeNode(dir, new[] { new TreeNode("Loading..", 2, 2) });
                                node.Tag                = dir;
                                node.ImageIndex         = 0;
                                node.SelectedImageIndex = 0;
                                files.Nodes.Add(node);
                            }
                            else
                            {
                                files.Nodes.Add(new TreeNode("Directory '" + dir + "' was not located.", 3, 3));
                            }
                        });
                    }
                }).Start();
            }
            else
            {
                files.Nodes.Add(new TreeNode("IFS Browsing only works when connected to the remote system.", 3, 3));
            }
        }