Skip to content

Commit 670c833

Browse files
committed
Code tweaks to support CommunityToolkit#3293
1 parent db8af7f commit 670c833

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Microsoft.Toolkit/Diagnostics/ThrowHelper.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
using System.ComponentModel;
77
using System.Diagnostics.CodeAnalysis;
88
using System.IO;
9+
#if !NETSTANDARD1_4
910
using System.Runtime.InteropServices;
11+
#endif
1012
using System.Threading;
1113

1214
#nullable enable
@@ -172,6 +174,7 @@ public static void ThrowArgumentOutOfRangeException(string name, object value, s
172174
throw new ArgumentOutOfRangeException(name, value, message);
173175
}
174176

177+
#if !NETSTANDARD1_4
175178
/// <summary>
176179
/// Throws a new <see cref="ExternalException"/>.
177180
/// </summary>
@@ -206,6 +209,7 @@ public static void ThrowExternalException(string message, int error)
206209
{
207210
throw new ExternalException(message, error);
208211
}
212+
#endif
209213

210214
/// <summary>
211215
/// Throws a new <see cref="FormatException"/>.
@@ -230,6 +234,7 @@ public static void ThrowFormatException(string message, Exception innerException
230234
throw new FormatException(message, innerException);
231235
}
232236

237+
#if !NETSTANDARD1_4
233238
/// <summary>
234239
/// Throws a new <see cref="InsufficientMemoryException"/>.
235240
/// </summary>
@@ -252,6 +257,7 @@ public static void ThrowInsufficientMemoryException(string message, Exception in
252257
{
253258
throw new InsufficientMemoryException(message, innerException);
254259
}
260+
#endif
255261

256262
/// <summary>
257263
/// Throws a new <see cref="InvalidDataException"/>.
@@ -345,6 +351,7 @@ public static void ThrowMissingFieldException(string message, Exception innerExc
345351
throw new MissingFieldException(message, innerException);
346352
}
347353

354+
#if !NETSTANDARD1_4
348355
/// <summary>
349356
/// Throws a new <see cref="MissingFieldException"/>.
350357
/// </summary>
@@ -356,6 +363,7 @@ public static void ThrowMissingFieldException(string className, string fieldName
356363
{
357364
throw new MissingFieldException(className, fieldName);
358365
}
366+
#endif
359367

360368
/// <summary>
361369
/// Throws a new <see cref="MissingMemberException"/>.
@@ -380,6 +388,7 @@ public static void ThrowMissingMemberException(string message, Exception innerEx
380388
throw new MissingMemberException(message, innerException);
381389
}
382390

391+
#if !NETSTANDARD1_4
383392
/// <summary>
384393
/// Throws a new <see cref="MissingMemberException"/>.
385394
/// </summary>
@@ -391,6 +400,7 @@ public static void ThrowMissingMemberException(string className, string memberNa
391400
{
392401
throw new MissingMemberException(className, memberName);
393402
}
403+
#endif
394404

395405
/// <summary>
396406
/// Throws a new <see cref="MissingMethodException"/>.
@@ -415,6 +425,7 @@ public static void ThrowMissingMethodException(string message, Exception innerEx
415425
throw new MissingMethodException(message, innerException);
416426
}
417427

428+
#if !NETSTANDARD1_4
418429
/// <summary>
419430
/// Throws a new <see cref="MissingMethodException"/>.
420431
/// </summary>
@@ -426,6 +437,7 @@ public static void ThrowMissingMethodException(string className, string methodNa
426437
{
427438
throw new MissingMethodException(className, methodName);
428439
}
440+
#endif
429441

430442
/// <summary>
431443
/// Throws a new <see cref="NotSupportedException"/>.

0 commit comments

Comments
 (0)