TheSwamp

Code Red => .NET => Topic started by: Glenn R on August 01, 2008, 12:10:53 PM

Title: Debugging Attribute
Post by: Glenn R on August 01, 2008, 12:10:53 PM
May make your debugging (http://blogs.msdn.com/pedram/archive/2008/07/20/net-debugging-made-easier.aspx) life easier.
Title: Re: Debugging Attribute
Post by: David Hall on August 01, 2008, 04:02:24 PM
Thanks
Title: Re: Debugging Attribute
Post by: Jeff_M on August 01, 2008, 08:56:24 PM
Yes, thanks Glenn. Nice little find.
Title: Re: Debugging Attribute
Post by: Kerry on August 01, 2008, 09:51:56 PM

great link Glenn
Title: Re: Debugging Attribute
Post by: Glenn R on August 02, 2008, 04:53:57 AM
Taken from the news channel when you start Visual Studio 2008 BTW...first link yesterday. It's very interesting what you can find on it actually.
Title: Re: Debugging Attribute
Post by: It's Alive! on August 02, 2008, 09:37:56 AM
Great find Glenn,

Another useful attribute is ;
Code: [Select]
[System.Diagnostics.Conditional()]
example;

Code: [Select]
    [System.Diagnostics.Conditional("DEBUG")]
    internal static void DEBUG_PRINT_VAL(object o)
    {
      DEBUG_PRINT_VAL(string.Empty, o);
    }
    [System.Diagnostics.Conditional("DEBUG")]
    internal static void DEBUG_PRINT_VAL(string varname , object o)
    {
      AcAp.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(varname + o.ToString());
    }

    [CommandMethod("test")]
    public static void test()
    {
      Point3d A = Point3d.Origin;

      //if DEBUG is not defined, the compiler will remove this call
      DEBUG_PRINT_VAL(A);
    }