Beispiel #1
0
 internal static string C(string str, Color color, int startIndex, int endIndex)
 {
     return(CStringUtils.TryFormat("{0}<color=#{1}>{2}</color>{3}", str.Substring(0, startIndex),
                                   ToHexValue(ref color),
                                   str.Substring(startIndex, endIndex - startIndex),
                                   str.Substring(endIndex)
                                   ));
 }
Beispiel #2
0
        internal static string Arg(string value)
        {
            if (value != null && value.Length > 0)
            {
                value = value.Replace(Quote, EscapedQuote);
                value = value.Replace(SingleQuote, EscapedSingleQuote);

                if (value.IndexOf(' ') != -1)
                {
                    value = CStringUtils.TryFormat("\"{0}\"", value);
                }

                return(value);
            }

            return("\"\"");
        }
Beispiel #3
0
 public static string I(string str)
 {
     return(CStringUtils.TryFormat("<i>{0}</i>", str));
 }
Beispiel #4
0
 public static string B(string str)
 {
     return(CStringUtils.TryFormat("<b>{0}</b>", str));
 }
Beispiel #5
0
 public static string C(string str, Color color)
 {
     return(CStringUtils.TryFormat("<color=#{0}>{1}</color>", ToHexValue(ref color), str));
 }
Beispiel #6
0
 internal static string C(string str, CColorCode color)
 {
     return(CStringUtils.TryFormat("<color=${0}>{1}</color>", ((int)color).ToString(), str));
 }