Esempio n. 1
0
        public static RibbonPage Add(this RibbonPageCollection collection, string text)
        {
            var page = new RibbonPage(text);

            collection.Add(page);
            return(page);
        }
Esempio n. 2
0
 private void FindMenuPhanQuyen(RibbonPageCollection items, string pScreenName, bool pEnable)
 {
     foreach (RibbonPage menu in items)
     {
         if (string.Equals(pScreenName, menu.Tag))
         {
             menu.Visible = pEnable;
         }
     }
 }
Esempio n. 3
0
        private RibbonPage pageFrom(RibbonPageCollection ribbonPageCollection, string pageName)
        {
            var page = ribbonPageCollection[pageName];

            if (page == null)
            {
                page = new RibbonPage(pageName)
                {
                    KeyTip = pageName.Substring(0, 1).ToUpper()
                };
                ribbonPageCollection.Add(page);
            }
            return(page);
        }
Esempio n. 4
0
 public static void AddDockPanelMenu(RibbonPageCollection pages, object owner, string addInTreePath)
 {
     System.Collections.Generic.List <DockPanelDescriptor> list = AddInTree.BuildItems <DockPanelDescriptor>(addInTreePath, owner, false);
     foreach (DockPanelDescriptor current in list)
     {
         MenuDockPanelCommand menuDockPanelCommand = new MenuDockPanelCommand(current.Codon, owner, true);
         string[]             array = menuDockPanelCommand.Category.Split(new char[]
         {
             '|'
         });
         if (pages != null)
         {
             RibbonPage pageByName = pages.GetPageByName(array[0]);
             if (pageByName != null)
             {
                 RibbonPageGroup groupByName = pageByName.Groups.GetGroupByName(array[1]);
                 if (groupByName != null)
                 {
                     groupByName.ItemLinks.Add(menuDockPanelCommand);
                 }
             }
         }
     }
 }
Esempio n. 5
0
 public void SetPages(RibbonPageCollection Pages)
 {
     this.Pages = Pages;
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RibbonPageCollectionUIAdapter"/> class.
 /// </summary>
 /// <param name="ribbonPageCollection"></param>
 public RibbonPageCollectionUIAdapter(RibbonPageCollection ribbonPageCollection)
 {
     Guard.ArgumentNotNull(ribbonPageCollection, "RibbonPageCollection");
     this.ribbonPageCollection = ribbonPageCollection;
 }