コード例 #1
0
ファイル: Labs6.cs プロジェクト: ezhangle/AdnRevitApiLabsXtra
        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);
        }
コード例 #2
0
ファイル: CollectorExtApp.cs プロジェクト: eibre/RevitLookup
        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));
        }
コード例 #3
0
        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));
        }