Esempio n. 1
0
        protected virtual bool LogDebug(string Data, bool warning)
        {
            DebugEventArgs args = new DebugEventArgs(Data, warning);

            On_Debug(this, args);

            return true;
        }
Esempio n. 2
0
        protected virtual Boolean LogDebug(String Data) 
        {
            DebugEventArgs args = new DebugEventArgs(Data);

            On_Debug(this, args);

            return true;
        }
Esempio n. 3
0
 public virtual void LogDebug(String Data, bool warning = false)
 {
     //Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data);
     if (Debug != null)
     {
         DebugEventArgs args = new DebugEventArgs(Data, warning);
         OnDebug(this, args);
     }
 }
Esempio n. 4
0
        private void AddDebugModel(DebugEventArgs debugEventArgs)
        {
            this._debugModels.Add(
                new DebugModel(debugEventArgs.DebugLog.DateTime,
                               debugEventArgs.DebugLog.Description,
                               debugEventArgs.DebugLog.DebugLogType,
                               debugEventArgs.DebugLog.Index));

            this.OnPropertyChanged("DebugModelList");
        }
Esempio n. 5
0
        private void WebControl_DebugToolOpened(object sender, DebugEventArgs eventArgs)
        {
            var webControl = WpfDoubleBrowserNavigator.WebControl;

            _DebugInformation.IsInspecting = eventArgs.Opening;
            if (!eventArgs.Opening && (webControl != null))
            {
                webControl.DebugToolOpened -= WebControl_DebugToolOpened;
            }
        }
        /// <param name="args">Arguments passed from Debug.Assert.</param>
        public AssertScreen(DebugEventArgs args)
            : base()
        {
            assertText = new List <AssertText>();

            int          width  = VolumetricRenderer.Game.GraphicsDevice.PresentationParameters.BackBufferWidth;
            SpriteFontEx fontEx = VolumetricRenderer.Game.ScreenManager.DefaultFontEx;

            // Set up all the text to be drawn.
            float yPos = 0;

            PlaceAssertText("ASSERT:", ref yPos, ref fontEx, width);

            if (args.Messages.Length > 0)
            {
                for (int i = 0; i < args.Messages.Length; ++i)
                {
                    PlaceAssertText(args.Messages[i], ref yPos, ref fontEx, width);
                    yPos += fontEx.font.LineSpacing;
                }
            }
            else
            {
                PlaceAssertText("(no info)", ref yPos, ref fontEx, width);
                yPos += fontEx.font.LineSpacing;
            }

            PlaceAssertText("IN:", ref yPos, ref fontEx, width);
            PlaceAssertText(args.MethodName, ref yPos, ref fontEx, width);
            PlaceAssertText(args.FileName + ": line " + args.LineNumber, ref yPos, ref fontEx, width);

            yPos += fontEx.font.LineSpacing * 2;
            PlaceAssertText("Press Enter to quit...", ref yPos, ref fontEx, width);

            // Shift all the text down a bit so it's not right at the top of the screen.
            int height  = VolumetricRenderer.Game.GraphicsDevice.PresentationParameters.BackBufferHeight;
            int yOffset = (height - (fontEx.font.LineSpacing * (assertText.Count + 4))) / 3;

            if (yOffset < 5)
            {
                yOffset = 5;
            }

            for (int i = 0; i < assertText.Count; ++i)
            {
                AssertText at = assertText[i];
                at.position.Y += yOffset;
                assertText[i]  = at;
            }

            // Set up the flashing text parameters.
            flashColor = Color.White;
            flashRate  = TimeSpan.FromMilliseconds(700);
            flashDir   = -1;
        }
Esempio n. 7
0
 protected void OnDebug(DebugEventArgs e)
 {
     if (DebugEvent != null)
     { // 如果有对象注册
         foreach (DebugEventHandler de in DebugEvent.GetInvocationList())
         {
             //Console.WriteLine("DebugEvent begin...");
             de.BeginInvoke(this, e, new AsyncCallback(DebugCallBack), de);
         }
     }
 }
Esempio n. 8
0
 public void HandleBindResultEvent(DebugEventArgs args)
 {
     if (args.Event is IDebugBreakpointBoundEvent2)
     {
         HandleBoundEvent((IDebugBreakpointBoundEvent2)args.Event);
     }
     else if (args.Event is IDebugBreakpointErrorEvent2)
     {
         HandleErrorEvent((IDebugBreakpointErrorEvent2)args.Event);
     }
 }
