示例#1
0
        /// <summary>
        /// Wrapper around AuroraButtons dictionary so that we can easily fix all patches
        /// that rely on Lib if the button names change in the future.
        /// </summary>
        /// <param name="button"></param>
        /// <returns></returns>
        public string GetButtonName(AuroraButton button)
        {
            string buttonName;

            AuroraButtons.TryGetValue(button, out buttonName);
            return(buttonName);
        }
示例#2
0
        private static void ChangeButtonStyle(AuroraButton button, Bitmap image, Color textColor, Color?backgroundColor = null)
        {
            Bitmap colorizedImage = ColorizeImage(image, textColor);

            ThemeCreator.ThemeCreator.AddImageChange(button, colorizedImage);

            if (backgroundColor != null)
            {
                ThemeCreator.ThemeCreator.AddColorChange(
                    (Control control) =>
                {
                    return(control.GetType() == typeof(Button) && control.Name == lib.KnowledgeBase.GetButtonName(button));
                },
                    new ThemeCreator.ColorChange {
                    BackgroundColor = backgroundColor
                }
                    );
            }
        }
示例#3
0
 /// <summary>
 /// Helper method to set a background image for a specific AuroraButton.
 /// </summary>
 /// <param name="auroraButton"></param>
 public static void AddImageChange(AuroraButton auroraButton, string imagePath)
 {
     AddImageChange(auroraButton, Image.FromFile(imagePath));
 }
示例#4
0
 /// <summary>
 /// Helper method to set a background image for a specific AuroraButton.
 /// </summary>
 /// <param name="auroraButton"></param>
 public static void AddImageChange(AuroraButton auroraButton, Image image)
 {
     ImagePredicates.Add(control => control.Name == lib.KnowledgeBase.GetButtonName(auroraButton), image);
 }