public static Record_CardLevel GetRecord(int tag) { Tab_CardLevel tab = TabMgr.GetTab <Tab_CardLevel>(fileName); if (null == tab.mDic) { tab.mDic = new Dictionary <int, Record_CardLevel>(); foreach (var item in tab.mList) { tab.mDic.Add(item.tag, item); } } Record_CardLevel record; if (tab.mDic.TryGetValue(tag, out record)) { return(record); } return(null); }
public CloseableTabItem(TextBlock header, bool closeable = true) { tabId = Guid.NewGuid(); header.FontSize = 14; header.VerticalAlignment = VerticalAlignment.Center; // Container for header controls var dockPanel = new DockPanel(); dockPanel.Children.Add(header); // Close button to remove the tab if (closeable) { var closeButton = new TabCloseButton(); closeButton.Click += (sender, e) => { TabMgr.CloseTab(tabId); }; dockPanel.Children.Add(closeButton); } Header = dockPanel; }
public static List <Record_CardLevel> GetRecordList() { return(TabMgr.GetTab <Tab_CardLevel>(fileName).mList); }
private void DisplayEventLog(object obj) { logViewerCtrl = logViewerCtrl ?? Logger.LogViewerCtrl; TabMgr.AddOrSelectTabItem("Event Log", "LogGrid", 1, logViewerCtrl); }
private void DisplaySettingsView(object obj) { settingsView = settingsView ?? new SettingsView(); TabMgr.AddOrSelectTabItem("Settings", "SettingsGrid", 1, settingsView); }
private void DisplaySessionsAdminView(object obj) { sessionsAdminView = sessionsAdminView ?? new SessionsAdminView(); TabMgr.AddOrSelectTabItem("Sessions", "SessionsAdminGrid", 1, sessionsAdminView); }
private void DisplayAudioclipsAdminView(object obj) { audioclipsAdminView = audioclipsAdminView ?? new AudioclipsAdminView(); TabMgr.AddOrSelectTabItem("Audio clips", "AudiclipsAdminGrid", 1, audioclipsAdminView); }
private void OnCloseBtnClick(object sender, RoutedEventArgs e) { TabMgr.CloseTab(tabId); }