Esempio n. 9
0
        /// <summary>
        /// Event handler for an assert.
        /// </summary>
        /// <param name="sender">Because Debug is a static class, this is always NULL.</param>
        /// <param name="args">Info about the assert.</param>
        private void HandleAssert(object sender, DebugEventArgs args)
        {
            updateMethod = Update_Assert;
            drawMethod   = Draw_Assert;

            // This method is running on the thread that asserted, so start a new thread for the
            // handler so it can kill off all the worker threads without killing itself.
            //handleAssertThread = new Thread(new ParameterizedThreadStart(HandleAssertThread));
            //handleAssertThread.Name = "HandleAssert";
            //handleAssertThread.IsBackground = true;
            //handleAssertThread.Start(args);
            HandleAssertThread(args);
        }
Esempio n. 10
0
        protected void OnDebug(object sender, DebugEventArgs e)
        {
            lock (rootHub)
            {
                using (StreamWriter fs = new StreamWriter(m_Log, true))
                {
                    fs.Write(String.Format("{0}.{1} {2}\r\n", e.Time, e.Time.Millisecond.ToString("000"), e.Data));
                    fs.Flush();

                    fs.Close();
                }
            }
        }
        /// <param name="args">Arguments passed from Debug.Assert.</param>
        public AssertScreen(DebugEventArgs args)
            : base()
        {
            assertText = new List<AssertText>();

            int width = VolumetricRenderer.Game.GraphicsDevice.PresentationParameters.BackBufferWidth;
            SpriteFontEx fontEx = VolumetricRenderer.Game.ScreenManager.DefaultFontEx;

            // Set up all the text to be drawn.
            float yPos = 0;
            PlaceAssertText("ASSERT:", ref yPos, ref fontEx, width);

            if (args.Messages.Length > 0)
                for (int i = 0; i < args.Messages.Length; ++i)
                {
                    PlaceAssertText(args.Messages[i], ref yPos, ref fontEx, width);
                    yPos += fontEx.font.LineSpacing;
                }
            else
            {
                PlaceAssertText("(no info)", ref yPos, ref fontEx, width);
                yPos += fontEx.font.LineSpacing;
            }

            PlaceAssertText("IN:", ref yPos, ref fontEx, width);
            PlaceAssertText(args.MethodName, ref yPos, ref fontEx, width);
            PlaceAssertText(args.FileName + ": line " + args.LineNumber, ref yPos, ref fontEx, width);

            yPos += fontEx.font.LineSpacing * 2;
            PlaceAssertText("Press Enter to quit...", ref yPos, ref fontEx, width);

            // Shift all the text down a bit so it's not right at the top of the screen.
            int height = VolumetricRenderer.Game.GraphicsDevice.PresentationParameters.BackBufferHeight;
            int yOffset = (height - (fontEx.font.LineSpacing * (assertText.Count + 4))) / 3;
            if (yOffset < 5)
                yOffset = 5;

            for (int i = 0; i < assertText.Count; ++i)
            {
                AssertText at = assertText[i];
                at.position.Y += yOffset;
                assertText[i] = at;
            }

            // Set up the flashing text parameters.
            flashColor = Color.White;
            flashRate = TimeSpan.FromMilliseconds(700);
            flashDir = -1;
        }
Esempio n. 12
0
 private void EventsService_DebugActionChanged(object sender, DebugEventArgs e)
 {
     _output.Activate(Output.SDDebugOutputPane);
     _output.DebugOutLine(e.DebugAction.ToString());
     if (e.DebugAction == DebugAction.Launched)
     {
         StartDebug();
     }
     else if (e.DebugAction == DebugAction.Detaching)
     {
         ATServiceProvider.EventsService.DebugActionChanged -= EventsService_DebugActionChanged;
         _commands.EnableUpload();
         _debugger.Stop();
     }
 }
Esempio n. 13
0
 protected void OnDebug(object sender, DebugEventArgs e)
 {
     lock (rootHub)
     {
         try
         {
             using (StreamWriter fs = new StreamWriter(m_Log, true))
             {
                 fs.Write(String.Format("{0} {1}\r\n", e.Time.ToString("yyyy-MM-dd HH:mm:ss.fff"), e.Data));
                 fs.Flush();
             }
         }
         catch { }
     }
 }
