private void ReloadServer_Click(object sender, EventArgs e) { TreeNode treeNode = this.FindAssociatedServer(this.m_pTree.SelectedNode); MainForm.TreeNodeInfo treeNodeInfo = (MainForm.TreeNodeInfo)treeNode.Tag; treeNodeInfo.Server.Disconnect(); this.m_pTree.SelectedNode.Nodes.Clear(); this.m_pTree_DoubleClick(null, null); }
private TreeNode FindAssociatedServer(TreeNode node) { MainForm.TreeNodeInfo treeNodeInfo = node.Tag as MainForm.TreeNodeInfo; if (treeNodeInfo != null && treeNodeInfo.TreeNodeType == MainForm.NodeType.Server) { return(node); } if (node.Parent != null) { return(this.FindAssociatedServer(node.Parent)); } return(null); }
private void deleteServer_Click(object sender, EventArgs e) { TreeNode treeNode = this.FindAssociatedServer(this.m_pTree.SelectedNode); MainForm.TreeNodeInfo treeNodeInfo = (MainForm.TreeNodeInfo)treeNode.Tag; if (MessageBox.Show(this, "Are you sure you want to remove server '" + treeNode.Text + "' from list ?", "Confirm delete:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { DataSet dataSet = this.LoadRegisteredServers(); this.RemoveRowByID(treeNodeInfo.Server.ID); treeNodeInfo.Server.Disconnect(); treeNode.Remove(); } }
private void m_pTree_DoubleClick(object sender, EventArgs e) { if (this.m_pTree.SelectedNode == null) { return; } if (this.m_pTree.SelectedNode.Parent == null && this.m_pTree.SelectedNode.Nodes.Count == 0) { MainForm.TreeNodeInfo treeNodeInfo = (MainForm.TreeNodeInfo) this.m_pTree.SelectedNode.Tag; treeNodeInfo.Server.Connect(); this.LoadServer(this.m_pTree.SelectedNode, treeNodeInfo.Server, treeNodeInfo.Server.ID); } }
private void m_pTree_AfterSelect(object sender, TreeViewEventArgs e) { this.m_pFrame.FormFrameBorder = BorderStyle.FixedSingle; this.m_pFrame.Frame_ToolStrip = null; if (e.Node == null || e.Node.Tag == null) { this.m_pFrame.Frame_Form = new Form(); return; } if (e.Node.Parent == null && e.Node.Nodes.Count == 0) { return; } MainForm.TreeNodeInfo treeNodeInfo = (MainForm.TreeNodeInfo)e.Node.Tag; if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Dummy) { this.m_pFrame.Frame_Form = new Form(); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Server) { this.m_pFrame.Frame_Form = new ServerInfomationForm(treeNodeInfo.Server); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.LocalMachineMonitoring) { this.m_pFrame.Frame_Form = new SessionsForm(treeNodeInfo.Server); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Monitoring_SipRegistrations) { this.m_pFrame.Frame_Form = new SipRegistrationsForm(treeNodeInfo.Server, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Monitoring_SipCalls) { this.m_pFrame.Frame_Form = new SipCallsForm(treeNodeInfo.Server, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.EventsAndLogs_Events) { this.m_pFrame.Frame_Form = new EventsForm(treeNodeInfo.Server, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.EventsAndLogs_Logs) { this.m_pFrame.Frame_Form = new LogsForm(treeNodeInfo.Server, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.VirtualServers) { this.m_pFrame.Frame_Form = new VirtualServersForm(this, treeNodeInfo.OwnerNode, treeNodeInfo.Server, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_General) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new GeneralForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Authentication) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new AuthenticationForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Services_SMTP) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new SmtpServicesForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Services_POP3) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new Pop3ServicesForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Services_IMAP) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new ImapServiceForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Services_Relay) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new RelayServicesForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Services_FetchPOP3) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new FetchPop3ServiceForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Services_SIP) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new SipServiceForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Logging) { this.m_pFrame.FormFrameBorder = BorderStyle.None; this.m_pFrame.Frame_Form = new LoggingForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_Backup) { this.m_pFrame.Frame_Form = new BackupForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.System_ReturnMessages) { this.m_pFrame.Frame_Form = new ReturnMessagesForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Domains) { this.m_pFrame.Frame_Form = new DomainsForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.UsersAndGroups_Users) { this.m_pFrame.Frame_Form = new UsersForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.UsersAndGroups_Groups) { this.m_pFrame.Frame_Form = new GroupsForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.MailingLists) { this.m_pFrame.Frame_Form = new MailingListsForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Routing) { this.m_pFrame.Frame_Form = new RoutesForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Rules_Message_Global) { this.m_pFrame.Frame_Form = new GlobalMessageRulesForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.SharedFolders_RootFolders) { this.m_pFrame.Frame_Form = new RootFoldersForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Folders_UsersDefaultFolders) { this.m_pFrame.Frame_Form = new UsersDefaultFoldersForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Folders_RecycleBin) { this.m_pFrame.Frame_Form = new RecycleBinForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Filters) { this.m_pFrame.Frame_Form = new FiltersForm(treeNodeInfo.VirturalServer, this.m_pFrame); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Queues_IncomingSMTP) { this.m_pFrame.Frame_Form = new IncomingSMTPForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Queues_OutgoingSMTP) { this.m_pFrame.Frame_Form = new OutgoingSmtpForm(treeNodeInfo.VirturalServer); return; } if (treeNodeInfo.TreeNodeType == MainForm.NodeType.Security) { this.m_pFrame.Frame_Form = new IPSecurityForm(treeNodeInfo.VirturalServer, this.m_pFrame); } }