Beispiel #1
0
        public void OnButtonClick()
        {
            //  È¥ÖØ
            ITab[] tabs = pluginServer.GetTabs();
            if (null != tabs && tabs.Length > 0)
            {
                List <string> notdup = new List <string>();
                List <ITab>   dups   = new List <ITab>();
                for (int i = 0; i < tabs.Length; i++)
                {
                    if (notdup.Contains(tabs[i].Address.Path))
                    {
                        dups.Add(tabs[i]);
                    }
                    else
                    {
                        notdup.Add(tabs[i].Address.Path);
                    }

                    // MessageBox.Show(tabs[i].Address.Path);
                }

                if (dups.Count > 0)
                {
                    foreach (ITab tab in dups)
                    {
                        tab.Close();
                    }
                }
            }
            // ÅÅÐò
            tabs = pluginServer.GetTabs();
            if (tabs.Length > 0)
            {
                List <string> sorts = new List <string>();
                for (int i = 0; i < tabs.Length; i++)
                {
                    sorts.Add(tabs[i].Text);
                }

                sorts.Sort();

                for (int i = 0; i < tabs.Length; i++)
                {
                    int idx = sorts.IndexOf(tabs[i].Text);
                    if (idx >= 0)
                    {
                        tabs[i].Insert(idx);
                    }
                }
            }
        }
Beispiel #2
0
        public void OnButtonClick()
        {
            ITab[] tabs = pluginServer.GetTabs();
            if (null != tabs && tabs.Length > 0)
            {
                List <string> notdup = new List <string>();
                List <ITab>   dups   = new List <ITab>();
                for (int i = 0; i < tabs.Length; i++)
                {
                    if (notdup.Contains(tabs[i].Address.Path))
                    {
                        dups.Add(tabs[i]);
                    }
                    else
                    {
                        notdup.Add(tabs[i].Address.Path);
                    }

                    // MessageBox.Show(tabs[i].Address.Path);
                }

                if (dups.Count > 0)
                {
                    foreach (ITab tab in dups)
                    {
                        tab.Close();
                    }
                }
            }
        }
Beispiel #3
0
 public void OnMenuItemClick(MenuType menuType, string menuText, ITab tab)
 {
     // user clicked registered menu.
     if (menuText == "SampleSplitButton Menu test")
     {
         if (menuType == MenuType.Tab)
         {
             MessageBox.Show(tab.Address.Path);
         }
         else if (menuType == MenuType.Bar)
         {
             pluginServer.ExecuteCommand(Commands.OpenTabBarOptionDialog, null);
         }
     }
     if (menuText == "²âÊÔ±êÇ©Ëø¶¨×´Ì¬")
     {
         MessageBox.Show("²âÊÔ±êÇ©Ëø¶¨×´Ì¬");
         ITab[] tabs = pluginServer.GetTabs();
         foreach (ITab iTab in tabs)
         {
             MessageBox.Show("" + iTab.Address + "->" + iTab.Locked);
         }
     }
 }