Esempio n. 14
0
        /// <summary>
        /// Thread for handling an assert, so it can kill off other threads without being affected.
        /// </summary>
        /// <param name="obj">DebugEventArgs instance.</param>
        private void HandleAssertThread(object obj)
        {
            DebugEventArgs args = (DebugEventArgs)obj;

            // Abort all worker threads, and give them plenty of time to do so.
            //updateThread.Abort();
            //drawThread.Abort();
            //Thread.Sleep(TimeSpan.FromSeconds(2));

            Components.Clear();
            Components.Add(screenManager);

            screenManager.RemoveAllScreens();
            screenManager.AddScreen(new AssertScreen(args));

            assertHandled = true;
            //Debug.UnblockAssert();
        }
Esempio n. 15
0
        private void ServiceListerner()
        {
            using (HttpListener listerner = new HttpListener())
            {
                listerner.AuthenticationSchemes = AuthenticationSchemes.Anonymous;//指定身份验证 Anonymous匿名访问
                listerner.Prefixes.Add("http://+:8500/testM/");

                // listerner.Prefixes.Add("http://localhost/web/");
                listerner.Start();
                Console.WriteLine("ClientServer:8500 Start Successed.......");
                //listerner.BeginGetContext();//异步调用(并发处理,暂时不需要)
                while (true)
                {
                    //等待请求连接
                    //没有请求则GetContext处于阻塞状态
                    HttpListenerContext ctx = listerner.GetContext();
                    ctx.Response.StatusCode = 200;//设置返回给客服端http状态代码
                    ctx.Response.Headers.Add("Access-Control-Allow-Origin", "*");
                    string runType = ctx.Request.QueryString["runType"];


                    StreamReader reader = new StreamReader(ctx.Request.InputStream);
                    if (runType == "Debug")//没有就是调试模式
                    {
                        try
                        {
                            XElement xe = XElement.Parse(reader.ReadToEnd());

                            DebugEventArgs e = new DebugEventArgs(xe);
                            OnDebug(e); // 调试
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine("调试模式错误.......err:" + e.Message);
                        }
                    }
                    else if (runType == "Scene")//场景处理
                    {
                        OnScene();
                    }
                    ctx.Response.Close();
                }
            }
        }
        protected Task OnDebugEvent(DebugEventArgs e)
        {
            try
            {
                lock (this.Items)
                {
                    this.Items.Add(e);
                    this.OnPropertyChanged("Items");
                }
            }
            catch
            {
                // ****
                // *** Discard
                // ***
            }

            return(Task.FromResult(0));
        }
Esempio n. 17
0
 /// <summary>
 /// 调试信息输出
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void AirCatApi_OnDebug(object sender, DebugEventArgs e)
 {
     Console.WriteLine(e.ToString());
 }
Esempio n. 18
0
		public virtual void LogDebug(string Data, bool warning = false)
		{
			Console.WriteLine(DateTime.Now.ToString("G") + "> " + Data);
			if (Debug == null)
			{
				return;
			}
			DebugEventArgs args = new DebugEventArgs(Data, warning);
			OnDebug(this, args);
		}
Esempio n. 19
0
 static void PrintDebugOutput(Object sender, DebugEventArgs e)
 {
     Console.WriteLine(e.DebugOutput);
 }
		protected Task OnExceptionEvent(DebugEventArgs e)
		{
			try
			{
				lock (this.Items)
				{
					this.Items.Add(e);
					this.OnPropertyChanged("Items");
				}
			}
			catch
			{
				// ****
				// *** Discard
				// ***
			}

			return Task.FromResult(0);
		}
Esempio n. 21
0
 protected virtual void On_Debug(object sender, DebugEventArgs e)     
 {
     if (Debug != null) Debug(sender, e);
 }
Esempio n. 22
0
 protected void On_Debug(object sender, DebugEventArgs e)
 {
     logWriter.WriteLine(e.Time + ":\t" + e.Data);
     logWriter.Flush();
 }
        /// <summary>
        /// Event handler for an assert.
        /// </summary>
        /// <param name="sender">Because Debug is a static class, this is always NULL.</param>
        /// <param name="args">Info about the assert.</param>
        private void HandleAssert(object sender, DebugEventArgs args)
        {
            updateMethod = Update_Assert;
            drawMethod = Draw_Assert;

            // This method is running on the thread that asserted, so start a new thread for the
            // handler so it can kill off all the worker threads without killing itself.
            //handleAssertThread = new Thread(new ParameterizedThreadStart(HandleAssertThread));
            //handleAssertThread.Name = "HandleAssert";
            //handleAssertThread.IsBackground = true;
            //handleAssertThread.Start(args);
            HandleAssertThread(args);
        }
