Пример #1
0
        private void BroadcastMessage(DebugEventArgs e)
        {
            DebugEventHandler temp = DebugEvent;

            if (temp != null)
            {
                foreach (DebugEventHandler handler in temp.GetInvocationList())
                {
                    handler.BeginInvoke(this, e, new AsyncCallback(BroadcastMessageCallback), null);
                }
            }
        }
Пример #2
0
        public static void WriteLine(string applicationName, string message)
        {
            DebugEventArgs e = new DebugEventArgs();

            e.ApplicationName = applicationName;
            e.Message         = message + Environment.NewLine;

            DebugEventHandler temp = DebugEvent;

            if (temp != null)
            {
                foreach (DebugEventHandler handler in temp.GetInvocationList())
                {
                    handler.BeginInvoke(null, e, new AsyncCallback(BroadcastMessageCallback), null);
                }
            }
        }
Пример #3
0
        public void Disconnect()
        {
            lock (syncObject)
            {
                apps.Remove(this.sessionId);
            }

            if (this.applicationName == null)
            {
                return;
            }

            DebugEvent -= debugEventHandler;

            DebugEventArgs e = new DebugEventArgs();

            e.ApplicationName = this.applicationName;
            e.Message         = "已断开连接.\r\n";

            BroadcastMessage(e);
        }