Esempio n. 1
0
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            UIApplication      app    = commandData.Application;
            List <RibbonPanel> panels = app.GetRibbonPanels();

            foreach (RibbonPanel panel in panels)
            {
                Debug.Print(panel.Name);
                IList <RibbonItem> items = panel.GetItems();
                foreach (RibbonItem item in items)
                {
                    RibbonItemType t = item.ItemType;
                    if (RibbonItemType.PushButton == t)
                    {
                        PushButton b = item as PushButton;
                        Debug.Print("  {0} : {1}", item.ItemText, b.Name);
                    }
                    else
                    {
                        Debug.Assert(RibbonItemType.PulldownButton == t, "expected pulldown button");
                        PulldownButton b = item as PulldownButton;
                        Debug.Print("  {0} : {1}", item.ItemText, b.Name);
                        foreach (RibbonItem item2 in b.GetItems())
                        {
                            Debug.Assert(RibbonItemType.PushButton == item2.ItemType, "expected push button in pulldown menu");
                            Debug.Print("    {0} : {1}", item2.ItemText, ((PushButton)item2).Name);
                        }
                    }
                }
            }
            return(Result.Failed);
        }
Esempio n. 2
0
        Stream(ArrayList data, PulldownButton pullDownBt)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(PulldownButton)));

            data.Add(new Snoop.Data.Object("Image", pullDownBt.Image));
            data.Add(new Snoop.Data.Enumerable("Items", pullDownBt.GetItems()));
            data.Add(new Snoop.Data.String("Name", pullDownBt.Name));
        }
        private void Stream(ArrayList data, PulldownButton pullDownBt)
        {
            data.Add(new Snoop.Data.ClassSeparator(typeof(PulldownButton)));

             data.Add(new Snoop.Data.Object("Image", pullDownBt.Image));
             data.Add(new Snoop.Data.Enumerable("Items", pullDownBt.GetItems()));
             data.Add(new Snoop.Data.String("Name", pullDownBt.Name));
        }