示例#1
0
        internal override void doSelect()
        {
            SortedDictionary <string, FtpServerInfo> ftpServerList = adminServer.getFTPServerList();
            List <ListItem> itemList = new List <ListItem>();

            foreach (string serverId in ftpServerList.Keys)
            {
                ListItem      ftpServerItem = new ListItem();
                FtpServerNode ftpServerNode = ((FtpServerNode)Nodes.Find(serverId, true)[0]);
                FtpServerInfo ftpServerInfo = ftpServerList[serverId];
                ftpServerItem.relatedNode = ftpServerNode;
                ftpServerItem.Text        = ftpServerInfo.description;
                ftpServerItem.Name        = ftpServerInfo.serverId;
                ftpServerItem.ImageIndex  = ftpServerNode.ImageIndex;
                ftpServerItem.SubItems.Add("1");
                switch (ftpServerInfo.status)
                {
                case FtpServerStatus.DISABLE:
                    ftpServerItem.SubItems.Add("Disabled");
                    break;

                case FtpServerStatus.STARTED:
                    ftpServerItem.SubItems.Add("Started");
                    break;

                case FtpServerStatus.STOPPED:
                    ftpServerItem.SubItems.Add("Stopped");
                    break;
                }
                itemList.Add(ftpServerItem);
            }
            itemList.Add(this.addFTPServerItem);
            uiManager.updateListView(this.colunmNameList, itemList);
        }
示例#2
0
        internal void refreshFtpServerListNode(AdminServer adminServer, FtpServerListNode ftpServerListNode)
        {
            SortedDictionary <string, FtpServerInfo> ftpServerList = adminServer.getFTPServerList();

            ftpServerListNode.Nodes.Clear();
            foreach (string serverId in ftpServerList.Keys)
            {
                FtpServerNode ftpServerNode = new FtpServerNode(adminServer, this, serverId);
                FtpServerInfo fI            = ftpServerList[serverId];
                ftpServerNode.init(uiObjFactory.getObj("ftpServerNode"));
                foreach (string key in ftpServerNode.toolStripItemList.Keys)
                {
                    ToolStripMenuItem tSI = ftpServerNode.toolStripItemList[key].ToObject <ToolStripMenuItem>();
                    tSI.Click += (sender, e) => MessageBox.Show(serverId);
                    ftpServerNode.ContextMenuStrip.Items.Add(tSI);
                }
                ftpServerNode.ContextMenuStrip.ImageList = imageList;
                ftpServerNode.Text = fI.description;
                ftpServerNode.Name = serverId;
                ftpServerListNode.Nodes.Add(ftpServerNode);
            }
        }