public string[] ToStrings(string title, int characterLimit, bool disableStyle) { if (this.Text == null && this.Text == string.Empty) { return(new string[0]); } List <string> pages = new List <string>(); MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(this.Text)); StreamReader reader = new StreamReader(stream); string buffer = string.Empty; while (true) { string line = reader.ReadLine(); if (line == null) { break; } if (buffer.Length + line.Length > characterLimit) { pages.Add(HTML.CreateWindow(title, buffer, disableStyle, this._outerQuotes)); buffer = string.Empty; } buffer += line + "\n"; } if (buffer != string.Empty) { pages.Add(HTML.CreateWindow(title, buffer, disableStyle, this._outerQuotes)); } return(pages.ToArray()); }
public string ToString(string title, bool disableStyle) { return(HTML.CreateWindow(title, this.Text, disableStyle, this._outerQuotes)); }