private void strip_SelectedTabChanged(object sender, Messir.Windows.Forms.SelectedTabChangedEventArgs e) { ITabbedDocument tdoc = PluginBase.MainForm.CurrentDocument as ITabbedDocument; Messir.Windows.Forms.TabStrip tabStrip = sender as Messir.Windows.Forms.TabStrip; int paneIndex = FindIndexFromStrip(tabStrip); ScintillaNet.ScintillaControl editor = (paneIndex == 0) ? tdoc.SplitSci1 : tdoc.SplitSci2; if (e.SelectedTab.Text == "Source") { editor.Show(); if (HasPreviewPlayer(paneIndex) == true) { this.artifacts[paneIndex].previewContainer.Hide(); } } else if (e.SelectedTab.Text == "Preview") { editor.Hide(); if (HasPreviewPlayer(paneIndex) == true) { UpdatePreview(paneIndex); this.artifacts[paneIndex].previewContainer.Show(); } else { AxShockwaveFlashObjects.AxShockwaveFlash player = GetPreviewPlayer(paneIndex); } } }
private int FindIndexFromStrip(Messir.Windows.Forms.TabStrip strip) { TabArtifacts t = null; foreach (TabArtifacts test in this.artifacts) { if (test.strip == strip) { t = test; break; } } return this.artifacts.IndexOf(t); }