protected bool IsDuplicateFileInTab(string filePath) { EventHandler <TabCompareTabPageEventArgs> handle = CompareTabPage; TabCompareTabPageEventArgs e = new TabCompareTabPageEventArgs(); e.TabPageIndex = this.TabIndex; e.FilePath = filePath; if (handle != null) { handle(this, e); } return(e.TabPageIsExist); }
public void CompareTabPage(object sender, TabCompareTabPageEventArgs e) { for (int i = 0; i < tabPages.Count; ++i) { if (e.TabPageIndex == i) { continue; } if (tabPages[i].LoadedFile.Equals(e.FilePath)) { e.TabPageIsExist = true; break; } } }