Пример #1
0
        /// <summary>
        /// Convenience method for getting the text to be displayed on the button
        /// </summary>
        /// <param name="button">The button which the text will be displayed on</param>
        /// <returns>The text that should be shown on the button</returns>
        public static String GetText(LetterButton button)
        {
            if (button.IsAddLetter)
            {
                return("+");
            }

            String text = LetterUtil.ConvertToString(button.SelectedLetter);

            switch (button.Restriction)
            {
            case PositionRestriction.START:
                text += "-";
                break;

            case PositionRestriction.END:
                text = "-" + text;
                break;
            }

            return(text);
        }
Пример #2
0
 /// <summary>
 /// The string representation of this node. (Is just the letter)
 /// </summary>
 /// <returns>The letter of the node</returns>
 public override String ToString()
 {
     return(LetterUtil.ConvertToString(Letter));
 }
Пример #3
0
 /// <summary>
 /// Set the value of one of the buttons in the grid with a letter
 /// </summary>
 /// <param name="x">The x position of the button</param>
 /// <param name="y">The y position of the button</param>
 /// <param name="letter">The new letter value</param>
 public void SetButtonValue(int x, int y, LetterUtil.Letter letter)
 {
     Buttons[y][x].Text           = LetterUtil.ConvertToString(letter);
     Buttons[y][x].SelectedLetter = letter;
 }