internal void AddNewTab(SurfaceProfileChart surfaceProfileChart, int sessionId) { if (profilesTabControl.TabPages.Count > 0) { var chart = (SurfaceProfileChart)profilesTabControl.SelectedTab.Controls["profileChart"]; controller.ClearProfileSelection(chart); } TabPage tabPage = null; if (CheckTabExistance(sessionId.ToString(), out tabPage)) { profilesTabControl.SelectedTab = tabPage; return; } string sHeaderTab = $"ֳנאפ³ך"; string title = sHeaderTab + $" {profilesTabControl.TabPages.Count + 1}"; int i = 1; while (profilesTabControl.TabPages.ContainsKey(title)) { title = sHeaderTab + $" {i + 1}"; i++; } tabPage = new TabPage(title); tabPage.Name = title; tabPage.Tag = sessionId; tabPage.Padding = new Padding(0); profilesTabControl.TabPages.Add(tabPage); var curTab = profilesTabControl.TabPages[profilesTabControl.TabCount - 1]; surfaceProfileChart.Width = curTab.Width; surfaceProfileChart.Height = curTab.Height; surfaceProfileChart.Name = "profileChart"; curTab.Controls.Add(surfaceProfileChart); profilesTabControl.SelectTab(profilesTabControl.TabCount - 1); controller.SetChart(surfaceProfileChart); surfaceProfileChart.SetControlSize(); }
internal void AddNewTab(SurfaceProfileChart surfaceProfileChart, string sessionName) { string title = $"Graph {profilesTabControl.TabPages.Count + 1}"; TabPage tabPage = new TabPage(title); tabPage.Name = $"Graph {profilesTabControl.TabPages.Count + 1}"; profilesTabControl.TabPages.Add(tabPage); var curTab = profilesTabControl.TabPages[profilesTabControl.TabCount - 1]; surfaceProfileChart.Width = curTab.Width; surfaceProfileChart.Height = curTab.Height; surfaceProfileChart.Name = "profileChart"; curTab.Controls.Add(surfaceProfileChart); profilesTabControl.SelectTab(profilesTabControl.TabCount - 1); surfaceProfileChart.SetControlSize(); }