public void CreateRibbon()
        {
            if (Autodesk.Windows.ComponentManager.Ribbon == null)
            {
                return;
            }

            RibbonBuilder.BuildRibbon();
        }
        private static void ComponentManager_ItemInitialized(object sender, Autodesk.Windows.RibbonItemEventArgs e)
        {
            if (Autodesk.Windows.ComponentManager.Ribbon == null)
            {
                return;
            }

            Autodesk.Windows.ComponentManager.Ribbon.BackgroundRenderFinished += RibbonOnBackgroundRenderFinished;

            RibbonBuilder.BuildRibbon();

            Autodesk.Windows.ComponentManager.ItemInitialized -= ComponentManager_ItemInitialized;
        }
        private static void ComponentManager_ItemInitialized(object sender, Autodesk.Windows.RibbonItemEventArgs e)
        {
            // now one Ribbon item is initialized, but the Ribbon control
            // may not be available yet, so check if before
            if (Autodesk.Windows.ComponentManager.Ribbon == null)
            {
                return;
            }

            RibbonBuilder.BuildRibbon();

            // and remove the event handler
            Autodesk.Windows.ComponentManager.ItemInitialized -= ComponentManager_ItemInitialized;
        }
 private static void RibbonOnBackgroundRenderFinished(object sender, EventArgs e)
 {
     RibbonBuilder.BuildRibbon();
 }