public ChatMessage(ChatLogControl parent, User user, string xml) { this.parent = parent; this.user = user; stf = StringFormat.GenericTypographic; stf.FormatFlags |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap; stf.FormatFlags |= StringFormatFlags.LineLimit; stf.LineAlignment = StringAlignment.Center; XmlDocument doc = new XmlDocument(); doc.LoadXml("<body>" + xml + "</body>"); XmlElement root = (XmlElement)doc.FirstChild; this.root = new RootPart(this,(XmlElement)root, new Font("Arial", 16)); if (user != null) Nick = user.ID; }
public ChatMessage(ChatLogControl parent, User user, string xml) { this.parent = parent; this.user = user; stf = StringFormat.GenericTypographic; stf.FormatFlags |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap; stf.FormatFlags |= StringFormatFlags.LineLimit; stf.LineAlignment = StringAlignment.Center; XmlDocument doc = new XmlDocument(); doc.LoadXml("<body>" + xml + "</body>"); XmlElement root = (XmlElement)doc.FirstChild; this.root = new RootPart(this, (XmlElement)root, new Font("Arial", 16)); if (user != null) { Nick = user.ID; } }
public void TestControl() { TabPage page = new TabPage (); page.Text = "TestPage"; ChatLogControl log = new ChatLogControl (); log.Dock = DockStyle.Fill; page.Controls.Add (log); User user = new User ("testid"); user.Color = Color.Red; log.AddMessage (new ChatMessage (log,user, "zumindest <b>zeit<i>lich</i></b> gesehen")); log.AddMessage (new ChatMessage (log,user, "haha <b>test<i>5873</i></b> bla")); log.AddMessage(new ChatMessage(log, user, "unformatierter test text bla susch sieht das hier niemals")); AddTabPage (page); }