Esempio n. 1
0
        private void Panel1Tree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode node = e.Node;
            //MessageBox.Show("Panel1Tree_" + node.FullPath);

            string serverKey = "";

            if (node.FullPath.IndexOf("\\") > -1)
            {
                serverKey = node.FullPath.Split('\\')[1];
            }
            switch (node.Name)
            {
            case "adminUser":
                popupAdminUserDiaglog(serverKey);
                break;

            case "ftpServerList":
                ftpServerHandler(serverKey);
                break;

            case "rootNode":
                Ui_Utility.initAdminServerList(settingList, ftpAdminClient.adminServerList, node.FullPath);
                break;

            default:
                Ui_Utility.updateList(settingList, node);
                break;
            }
        }
Esempio n. 2
0
        private void ftpServerHandler(string serverKey)
        {
            AdminServer adminServer = ftpAdminClient.adminServerList[serverKey];
            SortedDictionary <string, FtpServerInfo> ftpServerList = adminServer.getFTPServerList();

            if (ftpServerList.Count == 0)
            {
                Ui_Utility.initFTPServerList(settingList, serverKey);
            }
        }
Esempio n. 3
0
        private bool isAllInputValid()
        {
            bool result = true;

            List <string> bindingAddressList = new List <string>();

            if (String.IsNullOrEmpty(serverDesc.Text) || (serverDesc.ForeColor == Color.Gray))
            {
                Ui_Utility.popupAlertBox("Please enter the FTP server description.");
                serverDesc.Focus();
                result = false;
            }
            else
            {
                if (!isBindingAddressSelected())
                {
                    Ui_Utility.popupAlertBox("Please select at least one binding address.");
                    ipAddressList.Focus();
                    result = false;
                }
                else
                {
                    controlPortNo = getControlPortNo();
                    if (controlPortNo == -1)
                    {
                        Ui_Utility.popupAlertBox("Please enter an valid control port no.(0-65535).");
                        controlPort.Focus();
                        result = false;
                    }
                    else
                    {
                        if (supportPassiveMode.Text.Equals("Yes"))
                        {
                            if (!Utility.isValidPassiveModePortRange(passiveModePortRange.Text))
                            {
                                result = false;
                                Ui_Utility.popupAlertBox("Please enter an valid TCP port range for passive mode");
                                passiveModePortRange.Focus();
                            }
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 4
0
        private void settingList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (settingList.SelectedItems.Count > 0)
            {
                //MessageBox.Show("settingList_" + settingList.SelectedItems[0].Name);
                ListViewItem listViewItem = settingList.SelectedItems[0];
                TreeNode     node;
                string       serverKey = "";
                if (((SettingListItem)listViewItem).FullPath.IndexOf("\\") > -1)
                {
                    serverKey = ((SettingListItem)listViewItem).FullPath.Split('\\')[1];
                }
                switch (listViewItem.Name)
                {
                case "adminUser":
                    popupAdminUserDiaglog(serverKey);
                    break;

                case "addAdminServer":
                    popupConnectToServerDiaglog();
                    break;

                case "addFTPServer":
                    popupAddFTPServerDialog(((SettingListItem)listViewItem).FullPath);
                    break;

                case "ftpServerList":

                    ftpServerHandler(serverKey);
                    splitContainer.SelectNextControl((Control)splitContainer, true, true, true, true);
                    node = Ui_Utility.searchNodeByPath(rootNode, ((SettingListItem)listViewItem).FullPath);
                    Panel1Tree.SelectedNode = node;
                    node.Expand();
                    break;

                default:
                    node = Ui_Utility.searchNodeByPath(rootNode, ((SettingListItem)listViewItem).FullPath);
                    Ui_Utility.updateList(settingList, node);
                    splitContainer.SelectNextControl((Control)splitContainer, true, true, true, true);
                    Panel1Tree.SelectedNode = node;
                    node.Expand();
                    break;
                }
            }
        }
        private bool isAllInputValid()
        {
            bool isValidate = true;

            adminServerName = serverName.Text.Trim();
            if (String.IsNullOrEmpty(adminServerName))
            {
                Ui_Utility.popupAlertBox("Please enter the admin. server name or IP address.");
                serverName.Focus();
                isValidate = false;
            }
            else
            {
                if (String.IsNullOrEmpty(portNo.Text))
                {
                    Ui_Utility.popupAlertBox("Please enter the admin. server port no. (0-65535).");
                    portNo.Focus();
                    isValidate = false;
                }
                else
                {
                    adminPortNo   = Convert.ToInt32(portNo.Text);
                    adminUserName = userName.Text.Trim();
                    if (String.IsNullOrEmpty(adminUserName))
                    {
                        Ui_Utility.popupAlertBox("Please enter the admin. user name.");
                        userName.Focus();
                        isValidate = false;
                    }
                    else
                    {
                        adminUserPassword = password.Text.Trim();
                        if (String.IsNullOrEmpty(adminUserPassword))
                        {
                            Ui_Utility.popupAlertBox("Please enter the admin. user password.");
                            password.Focus();
                            isValidate = false;
                        }
                    }
                }
            }
            return(isValidate);
        }
Esempio n. 6
0
        private void rebuildAdminServerList()
        {
            ItemNode adminServerNode;

            rootNode.Nodes.Clear();
            foreach (string key in ftpAdminClient.adminServerList.Keys)
            {
                adminServerNode = Ui_Utility.buildAdminServerNode(ftpAdminClient.adminServerList[key]);
                ToolStripMenuItem disconnect = new ToolStripMenuItem();
                disconnect.Text   = "Disconnect from the admin. server";
                disconnect.Click += new EventHandler((sender, e) => disconnectServer(adminServerNode));
                disconnect.Image  = imageList1.Images[5];
                adminServerNode.ContextMenuStrip.Items.Add(disconnect);
                rootNode.Nodes.Add(adminServerNode);
                if (key == ftpAdminClient.lastServerKey)
                {
                    Panel1Tree.SelectedNode = adminServerNode;
                    adminServerNode.Expand();
                }
            }
        }
Esempio n. 7
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     Ui_Utility.initAdminServerList(settingList, new SortedDictionary <string, AdminServer>(), "");
 }