Yodiwo.DebugEx.AssertAndThrow C# (CSharp) Méthode

AssertAndThrow() public static méthode

public static AssertAndThrow ( bool Condition, string Error_Message, [ filePath = "", [ lineNumber, [ method = "" ) : void
Condition bool
Error_Message string
filePath [
lineNumber [
method [
Résultat void
        public static void AssertAndThrow(bool Condition, string Error_Message, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0, [CallerMemberNameAttribute] string method = "")
        {
            if (LogLevel > eTraceType.Critical)
                return;

            if (!Condition)
            {
#if TRACE
                Debug.Assert(false, Error_Message + Environment.NewLine);
                TraceError(Error_Message, filePath: filePath, lineNumber: lineNumber, method: method);
#endif
                throw new Exception(Error_Message);
            }
        }

Same methods

DebugEx::AssertAndThrow ( string Error_Message, [ filePath = "", [ lineNumber, [ method = "" ) : void