ToString() public method

public ToString ( ) : string
return string
Esempio n. 1
0
        private static bool TryUppercase(StringPart text, out Color value)
        {
            var name = text.ToString().ToUpper();

            if (Colours.TryGetValue(name, out value))
            {
                Colours.Add(text, value);
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        private static bool TryUppercase(StringPart text, out Color value)
        {
            var name = text.ToString().ToUpper();

            if (Colours.TryGetValue(name, out value))
            {
                Colours.Add(text, value);
                return true;
            }

            return false;
        }
Esempio n. 3
0
        private static bool TryComponents(StringPart text, out Color value)
        {
            var name  = text.ToString().ToUpper();
            var parts = name.Split(new char[] { ' ', ',', ';', ':' });

            if (ReadColourComponents(parts, out value))
            {
                Colours.Add(text, value);
                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        private static bool TryComponents(StringPart text, out Color value)
        {
            var name = text.ToString().ToUpper();
            var parts = name.Split(new char[] { ' ', ',', ';', ':' });

            if (ReadColourComponents(parts, out value))
            {
                Colours.Add(text, value);
                return true;
            }

            return false;
        }
Esempio n. 5
0
 private bool TryLoad(StringPart name, out T item)
 {
     try
     {
         item = content.Load <T>(name.ToString());
         items.Add(name, item);
         return(true);
     }
     catch
     {
         item = default(T);
         return(false);
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Writes the line.
 /// </summary>
 /// <param name="line">The line.</param>
 public void WriteLine(StringPart line)
 {
     //var t = text[text.Count - 1];
     //text.RemoveAt(text.Count - 1);
     //t.Batch.Clear();
     //t.Batch.Write(line);
     //t.Height = t.Batch.CalculateArea(Int2D.Zero, Justification, Area.Width).Height;
     //text.Insert(0, t);
     Write(line.ToString());
     moveNextDrawToNewLine = true;
 }
Esempio n. 7
0
        /// <summary>
        /// Appends text onto the last line written.
        /// </summary>
        /// <param name="text">The text to append.</param>
        public void Write(StringPart line)
        {
            if (moveNextDrawToNewLine || text.Count == 0)
            {
                text.Add(line);
                moveNextDrawToNewLine = false;
            }
            else
            {
                var current = text[text.Count - 1];
                text[text.Count - 1] = current.ToString() + line.ToString();
            }

            //if (line[line.Length - 1] == '\n')
            //    moveNextDrawToNewLine = true;

            text.RemoveRange(0, Math.Max(0, text.Count - historyCapacity));

            if (startIndex == text.Count - 1)
                ScrollToNewest();
        }