/// <summary> /// Creates a new <see>ChatBox</see>. /// </summary> public DisplayBox() { InitializeComponent(); this.AddChatImplementation = new AddChatCallback(AddChatImpl); m_renderers = new Dictionary<Type, ChatNodeRenderer>(); InitializeRenderer(typeof(ChatNode), typeof(ChatNodeRenderer)); this.StylesheetUri = new Uri(Path.Combine(Environment.CurrentDirectory, "StandardStyles.xaml"), UriKind.Absolute); }
/// <summary> /// Creates a new <see>ChatBox</see>. /// </summary> public DisplayBox() { InitializeComponent(); this.AddChatImplementation = new AddChatCallback(AddChatImpl); m_renderers = new Dictionary <Type, ChatNodeRenderer>(); InitializeRenderer(typeof(ChatNode), typeof(ChatNodeRenderer)); this.StylesheetUri = new Uri(Path.Combine(Environment.CurrentDirectory, "StandardStyles.xaml"), UriKind.Absolute); }
private void AddChat(string sender, string message) { if (destination.InvokeRequired) { try { var d = new AddChatCallback(AddChat); Invoke(d, new[] { sender, message }); } catch (InvalidOperationException) { //This is probably safely ignored. } } else { chatBox.AddChat(sender, message); } }