コード例 #1
0
ファイル: TabPage.cs プロジェクト: rizki999/close-able-tab
        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);
        }
コード例 #2
0
 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;
         }
     }
 }