Simplified usages

This commit is contained in:
Yoshi Askharoun
2021-07-11 23:07:04 -05:00
parent f793c0c94f
commit dfb03d2ec5
242 changed files with 2240 additions and 2240 deletions
@@ -16,56 +16,56 @@ namespace Microsoft.Iris.Render.Common
internal static IDebug Module
{
get => Debug2.s_debug;
set => Debug2.s_debug = value;
get => s_debug;
set => s_debug = value;
}
[Conditional("DEBUG")]
internal static void Enter(string stBlock)
{
if (Debug2.s_debug == null)
if (s_debug == null)
return;
Debug2.s_debug.Enter(stBlock);
s_debug.Enter(stBlock);
}
[Conditional("DEBUG")]
internal static void Leave(string stBlock)
{
if (Debug2.s_debug == null)
if (s_debug == null)
return;
Debug2.s_debug.Leave(stBlock);
s_debug.Leave(stBlock);
}
[Conditional("DEBUG")]
internal static void Assert(bool condition, string stMessage)
{
if (condition || Debug2.s_debug == null)
if (condition || s_debug == null)
return;
Debug2.s_debug.Assert(condition, stMessage);
s_debug.Assert(condition, stMessage);
}
[Conditional("DEBUG")]
internal static void Assert(bool condition, string format, object arg1)
{
if (condition || Debug2.s_debug == null)
if (condition || s_debug == null)
return;
Debug2.s_debug.Assert(condition, string.Format(format, arg1));
s_debug.Assert(condition, string.Format(format, arg1));
}
[Conditional("DEBUG")]
internal static void Assert(bool condition, string format, object arg1, object arg2)
{
if (condition || Debug2.s_debug == null)
if (condition || s_debug == null)
return;
Debug2.s_debug.Assert(condition, string.Format(format, arg1, arg2));
s_debug.Assert(condition, string.Format(format, arg1, arg2));
}
internal static void Throw(bool condition, string format)
{
if (!condition)
{
if (Debug2.s_debug != null)
Debug2.s_debug.Throw(condition, format);
if (s_debug != null)
s_debug.Throw(condition, format);
throw new InvalidOperationException(format);
}
}
@@ -74,9 +74,9 @@ namespace Microsoft.Iris.Render.Common
{
if (!condition)
{
if (Debug2.s_debug != null)
Debug2.s_debug.Throw(condition, string.Format(format, arg1));
throw new InvalidOperationException(string.Format((IFormatProvider)CultureInfo.InvariantCulture, format, arg1));
if (s_debug != null)
s_debug.Throw(condition, string.Format(format, arg1));
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, format, arg1));
}
}
@@ -103,17 +103,17 @@ namespace Microsoft.Iris.Render.Common
[Conditional("DEBUG")]
internal static void Write(DebugCategory category, int verbosityLevel, string message)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.Write(category, verbosityLevel, message);
s_debug.Write(category, verbosityLevel, message);
}
[Conditional("DEBUG")]
internal static void WriteLine(DebugCategory category, int verbosityLevel, string format)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, format);
s_debug.WriteLine(category, verbosityLevel, format);
}
[Conditional("DEBUG")]
@@ -123,9 +123,9 @@ namespace Microsoft.Iris.Render.Common
string format,
object arg1)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1));
}
[Conditional("DEBUG")]
@@ -136,9 +136,9 @@ namespace Microsoft.Iris.Render.Common
object arg1,
object arg2)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2));
}
[Conditional("DEBUG")]
@@ -150,9 +150,9 @@ namespace Microsoft.Iris.Render.Common
object arg2,
object arg3)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3));
}
[Conditional("DEBUG")]
@@ -165,9 +165,9 @@ namespace Microsoft.Iris.Render.Common
object arg3,
object arg4)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4));
}
[Conditional("DEBUG")]
@@ -181,9 +181,9 @@ namespace Microsoft.Iris.Render.Common
object arg4,
object arg5)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5));
}
[Conditional("DEBUG")]
@@ -198,9 +198,9 @@ namespace Microsoft.Iris.Render.Common
object arg5,
object arg6)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6));
}
[Conditional("DEBUG")]
@@ -216,25 +216,25 @@ namespace Microsoft.Iris.Render.Common
object arg6,
object arg7)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7));
s_debug.WriteLine(category, verbosityLevel, string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7));
}
[Conditional("DEBUG")]
internal static void Indent(DebugCategory category, int verbosityLevel)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.Indent(category, verbosityLevel);
s_debug.Indent(category, verbosityLevel);
}
[Conditional("DEBUG")]
internal static void Unindent(DebugCategory category, int verbosityLevel)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
return;
Debug2.s_debug.Unindent(category, verbosityLevel);
s_debug.Unindent(category, verbosityLevel);
}
[Conditional("DEBUG")]
@@ -254,7 +254,7 @@ namespace Microsoft.Iris.Render.Common
string format,
object arg1)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
;
}
@@ -266,7 +266,7 @@ namespace Microsoft.Iris.Render.Common
object arg1,
object arg2)
{
if (!Debug2.IsCategoryEnabled(category, verbosityLevel))
if (!IsCategoryEnabled(category, verbosityLevel))
;
}
@@ -275,7 +275,7 @@ namespace Microsoft.Iris.Render.Common
{
}
internal static bool IsCategoryEnabled(DebugCategory category, int verbosityLevel) => Debug2.s_debug != null && Debug2.s_debug.IsCategoryEnabled(category, verbosityLevel);
internal static bool IsCategoryEnabled(DebugCategory category, int verbosityLevel) => s_debug != null && s_debug.IsCategoryEnabled(category, verbosityLevel);
internal static void DumpException(Debug2.ExceptionType exceptionType, Exception e)
{