Exemplo n.º 1
0
        internal void init(JToken token, string adminServerId)
        {
            base.init(token);

            this.Text                     = adminServerId;
            this.Name                     = adminServerId;
            toolStripItemList             = token["ToolStripItemList"].ToObject <SortedDictionary <string, dynamic> >();
            adminServerAdministrationNode = new AdminServerAdministrationNode(adminServer, uiManager);
            adminServerAdministrationNode.init(token["adminServerAdministrationNode"]);
            ftpServerListNode = new FtpServerListNode(adminServer, uiManager);
            ftpServerListNode.init(token["ftpServerListNode"]);
            this.Nodes.Clear();
            this.Nodes.Add(adminServerAdministrationNode);
            this.Nodes.Add(ftpServerListNode);
        }
Exemplo n.º 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);
            }
        }