-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code cleanup, typos and things like that
- Loading branch information
Kees van Spelde
committed
Mar 12, 2024
1 parent
7b37520
commit f2dbfd3
Showing
11 changed files
with
263 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
using System; | ||
// | ||
// FileCacheHandler.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
|
||
using System; | ||
using System.IO; | ||
using System.Net; | ||
using System.Net.Http; | ||
|
@@ -11,7 +38,7 @@ | |
namespace ChromiumHtmlToPdfLib.Helpers; | ||
|
||
/// <summary> | ||
/// An <see cref="HttpClientHandler"/> that caches the response when requested | ||
/// A <see cref="HttpClientHandler"/> that caches the response when requested | ||
/// </summary> | ||
internal class FileCacheHandler : HttpClientHandler | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
using System.Globalization; | ||
// | ||
// FileManager.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
using System.Globalization; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
namespace ChromiumHtmlToPdfLib.Helpers; | ||
// | ||
// FitPageToContentResult.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
namespace ChromiumHtmlToPdfLib.Helpers; | ||
|
||
/// <summary> | ||
/// <see cref="DocumentHelper.FitPageToContentAsync"/> | ||
|
@@ -12,7 +38,7 @@ internal class FitPageToContentResult | |
internal bool Success { get; } | ||
|
||
/// <summary> | ||
/// <see cref="ConvertUri"/> of the output file"/> | ||
/// <see cref="ConvertUri"/> of the output file | ||
/// </summary> | ||
internal ConvertUri OutputUri { get; } | ||
#endregion | ||
|
@@ -22,7 +48,7 @@ internal class FitPageToContentResult | |
/// Makes this object and sets it's needed properties | ||
/// </summary> | ||
/// <param name="success"><c>true</c> when success otherwise <c>false</c></param> | ||
/// <param name="outputUri"><see cref="ConvertUri"/> of the output file"/></param> | ||
/// <param name="outputUri"><see cref="ConvertUri"/> of the output file</param> | ||
internal FitPageToContentResult(bool success, ConvertUri outputUri) | ||
{ | ||
Success = success; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
using System.Collections.Generic; | ||
// | ||
// SanitizeHtmlResult.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace ChromiumHtmlToPdfLib.Helpers; | ||
|
||
|
@@ -14,7 +40,7 @@ internal class SanitizeHtmlResult | |
internal bool Success { get; } | ||
|
||
/// <summary> | ||
/// <see cref="ConvertUri"/> of the output file"/> | ||
/// <see cref="ConvertUri"/> of the output file | ||
/// </summary> | ||
internal ConvertUri OutputUri { get; } | ||
|
||
|
@@ -29,7 +55,7 @@ internal class SanitizeHtmlResult | |
/// Makes this object and sets it's needed properties | ||
/// </summary> | ||
/// <param name="success"><c>true</c> when success otherwise <c>false</c></param> | ||
/// <param name="outputUri"><see cref="ConvertUri"/> of the output file"/></param> | ||
/// <param name="outputUri"><see cref="ConvertUri"/> of the output file</param> | ||
/// <param name="safeUrls">A list of safe URL's</param> | ||
internal SanitizeHtmlResult(bool success, ConvertUri outputUri, List<string> safeUrls) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,28 @@ | ||
using System.Collections.Generic; | ||
// | ||
// ValidateImagesResult.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
namespace ChromiumHtmlToPdfLib.Helpers; | ||
|
||
|
@@ -14,7 +38,7 @@ internal class ValidateImagesResult | |
internal bool Success { get; } | ||
|
||
/// <summary> | ||
/// <see cref="ConvertUri"/> of the output file"/> | ||
/// <see cref="ConvertUri"/> of the output file | ||
/// </summary> | ||
internal ConvertUri OutputUri { get; } | ||
#endregion | ||
|
@@ -24,7 +48,7 @@ internal class ValidateImagesResult | |
/// Makes this object and sets it's needed properties | ||
/// </summary> | ||
/// <param name="success"><c>true</c> when success otherwise <c>false</c></param> | ||
/// <param name="outputUri"><see cref="ConvertUri"/> of the output file"/></param> | ||
/// <param name="outputUri"><see cref="ConvertUri"/> of the output file</param> | ||
internal ValidateImagesResult(bool success, ConvertUri outputUri) | ||
{ | ||
Success = success; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
// ReSharper disable UnusedMember.Global | ||
// | ||
// Console.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
// ReSharper disable UnusedMember.Global | ||
namespace ChromiumHtmlToPdfLib.Loggers; | ||
|
||
/// <summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
namespace ChromiumHtmlToPdfLib.Loggers; | ||
// | ||
// File.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
namespace ChromiumHtmlToPdfLib.Loggers; | ||
|
||
/// <summary> | ||
/// Writes log information to a file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
using System; | ||
// | ||
// Logger.cs | ||
// | ||
// Author: Kees van Spelde <[email protected]> | ||
// | ||
// Copyright (c) 2017-2024 Magic-Sessions. (www.magic-sessions.com) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
// | ||
|
||
using System; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace ChromiumHtmlToPdfLib.Loggers; | ||
|
@@ -20,7 +46,7 @@ internal class Logger | |
public ILogger? InternalLogger { get; set; } | ||
|
||
/// <summary> | ||
/// An unique id that can be used to identify the logging of the converter when | ||
/// A unique id that can be used to identify the logging of the converter when | ||
/// calling the code from multiple threads and writing all the logging to the same file | ||
/// </summary> | ||
public string? InstanceId { get; set; } | ||
|
Oops, something went wrong.