示例#1
0
        public static string ToString(this bool value, BooleanText booleanText)
        {
            MatchCollection matches = Regex.Matches(booleanText.ToString(), "[A-Z][a-z]+");

            return(value.ToString(matches[0].Value, matches[1].Value));
            // return Convert.ToString(value).ToString().ToLower();
        }
示例#2
0
 /// <summary>
 /// Assesses a boolean value and returns a textual value
 /// </summary>
 /// <param name="text">The textual value to be returned</param>
 /// <returns>A textual representation of the boolean value</returns>
 /// <remarks></remarks>
 public static string GetAsWord(this bool value, BooleanText text)
 {
     switch (text)
     {
         case BooleanText.AcceptedDeclined:
             return value.GetAsWord("Accepted", "Declined");
         case BooleanText.ActiveInactive:
             return (value) ? "Active" : "Inactive";
         case BooleanText.CheckedUnchecked:
             return (value) ? "Checked" : "Unchecked";
         case BooleanText.CorrectIncorrent:
             return (value) ? "Correct" : "Incorrent";
         case BooleanText.EnabledDisabled:
             return (value) ? "Enabled" : "Disabled";
         case BooleanText.OnOff:
             return (value) ? "On" : "Off";
         case BooleanText.YesNo:
             return (value) ? "Yes" : "No";
         default :
             return (value) ? "True" : "False";
     }            
 }
示例#3
0
        /// <summary>
        /// Assesses a boolean value and returns a textual value
        /// </summary>
        /// <param name="text">The textual value to be returned</param>
        /// <returns>A textual representation of the boolean value</returns>
        /// <remarks></remarks>
        public static string ToString(this bool value, BooleanText text)
        {
            MatchCollection matches = _regEx.Matches(text.ToString());

            return(value.ToString(matches[0].Value, matches[1].Value));
        }