Esempio n. 24
0
 /// <summary>
 ///     Logs the specified error message.
 /// </summary>
 private static void Error(object sender, DebugEventArgs args)
 {
     MSDebug.WriteLine("[ERROR] " + args.Text);
 }
Esempio n. 25
0
 protected virtual void On_Debug(object sender, DebugEventArgs e)
 {
     Debug?.Invoke(sender, e);
 }
Esempio n. 26
0
        protected virtual Boolean LogDebug(byte[] array)
        {
            string dataStr = "";
            for (byte i = 0; i < array.Length; i++)
            {
                dataStr = String.Format("{0}{1:X2} ", dataStr, array[i]);
            }
            DebugEventArgs args = new DebugEventArgs(dataStr);

            On_Debug(this, args);
            return true;
        }
Esempio n. 27
0
 /// <summary>Raises the <see cref="DebugMessage"/> event.</summary>
 /// <param name="e">
 ///     The <see cref="DebugEventArgs" /> instance containing the
 ///     event data.
 /// </param>
 /// <autogeneratedoc />
 /// TODO Edit XML Comment Template for OnDebugMessage
 private void OnDebugMessage(DebugEventArgs e)
 {
     Logger?.Debug(e.Message);
     DebugMessage?.Invoke(this, e);
 }
Esempio n. 28
0
 void c8CHIP8_onDebugMessage(object sender, DebugEventArgs e)
 {
     dbgConsole.AddLine(e.Message);
 }
Esempio n. 29
0
 private void On_Debug(object sender, DebugEventArgs e)
 {
     //logWriter.WriteLine(e.Time + ":\t" + e.Data);
     //logWriter.Flush();
     LogDebug(e.Time, e.Data, e.Warning);
 }
Esempio n. 30
0
 private void ShowNotification(object sender, DebugEventArgs args)
 {
     if ((ActiveForm != this) && ((Global.Notifications == 2) || ((Global.Notifications == 1) && args.Warning) || (sender != null)))
     {
         notifyIcon1.BalloonTipText = args.Data;
         notifyIcon1.BalloonTipTitle = "DS4Windows";
         notifyIcon1.ShowBalloonTip(1);
     }
 }
Esempio n. 31
0
		public virtual void OnDebug(object sender, DebugEventArgs args)
		{
			Debug?.Invoke(this, args);
		}
Esempio n. 32
0
 //Debug
 private void Debug(object sender, DebugEventArgs e)
 {
     log.WriteLog(e.DebugMsg);
     AddDebugMessage(e.DebugMsg);
 }
 /// <summary>
 /// Raises the Assert event so the assert can be handled.
 /// </summary>
 /// <param name="args">Info to pass to event handlers.</param>
 private static void RaiseAssertEvent(DebugEventArgs args)
 {
     if (OnAssert != null)
         OnAssert(null, args);
 }
Esempio n. 34
0
 private void OnDebugOutput(object sender, DebugEventArgs debugEventArgs)
 {
     this.AddDebugModel(debugEventArgs);
 }
Esempio n. 35
0
 private void AirCatApi_OnDebug(object sender, DebugEventArgs e)
 {
     WriteLog(e.DebugMessage);
 }
Esempio n. 36
0
 //Debug
 private void Debug(object sender, DebugEventArgs e)
 {
     AddDebugMessage(e.DebugMsg);
 }
Esempio n. 37
0
 /// <summary>
 ///     Print the specified message.
 /// </summary>
 private static void Print(object sender, DebugEventArgs args)
 {
     MSDebug.WriteLine("[DEBUG] " + args.Text);
 }
Esempio n. 38
0
 /// <summary>
 ///     Logs the specified warning message.
 /// </summary>
 private static void Warning(object sender, DebugEventArgs args)
 {
     MSDebug.WriteLine("[WARNING] " + args.Text);
 }
Esempio n. 39
0
 static void PrintDebugOutput(Object sender, DebugEventArgs e)
 {
     Console.WriteLine(e.DebugOutput);
 }