Ejemplo n.º 1
0
        /// <summary>
        /// Parse a new color definition from the text commands
        /// </summary>
        /// <returns></returns>
        private MircColor parseTextColorFromCommand()
        {
            string colorFullName = Message.NextCommand();

            int splitIndex = colorFullName.IndexOf('.');

            string textColor = "";
            string bgColor   = String.Empty;

            if (splitIndex != -1)
            {
                textColor = colorFullName.Substring(0, splitIndex).Trim();
                bgColor   = colorFullName.Substring(splitIndex + 1).Trim();
            }
            else
            {
                textColor = colorFullName.Trim();
            }

            MircColor color = new MircColor().Colorize(textColor);

            if (bgColor != string.Empty)
            {
                color = color.Colorize(bgColor);
            }

            return(color);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add Color control codes.
 /// </summary>
 /// <param name="text">A piece of text.</param>
 /// <param name="textColor">The color of the text taken from one of the mIRC color enums.</param>
 /// <param name="backgroundColor">The background of the designated text.</param>
 /// <returns>The text with the added control codes.</returns>
 public static string MakeColor(string text, MircColor textColor, MircColor backgroundColor)
 {
     return(string.Format(FullColorFormat, (int)textColor, (int)backgroundColor, text));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Add Color control codes.
 /// </summary>
 /// <param name="text">A piece of text.</param>
 /// <param name="textColor">The color of the text taken from one of the mIRC color enums.</param>
 /// <returns>The text with the added control codes.</returns>
 public static string MakeColor(string text, MircColor textColor)
 {
     return(string.Format(TextColorFormat, (int)textColor, text));
 }
Ejemplo n.º 4
0
		/// <summary>
		/// Add Color control codes.
		/// </summary>
		/// <param name="text">A piece of text.</param>
		/// <param name="textColor">The color of the text taken from one of the mIRC color enums.</param>
		/// <param name="backgroundColor">The background of the designated text.</param>
		/// <returns>The text with the added control codes.</returns>
		public static string MakeColor( string text, MircColor textColor, MircColor backgroundColor )
		{
			return string.Format( FullColorFormat, (int) textColor, (int)backgroundColor, text ); 
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Add Color control codes.
		/// </summary>
		/// <param name="text">A piece of text.</param>
		/// <param name="textColor">The color of the text taken from one of the mIRC color enums.</param>
		/// <returns>The text with the added control codes.</returns>
		public static string MakeColor( string text, MircColor textColor )
		{
			return string.Format( TextColorFormat, (int) textColor, text ); 
		}