|
|
@@ -1,4 +1,4 @@
|
|
|
-#if NET6_0_OR_GREATER
|
|
|
+
|
|
|
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
@@ -11,11 +11,15 @@ namespace QuestPDF.Previewer
|
|
|
{
|
|
|
public static class Extensions
|
|
|
{
|
|
|
+ #if NET6_0_OR_GREATER
|
|
|
+
|
|
|
+ /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="previewer.supported"]/*' />
|
|
|
public static void ShowInPreviewer(this IDocument document, int port = 12500)
|
|
|
{
|
|
|
document.ShowInPreviewerAsync(port).ConfigureAwait(true).GetAwaiter().GetResult();
|
|
|
}
|
|
|
|
|
|
+ /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="previewer.supported"]/*' />
|
|
|
public static async Task ShowInPreviewerAsync(this IDocument document, int port = 12500)
|
|
|
{
|
|
|
var previewerService = new PreviewerService(port);
|
|
|
@@ -60,7 +64,21 @@ namespace QuestPDF.Previewer
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ #else
|
|
|
+
|
|
|
+ /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="previewer.notSupported"]/*' />
|
|
|
+ public static void ShowInPreviewer(this IDocument document, int port = 12500)
|
|
|
+ {
|
|
|
+ throw new Exception("The hot-reload feature requires .NET 6 or later.");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <include file='../Resources/Documentation.xml' path='documentation/doc[@for="previewer.notSupported"]/*' />
|
|
|
+ public static async Task ShowInPreviewerAsync(this IDocument document, int port = 12500)
|
|
|
+ {
|
|
|
+ throw new Exception("The hot-reload feature requires .NET 6 or later.");
|
|
|
+ }
|
|
|
+
|
|
|
+ #endif
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-#endif
|