From dfb12644e1085f66353f8c3fbcaa69ebf3d20798 Mon Sep 17 00:00:00 2001 From: Chris Welch Date: Tue, 15 Sep 2020 11:04:47 +1200 Subject: [PATCH] Updated warnings documentation --- xUnitRevitUtils2021/xru.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/xUnitRevitUtils2021/xru.cs b/xUnitRevitUtils2021/xru.cs index 0d26aae..6a609fb 100644 --- a/xUnitRevitUtils2021/xru.cs +++ b/xUnitRevitUtils2021/xru.cs @@ -99,14 +99,15 @@ namespace xUnitRevitUtils } - /// - /// Runs an Action in a Revit transaction, uses TaskCompletionSource to communicate when done - /// - /// Action to run - /// Revit Document - /// Transaction Name - /// - public static Task RunInTransaction(Action action, Document doc, string transactionName = "transaction", bool ignoreWarnings = false) + /// + /// Runs an Action in a Revit transaction, uses TaskCompletionSource to communicate when done + /// + /// Action to run + /// Revit Document + /// Transaction Name + /// Enable to swallow all warnings generated by the transaction and prevent them from being raised within Revit + /// + public static Task RunInTransaction(Action action, Document doc, string transactionName = "transaction", bool ignoreWarnings = false) { var tcs = new TaskCompletionSource(); Queue.Add(new Action(() => @@ -141,7 +142,10 @@ namespace xUnitRevitUtils } - public class IgnoreAllWarnings : IFailuresPreprocessor + /// + /// A failures preprocesser that clears any failures that occur within a transaction + /// + internal class IgnoreAllWarnings : IFailuresPreprocessor { public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor) {