System.Diagnostics.Trace.Assert C# (CSharp) Method

Assert() private method

private Assert ( bool condition ) : void
condition bool
return void
        public static void Assert(bool condition) { }
        [System.Diagnostics.ConditionalAttribute("TRACE")]

Same methods

Trace::Assert ( bool condition, string message ) : void
Trace::Assert ( bool condition, string message, string detailMessage ) : void

Usage Example

Beispiel #1
0
        /// <summary>
        /// This "assert" is executed in DEBUG and RELEASE modes. Use it in code that that won't suffer from more work (e.g. loading), not in frequently used loops
        /// </summary>
        /// <param name="condition"></param>
        public static void AssertRelease(bool condition, string assertMessage)
        {
            if (condition == false)
            {
                MyLog.Default.WriteLine("Assert: " + assertMessage);
            }

            SystemTrace.Assert(condition, assertMessage);
        }