public static void SetItem(PushButton btn) { if (ribbonButton == null) { MethodInfo method = btn.GetType().GetMethod("getRibbonButton", BindingFlags.NonPublic | BindingFlags.Instance); ribbonButton = method.Invoke(btn, null) as Autodesk.Windows.RibbonButton; } }