public void Set(string name, string content, bool readOnly)
{
TabPage page = this.TabControl.TabPages[name];
if (page == null) {
page = new TabPage();
page.Name = name;
page.Text = name;
TextBox text = new TextBox();
if (!readOnly) {
text.AcceptsReturn = true;
text.AcceptsTab = true;
text.TextChanged += this.Form.CiText_TextChanged;
}
text.Dock = DockStyle.Fill;
text.Multiline = true;
text.MaxLength = 1000000;
text.ReadOnly = readOnly;
text.ScrollBars = ScrollBars.Both;
text.TabStop = false;
text.WordWrap = false;
if (Type.GetType("Mono.Runtime") == null)
SetNarrowTabs(text);
page.Controls.Add(text);
this.TabControl.TabPages.Add(page);
}
else if (this.TabsToRemove != null)
this.TabsToRemove.Remove(page);
page.Controls[0].Text = content;
}