Exemplo n.º 1
0
        // TODO: The refreshes after each creation may not be strictly necessary.
        // When time, determine if can be removed.


        #region [ ConstructCheckbox ]
        /// <summary>
        /// Create a new Checkbox instance with the style of this game's assets.
        /// </summary>
        /// <param name="name">Name Identifier</param>
        /// <param name="text">Optional Label Text</param>
        /// <returns></returns>
        public static Checkbox ConstructCheckbox(string name, string text = "")
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException($"Checkbox requires a name.");
            }

            Checkbox ck = new Checkbox(Ck_Style, Ck_Checked_Style, Ck_CheckedHovered_Style, Ck_HoveredPressedChecked_Style)
            {
                HoveredStyle        = Ck_Hovered_Style,
                PressedStyle        = Ck_HoveredPressed_Style,
                HoveredPressedStyle = Ck_HoveredPressed_Style,
                Name = name,
                Text = text
            };

            ck.Refresh();
            return(ck);
        }