예제 #1
0
 private object GetImage(UICommandDefinition entry)
 {
     if (entry.ImageListIndex.HasValue)
     {
         return(entry.ImageListIndex.Value);
     }
     if (entry.Image != null)
     {
         return(WinFormUtil.GetBitmap(entry.Image));
     }
     return(null);
 }
예제 #2
0
 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;
     }
 }