Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
 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);
     }
 }