private void FolderCheckedChanged(object sender, EventArgs e) { bool PanelCreated; TRbtNavigationButton rbtFolder = (TRbtNavigationButton)sender; TPnlModuleNavigation CollPanelHoster = GetOrCreatePanel((XmlNode)rbtFolder.Tag, out PanelCreated); if (rbtFolder.Checked) { CollPanelHoster.Text = rbtFolder.Text; CollPanelHoster.Show(); if (PanelCreated) { CollPanelHoster.SelectFirstLink(); } else { CollPanelHoster.FireSelectedLinkEvent(); } } else { CollPanelHoster.Hide(); } }
private TPnlModuleNavigation GetOrCreatePanel(XmlNode AFolderNode, out bool APanelCreated) { TPnlModuleNavigation CollPanelHoster; string pnlName = "pnl" + AFolderNode.Name; if (AFolderNode.Attributes["Label"] != null) { pnlName = AFolderNode.Attributes["Label"].Value.Replace(" ", ""); } if (this.sptNavigation.Panel1.Controls.ContainsKey(pnlName)) { APanelCreated = false; CollPanelHoster = (TPnlModuleNavigation)this.sptNavigation.Panel1.Controls[pnlName]; CollPanelHoster.CurrentLedger = FCurrentLedger; CollPanelHoster.InitiallySelectedLedger = FInitiallySelectedLedger; return(CollPanelHoster); } else { APanelCreated = true; CollPanelHoster = new TPnlModuleNavigation(AFolderNode, FDashboard, this.Width, FMultiLedgerSite, FConferenceSelected); CollPanelHoster.Name = pnlName; CollPanelHoster.Statusbar = FStatusbar; CollPanelHoster.Dock = DockStyle.Left; CollPanelHoster.CurrentLedger = FCurrentLedger; CollPanelHoster.InitiallySelectedLedger = FInitiallySelectedLedger; CollPanelHoster.Collapsed += delegate(object sender, EventArgs e) { CollapsibleNavigationCollapsed(sender, e); }; CollPanelHoster.Expanded += delegate(object sender, EventArgs e) { CollapsibleNavigationExpanded(sender, e); }; CollPanelHoster.ItemActivation += delegate(TTaskList ATaskList, XmlNode ATaskListNode, LinkLabel AItemClicked, object AOtherData) { OnItemActivation(ATaskList, ATaskListNode, AItemClicked, AOtherData); }; CollPanelHoster.LedgerChanged += delegate(int ALedgerNr, string ALedgerName) { OnLedgerChanged(ALedgerNr, ALedgerName); }; this.sptNavigation.Panel1.Controls.Add(CollPanelHoster); return(CollPanelHoster); } }
private TPnlModuleNavigation GetOrCreatePanel(XmlNode AFolderNode, out bool APanelCreated) { TPnlModuleNavigation CollPanelHoster; string pnlName = "pnl" + AFolderNode.Name; if (AFolderNode.Attributes["Label"] != null) { pnlName = AFolderNode.Attributes["Label"].Value.Replace(" ", ""); } if (this.sptNavigation.Panel1.Controls.ContainsKey(pnlName)) { APanelCreated = false; CollPanelHoster = (TPnlModuleNavigation) this.sptNavigation.Panel1.Controls[pnlName]; CollPanelHoster.CurrentLedger = FCurrentLedger; return CollPanelHoster; } else { APanelCreated = true; CollPanelHoster = new TPnlModuleNavigation(AFolderNode, FDashboard, this.Width, FMultiLedgerSite, FConferenceSelected); CollPanelHoster.Name = pnlName; CollPanelHoster.Statusbar = FStatusbar; CollPanelHoster.Dock = DockStyle.Left; CollPanelHoster.CurrentLedger = FCurrentLedger; CollPanelHoster.Collapsed += delegate(object sender, EventArgs e) { CollapsibleNavigationCollapsed(sender, e); }; CollPanelHoster.Expanded += delegate(object sender, EventArgs e) { CollapsibleNavigationExpanded(sender, e); }; CollPanelHoster.ItemActivation += delegate(TTaskList ATaskList, XmlNode ATaskListNode, LinkLabel AItemClicked, object AOtherData) { OnItemActivation(ATaskList, ATaskListNode, AItemClicked, AOtherData); }; CollPanelHoster.LedgerChanged += delegate(int ALedgerNr, string ALedgerName) { OnLedgerChanged(ALedgerNr, ALedgerName); }; this.sptNavigation.Panel1.Controls.Add(CollPanelHoster); return CollPanelHoster; } }