private object GetImage(UICommandDefinition entry) { if (entry.ImageListIndex.HasValue) { return(entry.ImageListIndex.Value); } if (entry.Image != null) { return(WinFormUtil.GetBitmap(entry.Image)); } return(null); }
private static void SetStandardProperties(UICommandDefinition menuEntry, ToolBase toolBase) { toolBase.SharedProps.Caption = menuEntry.Text; toolBase.SharedProps.DisplayStyle = ToolDisplayStyle.ImageAndText; if (menuEntry.ImageListIndex.HasValue) { toolBase.SharedProps.AppearancesSmall.Appearance.Image = menuEntry.ImageListIndex.Value; } else if (menuEntry.Image != null) { toolBase.SharedProps.AppearancesSmall.Appearance.Image = WinFormUtil.GetBitmap(menuEntry.Image); } if (menuEntry.ShortcutKeys.HasValue) { toolBase.SharedProps.Shortcut = (System.Windows.Forms.Shortcut)menuEntry.ShortcutKeys.Value; } }