From 30b4d92291e49a828d7df59e7ea4132796fce7b6 Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 15 Nov 2025 07:55:12 +0100 Subject: [PATCH 1/3] Add GitHub Action to check trailing whitespace on PRs --- .../workflows/trailing-whitespace-check.yml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/trailing-whitespace-check.yml diff --git a/.github/workflows/trailing-whitespace-check.yml b/.github/workflows/trailing-whitespace-check.yml new file mode 100644 index 0000000..299bb98 --- /dev/null +++ b/.github/workflows/trailing-whitespace-check.yml @@ -0,0 +1,85 @@ +name: Trailing Whitespace Check + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-trailing-whitespace: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for trailing whitespace + run: | + echo "Checking for trailing whitespace in changed files..." + + # Get the base branch + BASE_SHA="${{ github.event.pull_request.base.sha }}" + HEAD_SHA="${{ github.event.pull_request.head.sha }}" + + # Get list of changed files (excluding deleted files) + CHANGED_FILES=$(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA") + + if [ -z "$CHANGED_FILES" ]; then + echo "No files to check." + exit 0 + fi + + # File patterns to check (text files) + PATTERNS="\.cs$|\.csproj$|\.sln$|\.ts$|\.html$|\.css$|\.scss$" + + # Directories and file patterns to exclude + EXCLUDE_PATTERNS="(^|\/)(\.|node_modules|bin|obj|artifacts|packages|\.vs|\.nuke\/temp)($|\/)" + + ERRORS_FOUND=0 + TEMP_FILE=$(mktemp) + + while IFS= read -r file; do + # Skip if file doesn't exist (shouldn't happen with --diff-filter=d, but just in case) + if [ ! -f "$file" ]; then + continue + fi + + # Check if file matches patterns to check + if ! echo "$file" | grep -qE "$PATTERNS"; then + continue + fi + + # Check if file should be excluded + if echo "$file" | grep -qE "$EXCLUDE_PATTERNS"; then + continue + fi + + # Find trailing whitespace lines, excluding XML doc placeholder lines that are exactly "/// " (one space) + MATCHES=$(grep -n '[[:space:]]$' "$file" | grep -vE '^[0-9]+:[[:space:]]*/// $' || true) + + if [ -n "$MATCHES" ]; then + echo "❌ Trailing whitespace found in: $file" + echo "$MATCHES" | head -10 + TOTAL=$(echo "$MATCHES" | wc -l) + if [ "$TOTAL" -gt 10 ]; then + echo " ... and $(($TOTAL - 10)) more lines" + fi + echo "1" >> "$TEMP_FILE" + fi + done <<< "$CHANGED_FILES" + + ERRORS_FOUND=$(wc -l < "$TEMP_FILE" 2>/dev/null || echo "0") + rm -f "$TEMP_FILE" + + if [ "$ERRORS_FOUND" -gt 0 ]; then + echo "" + echo "❌ Found trailing whitespace in $ERRORS_FOUND file(s)." + echo "Please remove trailing whitespace from the files listed above." + exit 1 + else + echo "✅ No trailing whitespace found in changed files." + exit 0 + fi From 30b547b8d3863313b1978f6405eea855b5fb2e53 Mon Sep 17 00:00:00 2001 From: softworkz Date: Fri, 14 Nov 2025 06:10:15 +0100 Subject: [PATCH 2/3] Add R# settings --- src/ElectronNET.sln.DotSettings | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/ElectronNET.sln.DotSettings diff --git a/src/ElectronNET.sln.DotSettings b/src/ElectronNET.sln.DotSettings new file mode 100644 index 0000000..1eab21f --- /dev/null +++ b/src/ElectronNET.sln.DotSettings @@ -0,0 +1,7 @@ + + False + False + True + True + True + True \ No newline at end of file From 8e7892ebd48dc4ee18ae32b5f8b2169d53a0b5fc Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 15 Nov 2025 08:05:31 +0100 Subject: [PATCH 3/3] Fix whitespace formatting --- nuke/ReleaseNotesParser.cs | 2 +- src/ElectronNET.API/API/ApiBase.cs | 4 +- src/ElectronNET.API/API/App.cs | 9 +- src/ElectronNET.API/API/AutoUpdater.cs | 30 +++-- src/ElectronNET.API/API/BrowserView.cs | 6 +- src/ElectronNET.API/API/BrowserWindow.cs | 106 +++++++++--------- src/ElectronNET.API/API/Clipboard.cs | 13 ++- src/ElectronNET.API/API/Cookies.cs | 4 +- src/ElectronNET.API/API/Dialog.cs | 24 ++-- src/ElectronNET.API/API/Dock.cs | 4 +- src/ElectronNET.API/API/Electron.cs | 4 +- .../API/Entities/AutoResizeOptions.cs | 2 +- .../API/Entities/BitmapOptions.cs | 2 +- .../API/Entities/BlockMapDataHolder.cs | 2 +- .../Entities/BrowserViewConstructorOptions.cs | 2 +- .../API/Entities/BrowserWindowOptions.cs | 7 +- src/ElectronNET.API/API/Entities/CPUUsage.cs | 4 +- .../API/Entities/ChromeExtensionInfo.cs | 2 +- .../API/Entities/ClearStorageDataOptions.cs | 2 +- .../API/Entities/CookieChangedCause.cs | 5 +- .../API/Entities/CookieDetails.cs | 2 +- .../API/Entities/CreateFromBitmapOptions.cs | 2 +- .../CreateInterruptedDownloadOptions.cs | 2 +- .../Entities/EnableNetworkEmulationOptions.cs | 2 +- src/ElectronNET.API/API/Entities/Extension.cs | 2 +- .../API/Entities/GPUFeatureStatus.cs | 1 - .../API/Entities/InputEvent.cs | 4 +- .../API/Entities/JumpListCategory.cs | 4 +- .../API/Entities/JumpListItem.cs | 5 +- .../API/Entities/MemoryInfo.cs | 2 +- src/ElectronNET.API/API/Entities/MenuItem.cs | 6 +- .../API/Entities/MessageBoxOptions.cs | 5 +- .../API/Entities/MessageBoxResult.cs | 2 +- .../API/Entities/NativeImageJsonConverter.cs | 3 +- .../API/Entities/OnDidFailLoadInfo.cs | 2 +- .../API/Entities/OnDidNavigateInfo.cs | 2 +- .../API/Entities/OpenDevToolsOptions.cs | 4 +- .../API/Entities/OpenDialogOptions.cs | 6 +- src/ElectronNET.API/API/Entities/PageSize.cs | 2 +- src/ElectronNET.API/API/Entities/PathName.cs | 4 +- .../API/Entities/ProcessVersions.cs | 2 +- .../API/Entities/ProgressBarOptions.cs | 4 +- .../API/Entities/ProgressInfo.cs | 2 +- .../API/Entities/ProxyConfig.cs | 2 +- .../API/Entities/ReleaseNoteInfo.cs | 2 +- .../API/Entities/RemovePassword.cs | 7 +- .../API/Entities/ResizeOptions.cs | 2 +- .../API/Entities/SaveDialogOptions.cs | 2 +- .../API/Entities/ShortcutLinkOperation.cs | 2 +- .../API/Entities/ThumbarButton.cs | 3 +- .../API/Entities/TitleBarStyle.cs | 1 - .../API/Entities/ToBitmapOptions.cs | 2 +- .../API/Entities/ToDataUrlOptions.cs | 2 +- .../API/Entities/ToPNGOptions.cs | 2 +- .../API/Entities/UpdateCheckResult.cs | 2 +- .../API/Entities/UpdateFileInfo.cs | 2 +- .../API/Entities/WebPreferences.cs | 2 +- .../API/Extensions/ThumbarButtonExtensions.cs | 2 +- src/ElectronNET.API/API/GlobalShortcut.cs | 6 +- src/ElectronNET.API/API/HostHook.cs | 11 +- src/ElectronNET.API/API/IpcMain.cs | 8 +- src/ElectronNET.API/API/Menu.cs | 4 +- src/ElectronNET.API/API/NativeTheme.cs | 6 +- src/ElectronNET.API/API/Notification.cs | 14 +-- src/ElectronNET.API/API/PowerMonitor.cs | 6 +- src/ElectronNET.API/API/Process.cs | 9 +- src/ElectronNET.API/API/Screen.cs | 9 +- src/ElectronNET.API/API/Session.cs | 4 +- src/ElectronNET.API/API/Shell.cs | 8 +- src/ElectronNET.API/API/Tray.cs | 10 +- src/ElectronNET.API/API/WebContents.cs | 18 ++- src/ElectronNET.API/API/WebRequest.cs | 2 +- src/ElectronNET.API/API/WindowManager.cs | 9 +- src/ElectronNET.API/Bridge/SocketIOFacade.cs | 2 +- src/ElectronNET.API/Common/Extensions.cs | 8 +- .../Converter/ModifierTypeListConverter.cs | 5 +- .../Converter/PageSizeConverter.cs | 3 +- .../Converter/TitleBarOverlayConverter.cs | 3 +- src/ElectronNET.API/ElectronNetRuntime.cs | 2 +- .../Runtime/Data/DotnetAppType.cs | 2 +- .../Runtime/Data/LifetimeState.cs | 2 +- .../Runtime/Data/StartupMethod.cs | 2 +- .../Runtime/Helpers/LaunchOrderDetector.cs | 2 +- .../Runtime/Helpers/PortHelper.cs | 3 +- .../Runtime/Helpers/UnpackagedDetector.cs | 2 +- .../Serialization/ElectronJson.cs | 3 +- .../ElectronNET.Build.csproj | 50 ++++----- src/ElectronNET.Host/api/process.ts | 2 +- src/ElectronNET.Host/api/screen.ts | 2 +- src/ElectronNET.Host/api/shell.ts | 2 +- .../Tests/AppTests.cs | 3 +- .../Tests/AutoUpdaterTests.cs | 37 +++--- .../Tests/BrowserViewTests.cs | 1 + .../Tests/CookiesTests.cs | 1 + .../Tests/IpcMainTests.cs | 1 + .../Tests/MenuTests.cs | 1 + .../Tests/NativeImageTests.cs | 2 +- .../Tests/NativeThemeTests.cs | 4 +- .../Tests/ProcessTests.cs | 20 ++-- .../Tests/ScreenTests.cs | 2 +- .../Tests/TrayTests.cs | 1 + .../Tests/WebContentsTests.cs | 4 +- .../Controllers/HomeController.cs | 2 +- .../Controllers/HostHookController.cs | 2 +- .../Controllers/UpdateController.cs | 2 +- .../ElectronHostHook/connector.ts | 4 +- 106 files changed, 296 insertions(+), 349 deletions(-) diff --git a/nuke/ReleaseNotesParser.cs b/nuke/ReleaseNotesParser.cs index d449a53..7b7f5f0 100644 --- a/nuke/ReleaseNotesParser.cs +++ b/nuke/ReleaseNotesParser.cs @@ -85,7 +85,7 @@ public sealed class ReleaseNotesParser // Parse content. var notes = new List(); - + while (true) { // Sanity checks. diff --git a/src/ElectronNET.API/API/ApiBase.cs b/src/ElectronNET.API/API/ApiBase.cs index f2b061c..95231fe 100644 --- a/src/ElectronNET.API/API/ApiBase.cs +++ b/src/ElectronNET.API/API/ApiBase.cs @@ -1,4 +1,5 @@ // ReSharper disable InconsistentNaming + namespace ElectronNET.API { using Common; @@ -17,6 +18,7 @@ namespace ElectronNET.API DashesLowerFirst, NoDashUpperFirst } + protected enum SocketTaskMessageNameTypes { DashesLowerFirst, @@ -370,4 +372,4 @@ namespace ElectronNET.API } } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/App.cs b/src/ElectronNET.API/API/App.cs index ee44f09..1c1ffc5 100644 --- a/src/ElectronNET.API/API/App.cs +++ b/src/ElectronNET.API/API/App.cs @@ -58,7 +58,7 @@ namespace ElectronNET.API private event Action _windowAllClosed; /// - /// Emitted before the application starts closing its windows. + /// Emitted before the application starts closing its windows. /// /// Note: If application quit was initiated by then /// is emitted after emitting close event on all windows and closing them. @@ -399,7 +399,6 @@ namespace ElectronNET.API private static object _syncRoot = new object(); - /// /// Try to close all windows. The event will be emitted first. If all windows are successfully /// closed, the event will be emitted and by default the application will terminate. This method @@ -558,7 +557,7 @@ namespace ElectronNET.API } /// - /// The version of the loaded application. If no version is found in the application’s package.json file, + /// The version of the loaded application. If no version is found in the application’s package.json file, /// the version of the current bundle or executable is returned. /// /// The version of the loaded application. @@ -1245,7 +1244,7 @@ namespace ElectronNET.API return Task.Run(() => { var taskCompletionSource = new TaskCompletionSource(); - + BridgeConnector.Socket.Once("appGetUserAgentFallbackCompleted", taskCompletionSource.SetResult); BridgeConnector.Socket.Emit("appGetUserAgentFallback"); @@ -1295,4 +1294,4 @@ namespace ElectronNET.API public async Task Once(string eventName, Action action) => await Events.Instance.Once(ModuleName, eventName, action).ConfigureAwait(false); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/AutoUpdater.cs b/src/ElectronNET.API/API/AutoUpdater.cs index 639cd8c..d0b178b 100644 --- a/src/ElectronNET.API/API/AutoUpdater.cs +++ b/src/ElectronNET.API/API/AutoUpdater.cs @@ -10,7 +10,7 @@ namespace ElectronNET.API /// /// Enable apps to automatically update themselves. Based on electron-updater. /// - public sealed class AutoUpdater: ApiBase + public sealed class AutoUpdater : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst; @@ -49,7 +49,7 @@ namespace ElectronNET.API } /// - /// *GitHub provider only.* Whether to allow update to pre-release versions. + /// *GitHub provider only.* Whether to allow update to pre-release versions. /// Defaults to "true" if application version contains prerelease components (e.g. "0.12.1-alpha.1", here "alpha" is a prerelease component), otherwise "false". /// /// If "true", downgrade will be allowed("allowDowngrade" will be set to "true"). @@ -67,7 +67,7 @@ namespace ElectronNET.API } /// - /// *GitHub provider only.* + /// *GitHub provider only.* /// Get all release notes (from current version to latest), not just the latest (Default is false). /// public bool FullChangelog @@ -122,7 +122,7 @@ namespace ElectronNET.API } /// - /// Get the update channel. Not applicable for GitHub. + /// Get the update channel. Not applicable for GitHub. /// Doesn’t return channel from the update configuration, only if was previously set. /// [Obsolete("Use the asynchronous version ChannelAsync instead")] @@ -135,7 +135,7 @@ namespace ElectronNET.API } /// - /// Get the update channel. Not applicable for GitHub. + /// Get the update channel. Not applicable for GitHub. /// Doesn’t return channel from the update configuration, only if was previously set. /// public Task ChannelAsync @@ -147,7 +147,7 @@ namespace ElectronNET.API } /// - /// Set the update channel. Not applicable for GitHub. + /// Set the update channel. Not applicable for GitHub. /// public string SetChannel { @@ -199,7 +199,7 @@ namespace ElectronNET.API } /// - /// Emitted when there is an available update. + /// Emitted when there is an available update. /// The update is downloaded automatically if AutoDownload is true. /// public event Action OnUpdateAvailable @@ -332,11 +332,11 @@ namespace ElectronNET.API } /// - /// Restarts the app and installs the update after it has been downloaded. - /// It should only be called after `update-downloaded` has been emitted. - /// - /// Note: QuitAndInstall() will close all application windows first and only emit `before-quit` event on `app` after that. - /// This is different from the normal quit event sequence. + /// Restarts the app and installs the update after it has been downloaded. + /// It should only be called after `update-downloaded` has been emitted. + /// + /// Note: QuitAndInstall() will close all application windows first and only emit `before-quit` event on `app` after that. + /// This is different from the normal quit event sequence. /// /// *windows-only* Runs the installer in silent mode. Defaults to `false`. /// Run the app after finish even on silent install. Not applicable for macOS. Ignored if `isSilent` is set to `false`. @@ -374,9 +374,5 @@ namespace ElectronNET.API return tcs.Task; } - - } -} - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/BrowserView.cs b/src/ElectronNET.API/API/BrowserView.cs index 3203073..21d393f 100644 --- a/src/ElectronNET.API/API/BrowserView.cs +++ b/src/ElectronNET.API/API/BrowserView.cs @@ -8,10 +8,11 @@ namespace ElectronNET.API /// It is like a child window, except that it is positioned relative to its owning window. /// It is meant to be an alternative to the webview tag. /// - public class BrowserView: ApiBase + public class BrowserView : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst; + /// /// Gets the identifier. /// @@ -69,5 +70,4 @@ namespace ElectronNET.API BridgeConnector.Socket.Emit("browserView-setBackgroundColor", Id, color); } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/BrowserWindow.cs b/src/ElectronNET.API/API/BrowserWindow.cs index 7cb9938..67f8b96 100644 --- a/src/ElectronNET.API/API/BrowserWindow.cs +++ b/src/ElectronNET.API/API/BrowserWindow.cs @@ -27,7 +27,7 @@ public class BrowserWindow : ApiBase public override int Id { get; protected set; } /// - /// Emitted when the web page has been rendered (while not being shown) and + /// Emitted when the web page has been rendered (while not being shown) and /// window can be displayed without a visual flash. /// public event Action OnReadyToShow @@ -55,8 +55,8 @@ public class BrowserWindow : ApiBase } /// - /// Emitted when the window is closed. - /// After you have received this event you should remove the + /// Emitted when the window is closed. + /// After you have received this event you should remove the /// reference to the window and avoid using it any more. /// public event Action OnClosed @@ -230,12 +230,12 @@ public class BrowserWindow : ApiBase } /// - /// Emitted when an App Command is invoked. These are typically related to - /// keyboard media keys or browser commands, as well as the “Back” button + /// Emitted when an App Command is invoked. These are typically related to + /// keyboard media keys or browser commands, as well as the “Back” button /// built into some mice on Windows. /// - /// Commands are lowercased, underscores are replaced with hyphens, - /// and the APPCOMMAND_ prefix is stripped off.e.g.APPCOMMAND_BROWSER_BACKWARD + /// Commands are lowercased, underscores are replaced with hyphens, + /// and the APPCOMMAND_ prefix is stripped off.e.g.APPCOMMAND_BROWSER_BACKWARD /// is emitted as browser-backward. /// public event Action OnAppCommand @@ -287,15 +287,15 @@ public class BrowserWindow : ApiBase } /// - /// Force closing the window, the unload and beforeunload event won’t be - /// emitted for the web page, and close event will also not be emitted + /// Force closing the window, the unload and beforeunload event won’t be + /// emitted for the web page, and close event will also not be emitted /// for this window, but it guarantees the closed event will be emitted. /// public void Destroy() => this.CallMethod0(); /// - /// Try to close the window. This has the same effect as a user manually - /// clicking the close button of the window. The web page may cancel the close though. + /// Try to close the window. This has the same effect as a user manually + /// clicking the close button of the window. The web page may cancel the close though. /// public void Close() => this.CallMethod0(); @@ -393,7 +393,7 @@ public class BrowserWindow : ApiBase public Task IsFullScreenAsync() => this.InvokeAsync(); /// - /// This will make a window maintain an aspect ratio. The extra size allows a developer to have space, + /// This will make a window maintain an aspect ratio. The extra size allows a developer to have space, /// specified in pixels, not included within the aspect ratio calculations. This API already takes into /// account the difference between a window’s size and its content size. /// @@ -401,7 +401,7 @@ public class BrowserWindow : ApiBase /// of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below /// the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within /// the player itself we would call this function with arguments of 16/9 and[40, 50]. The second argument - /// doesn’t care where the extra width and height are within the content view–only that they exist. Just + /// doesn’t care where the extra width and height are within the content view–only that they exist. Just /// sum any extra width and height areas you have within the overall content view. /// /// The aspect ratio to maintain for some portion of the content view. @@ -410,7 +410,7 @@ public class BrowserWindow : ApiBase this.CallMethod2(aspectRatio, extraSize); /// - /// This will make a window maintain an aspect ratio. The extra size allows a developer to have space, + /// This will make a window maintain an aspect ratio. The extra size allows a developer to have space, /// specified in pixels, not included within the aspect ratio calculations. This API already takes into /// account the difference between a window’s size and its content size. /// @@ -418,7 +418,7 @@ public class BrowserWindow : ApiBase /// of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below /// the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within /// the player itself we would call this function with arguments of 16/9 and[40, 50]. The second argument - /// doesn’t care where the extra width and height are within the content view–only that they exist. Just + /// doesn’t care where the extra width and height are within the content view–only that they exist. Just /// sum any extra width and height areas you have within the overall content view. /// /// The aspect ratio to maintain for some portion of the content view. @@ -429,18 +429,18 @@ public class BrowserWindow : ApiBase /// /// Uses Quick Look to preview a file at a given path. /// - /// The absolute path to the file to preview with QuickLook. This is important as - /// Quick Look uses the file name and file extension on the path to determine the content type of the + /// The absolute path to the file to preview with QuickLook. This is important as + /// Quick Look uses the file name and file extension on the path to determine the content type of the /// file to open. public void PreviewFile(string path) => this.CallMethod1(path); /// /// Uses Quick Look to preview a file at a given path. /// - /// The absolute path to the file to preview with QuickLook. This is important as - /// Quick Look uses the file name and file extension on the path to determine the content type of the + /// The absolute path to the file to preview with QuickLook. This is important as + /// Quick Look uses the file name and file extension on the path to determine the content type of the /// file to open. - /// The name of the file to display on the Quick Look modal view. This is + /// The name of the file to display on the Quick Look modal view. This is /// purely visual and does not affect the content type of the file. Defaults to path. public void PreviewFile(string path, string displayname) => this.CallMethod2(path, displayname); @@ -636,34 +636,34 @@ public class BrowserWindow : ApiBase public Task IsClosableAsync() => this.InvokeAsync(); /// - /// Sets whether the window should show always on top of other windows. - /// After setting this, the window is still a normal window, not a toolbox + /// Sets whether the window should show always on top of other windows. + /// After setting this, the window is still a normal window, not a toolbox /// window which can not be focused on. /// /// public void SetAlwaysOnTop(bool flag) => this.CallMethod1(flag); /// - /// Sets whether the window should show always on top of other windows. - /// After setting this, the window is still a normal window, not a toolbox + /// Sets whether the window should show always on top of other windows. + /// After setting this, the window is still a normal window, not a toolbox /// window which can not be focused on. /// /// - /// Values include normal, floating, torn-off-menu, modal-panel, main-menu, - /// status, pop-up-menu and screen-saver. The default is floating. + /// Values include normal, floating, torn-off-menu, modal-panel, main-menu, + /// status, pop-up-menu and screen-saver. The default is floating. /// See the macOS docs public void SetAlwaysOnTop(bool flag, OnTopLevel level) => this.CallMethod2(flag, level.GetDescription()); /// - /// Sets whether the window should show always on top of other windows. - /// After setting this, the window is still a normal window, not a toolbox + /// Sets whether the window should show always on top of other windows. + /// After setting this, the window is still a normal window, not a toolbox /// window which can not be focused on. /// /// - /// Values include normal, floating, torn-off-menu, modal-panel, main-menu, - /// status, pop-up-menu and screen-saver. The default is floating. + /// Values include normal, floating, torn-off-menu, modal-panel, main-menu, + /// status, pop-up-menu and screen-saver. The default is floating. /// See the macOS docs - /// The number of layers higher to set this window relative to the given level. + /// The number of layers higher to set this window relative to the given level. /// The default is 0. Note that Apple discourages setting levels higher than 1 above screen-saver. public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) => this.CallMethod3(flag, level.GetDescription(), relativeLevel); @@ -738,16 +738,16 @@ public class BrowserWindow : ApiBase public Task GetTitleAsync() => this.InvokeAsync(); /// - /// Changes the attachment point for sheets on macOS. - /// By default, sheets are attached just below the window frame, + /// Changes the attachment point for sheets on macOS. + /// By default, sheets are attached just below the window frame, /// but you may want to display them beneath a HTML-rendered toolbar. /// /// public void SetSheetOffset(float offsetY) => this.CallMethod1(offsetY); /// - /// Changes the attachment point for sheets on macOS. - /// By default, sheets are attached just below the window frame, + /// Changes the attachment point for sheets on macOS. + /// By default, sheets are attached just below the window frame, /// but you may want to display them beneath a HTML-rendered toolbar. /// /// @@ -785,7 +785,7 @@ public class BrowserWindow : ApiBase public Task GetNativeWindowHandle() => this.InvokeAsync(); /// - /// Sets the pathname of the file the window represents, + /// Sets the pathname of the file the window represents, /// and the icon of the file will show in window’s title bar. /// /// @@ -798,7 +798,7 @@ public class BrowserWindow : ApiBase public Task GetRepresentedFilenameAsync() => this.InvokeAsync(); /// - /// Specifies whether the window’s document has been edited, + /// Specifies whether the window’s document has been edited, /// and the icon in title bar will become gray when set to true. /// /// @@ -821,14 +821,14 @@ public class BrowserWindow : ApiBase public void BlurWebView() => this.CallMethod0(); /// - /// The url can be a remote address (e.g. http://) or + /// The url can be a remote address (e.g. http://) or /// a path to a local HTML file using the file:// protocol. /// /// public void LoadURL(string url) => this.CallMethod1(url); /// - /// The url can be a remote address (e.g. http://) or + /// The url can be a remote address (e.g. http://) or /// a path to a local HTML file using the file:// protocol. /// /// @@ -857,7 +857,7 @@ public class BrowserWindow : ApiBase private List _items = new List(); /// - /// Sets the menu as the window’s menu bar, + /// Sets the menu as the window’s menu bar, /// setting it to null will remove the menu bar. /// /// @@ -939,11 +939,11 @@ public class BrowserWindow : ApiBase private List _thumbarButtons = new List(); /// - /// Add a thumbnail toolbar with a specified set of buttons to the thumbnail - /// image of a window in a taskbar button layout. Returns a Boolean object + /// Add a thumbnail toolbar with a specified set of buttons to the thumbnail + /// image of a window in a taskbar button layout. Returns a Boolean object /// indicates whether the thumbnail has been added successfully. /// - /// The number of buttons in thumbnail toolbar should be no greater than 7 due + /// The number of buttons in thumbnail toolbar should be no greater than 7 due /// to the limited room.Once you setup the thumbnail toolbar, the toolbar cannot /// be removed due to the platform’s limitation.But you can call the API with an /// empty array to clean the buttons. @@ -988,7 +988,7 @@ public class BrowserWindow : ApiBase /// /// Sets the properties for the window’s taskbar button. /// - /// Note: relaunchCommand and relaunchDisplayName must always be set together. + /// Note: relaunchCommand and relaunchDisplayName must always be set together. /// If one of those properties is not set, then neither will be used. /// /// @@ -1000,7 +1000,7 @@ public class BrowserWindow : ApiBase public void ShowDefinitionForSelection() => this.CallMethod0(); /// - /// Sets whether the window menu bar should hide itself automatically. + /// Sets whether the window menu bar should hide itself automatically. /// Once set the menu bar will only show when users press the single Alt key. /// /// If the menu bar is already visible, calling setAutoHideMenuBar(true) won’t hide it immediately. @@ -1046,7 +1046,7 @@ public class BrowserWindow : ApiBase /// /// Makes the window ignore all mouse events. /// - /// All mouse events happened in this window will be passed to the window + /// All mouse events happened in this window will be passed to the window /// below this window, but if this window has focus, it will still receive keyboard events. /// /// @@ -1055,7 +1055,7 @@ public class BrowserWindow : ApiBase /// /// Prevents the window contents from being captured by other apps. /// - /// On macOS it sets the NSWindow’s sharingType to NSWindowSharingNone. + /// On macOS it sets the NSWindow’s sharingType to NSWindowSharingNone. /// On Windows it calls SetWindowDisplayAffinity with WDA_MONITOR. /// /// @@ -1068,7 +1068,7 @@ public class BrowserWindow : ApiBase public void SetFocusable(bool focusable) => this.CallMethod1(focusable); /// - /// Sets parent as current window’s parent window, + /// Sets parent as current window’s parent window, /// passing null will turn current window into a top-level window. /// /// @@ -1120,11 +1120,11 @@ public class BrowserWindow : ApiBase public void SetAutoHideCursor(bool autoHide) => this.CallMethod1(autoHide); /// - /// Adds a vibrancy effect to the browser window. + /// Adds a vibrancy effect to the browser window. /// Passing null or an empty string will remove the vibrancy effect on the window. /// - /// Can be appearance-based, light, dark, titlebar, selection, - /// menu, popover, sidebar, medium-light or ultra-dark. + /// Can be appearance-based, light, dark, titlebar, selection, + /// menu, popover, sidebar, medium-light or ultra-dark. /// See the macOS documentation for more details. public void SetVibrancy(Vibrancy type) => this.CallMethod1(type.GetDescription()); @@ -1134,8 +1134,8 @@ public class BrowserWindow : ApiBase public WebContents WebContents { get; internal set; } /// - /// A BrowserView can be used to embed additional web content into a BrowserWindow. - /// It is like a child window, except that it is positioned relative to its owning window. + /// A BrowserView can be used to embed additional web content into a BrowserWindow. + /// It is like a child window, except that it is positioned relative to its owning window. /// It is meant to be an alternative to the webview tag. /// /// diff --git a/src/ElectronNET.API/API/Clipboard.cs b/src/ElectronNET.API/API/Clipboard.cs index 1a011be..4b06327 100644 --- a/src/ElectronNET.API/API/Clipboard.cs +++ b/src/ElectronNET.API/API/Clipboard.cs @@ -2,6 +2,7 @@ using ElectronNET.API.Entities; using ElectronNET.API.Serialization; using System.Text.Json; using System.Threading.Tasks; + // ReSharper disable InconsistentNaming namespace ElectronNET.API @@ -9,7 +10,7 @@ namespace ElectronNET.API /// /// Perform copy and paste operations on the system clipboard. /// - public sealed class Clipboard: ApiBase + public sealed class Clipboard : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst; @@ -92,8 +93,8 @@ namespace ElectronNET.API } /// - /// Returns an Object containing title and url keys representing - /// the bookmark in the clipboard. The title and url values will + /// Returns an Object containing title and url keys representing + /// the bookmark in the clipboard. The title and url values will /// be empty strings when the bookmark is unavailable. /// /// @@ -103,7 +104,7 @@ namespace ElectronNET.API /// Writes the title and url into the clipboard as a bookmark. /// /// Note: Most apps on Windows don’t support pasting bookmarks - /// into them so you can use clipboard.write to write both a + /// into them so you can use clipboard.write to write both a /// bookmark and fallback text to the clipboard. /// /// @@ -123,7 +124,7 @@ namespace ElectronNET.API public Task ReadFindTextAsync() => this.InvokeAsync(); /// - /// macOS: Writes the text into the find pasteboard as plain text. This method uses + /// macOS: Writes the text into the find pasteboard as plain text. This method uses /// synchronous IPC when called from the renderer process. /// /// @@ -175,4 +176,4 @@ namespace ElectronNET.API BridgeConnector.Socket.Emit("clipboard-writeImage", JsonSerializer.Serialize(image, ElectronJson.Options), type); } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Cookies.cs b/src/ElectronNET.API/API/Cookies.cs index 8540598..dac0d2d 100644 --- a/src/ElectronNET.API/API/Cookies.cs +++ b/src/ElectronNET.API/API/Cookies.cs @@ -59,7 +59,5 @@ namespace ElectronNET.API } private event Action _changed; - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Dialog.cs b/src/ElectronNET.API/API/Dialog.cs index 933c6ea..fa60840 100644 --- a/src/ElectronNET.API/API/Dialog.cs +++ b/src/ElectronNET.API/API/Dialog.cs @@ -37,8 +37,8 @@ namespace ElectronNET.API } /// - /// Note: On Windows and Linux an open dialog can not be both a file selector - /// and a directory selector, so if you set properties to ['openFile', 'openDirectory'] + /// Note: On Windows and Linux an open dialog can not be both a file selector + /// and a directory selector, so if you set properties to ['openFile', 'openDirectory'] /// on these platforms, a directory selector will be shown. /// /// The browserWindow argument allows the dialog to attach itself to a parent window, making it modal. @@ -50,9 +50,9 @@ namespace ElectronNET.API var guid = Guid.NewGuid().ToString(); BridgeConnector.Socket.Once("showOpenDialogComplete" + guid, tcs.SetResult); - BridgeConnector.Socket.Emit("showOpenDialog", - browserWindow, - options, + BridgeConnector.Socket.Emit("showOpenDialog", + browserWindow, + options, guid); return tcs.Task; @@ -167,9 +167,9 @@ namespace ElectronNET.API /// /// Displays a modal dialog that shows an error message. /// - /// This API can be called safely before the ready event the app module emits, - /// it is usually used to report errors in early stage of startup.If called - /// before the app readyevent on Linux, the message will be emitted to stderr, + /// This API can be called safely before the ready event the app module emits, + /// it is usually used to report errors in early stage of startup.If called + /// before the app readyevent on Linux, the message will be emitted to stderr, /// and no GUI dialog will appear. /// /// The title to display in the error box. @@ -181,7 +181,7 @@ namespace ElectronNET.API /// /// On macOS, this displays a modal dialog that shows a message and certificate information, - /// and gives the user the option of trusting/importing the certificate. If you provide a + /// and gives the user the option of trusting/importing the certificate. If you provide a /// browserWindow argument the dialog will be attached to the parent window, making it modal. /// /// @@ -193,7 +193,7 @@ namespace ElectronNET.API /// /// On macOS, this displays a modal dialog that shows a message and certificate information, - /// and gives the user the option of trusting/importing the certificate. If you provide a + /// and gives the user the option of trusting/importing the certificate. If you provide a /// browserWindow argument the dialog will be attached to the parent window, making it modal. /// /// @@ -212,7 +212,5 @@ namespace ElectronNET.API return tcs.Task; } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Dock.cs b/src/ElectronNET.API/API/Dock.cs index 0a84b27..1e77d21 100644 --- a/src/ElectronNET.API/API/Dock.cs +++ b/src/ElectronNET.API/API/Dock.cs @@ -208,7 +208,5 @@ namespace ElectronNET.API { BridgeConnector.Socket.Emit("dock-setIcon", image); } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Electron.cs b/src/ElectronNET.API/API/Electron.cs index 9148016..2866c6e 100644 --- a/src/ElectronNET.API/API/Electron.cs +++ b/src/ElectronNET.API/API/Electron.cs @@ -140,7 +140,7 @@ /// /// Allows you to execute native JavaScript/TypeScript code from the host process. /// - /// It is only possible if the Electron.NET CLI has previously added an + /// It is only possible if the Electron.NET CLI has previously added an /// ElectronHostHook directory: /// electronize add HostHook /// @@ -153,7 +153,7 @@ } /// - /// Allows you to execute native Lock and Unlock process. + /// Allows you to execute native Lock and Unlock process. /// public static PowerMonitor PowerMonitor { diff --git a/src/ElectronNET.API/API/Entities/AutoResizeOptions.cs b/src/ElectronNET.API/API/Entities/AutoResizeOptions.cs index 32289d4..e4b350d 100644 --- a/src/ElectronNET.API/API/Entities/AutoResizeOptions.cs +++ b/src/ElectronNET.API/API/Entities/AutoResizeOptions.cs @@ -35,4 +35,4 @@ namespace ElectronNET.API.Entities [DefaultValue(false)] public bool Vertical { get; set; } = false; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/BitmapOptions.cs b/src/ElectronNET.API/API/Entities/BitmapOptions.cs index d3aaebb..6c7a463 100644 --- a/src/ElectronNET.API/API/Entities/BitmapOptions.cs +++ b/src/ElectronNET.API/API/Entities/BitmapOptions.cs @@ -10,4 +10,4 @@ /// public float ScaleFactor { get; set; } = 1.0f; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/BlockMapDataHolder.cs b/src/ElectronNET.API/API/Entities/BlockMapDataHolder.cs index 24b45f6..9260b7c 100644 --- a/src/ElectronNET.API/API/Entities/BlockMapDataHolder.cs +++ b/src/ElectronNET.API/API/Entities/BlockMapDataHolder.cs @@ -28,4 +28,4 @@ /// public bool IsAdminRightsRequired { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/BrowserViewConstructorOptions.cs b/src/ElectronNET.API/API/Entities/BrowserViewConstructorOptions.cs index a0b3411..f9eb8ef 100644 --- a/src/ElectronNET.API/API/Entities/BrowserViewConstructorOptions.cs +++ b/src/ElectronNET.API/API/Entities/BrowserViewConstructorOptions.cs @@ -22,4 +22,4 @@ /// public string ProxyCredentials { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs b/src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs index 8677aeb..9b1e1fd 100644 --- a/src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs +++ b/src/ElectronNET.API/API/Entities/BrowserWindowOptions.cs @@ -1,5 +1,4 @@ using ElectronNET.Converter; - using System.ComponentModel; using System.Text.Json.Serialization; @@ -296,8 +295,4 @@ namespace ElectronNET.API.Entities /// public string ProxyCredentials { get; set; } } -} - - - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/CPUUsage.cs b/src/ElectronNET.API/API/Entities/CPUUsage.cs index f9b7326..acd4746 100644 --- a/src/ElectronNET.API/API/Entities/CPUUsage.cs +++ b/src/ElectronNET.API/API/Entities/CPUUsage.cs @@ -11,9 +11,9 @@ public double PercentCPUUsage { get; set; } /// - /// The number of average idle cpu wakeups per second since the last call to + /// The number of average idle cpu wakeups per second since the last call to /// getCPUUsage.First call returns 0. /// public int IdleWakeupsPerSecond { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ChromeExtensionInfo.cs b/src/ElectronNET.API/API/Entities/ChromeExtensionInfo.cs index 52bc2dc..36115a9 100644 --- a/src/ElectronNET.API/API/Entities/ChromeExtensionInfo.cs +++ b/src/ElectronNET.API/API/Entities/ChromeExtensionInfo.cs @@ -26,4 +26,4 @@ /// public string Version { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ClearStorageDataOptions.cs b/src/ElectronNET.API/API/Entities/ClearStorageDataOptions.cs index 45ebb97..d3940e7 100644 --- a/src/ElectronNET.API/API/Entities/ClearStorageDataOptions.cs +++ b/src/ElectronNET.API/API/Entities/ClearStorageDataOptions.cs @@ -21,4 +21,4 @@ /// public string[] Quotas { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/CookieChangedCause.cs b/src/ElectronNET.API/API/Entities/CookieChangedCause.cs index 0038357..ae1a42d 100644 --- a/src/ElectronNET.API/API/Entities/CookieChangedCause.cs +++ b/src/ElectronNET.API/API/Entities/CookieChangedCause.cs @@ -1,10 +1,9 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities { /// - /// The cause of the change + /// The cause of the change /// public enum CookieChangedCause { @@ -35,4 +34,4 @@ namespace ElectronNET.API.Entities [JsonPropertyName("expired_overwrite")] expiredOverwrite } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/CookieDetails.cs b/src/ElectronNET.API/API/Entities/CookieDetails.cs index 3c44de6..389e8ce 100644 --- a/src/ElectronNET.API/API/Entities/CookieDetails.cs +++ b/src/ElectronNET.API/API/Entities/CookieDetails.cs @@ -49,7 +49,7 @@ namespace ElectronNET.API.Entities public bool HttpOnly { get; set; } /// - /// (optional) - The expiration date of the cookie as the number of seconds since the UNIX epoch. + /// (optional) - The expiration date of the cookie as the number of seconds since the UNIX epoch. /// If omitted then the cookie becomes a session cookie and will not be retained between sessions. /// [DefaultValue(0)] diff --git a/src/ElectronNET.API/API/Entities/CreateFromBitmapOptions.cs b/src/ElectronNET.API/API/Entities/CreateFromBitmapOptions.cs index 6b80c21..b223998 100644 --- a/src/ElectronNET.API/API/Entities/CreateFromBitmapOptions.cs +++ b/src/ElectronNET.API/API/Entities/CreateFromBitmapOptions.cs @@ -20,4 +20,4 @@ /// public float ScaleFactor { get; set; } = 1.0f; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/CreateInterruptedDownloadOptions.cs b/src/ElectronNET.API/API/Entities/CreateInterruptedDownloadOptions.cs index e7d066e..b28f616 100644 --- a/src/ElectronNET.API/API/Entities/CreateInterruptedDownloadOptions.cs +++ b/src/ElectronNET.API/API/Entities/CreateInterruptedDownloadOptions.cs @@ -64,4 +64,4 @@ ETag = eTag; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/EnableNetworkEmulationOptions.cs b/src/ElectronNET.API/API/Entities/EnableNetworkEmulationOptions.cs index 967cc53..64fed7a 100644 --- a/src/ElectronNET.API/API/Entities/EnableNetworkEmulationOptions.cs +++ b/src/ElectronNET.API/API/Entities/EnableNetworkEmulationOptions.cs @@ -25,4 +25,4 @@ /// public int UploadThroughput { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/Extension.cs b/src/ElectronNET.API/API/Entities/Extension.cs index 6bd8cbe..d4edd97 100644 --- a/src/ElectronNET.API/API/Entities/Extension.cs +++ b/src/ElectronNET.API/API/Entities/Extension.cs @@ -35,4 +35,4 @@ /// public string Version { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/GPUFeatureStatus.cs b/src/ElectronNET.API/API/Entities/GPUFeatureStatus.cs index 1a49de9..1904958 100644 --- a/src/ElectronNET.API/API/Entities/GPUFeatureStatus.cs +++ b/src/ElectronNET.API/API/Entities/GPUFeatureStatus.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities diff --git a/src/ElectronNET.API/API/Entities/InputEvent.cs b/src/ElectronNET.API/API/Entities/InputEvent.cs index 8c0cb63..98370e5 100644 --- a/src/ElectronNET.API/API/Entities/InputEvent.cs +++ b/src/ElectronNET.API/API/Entities/InputEvent.cs @@ -77,6 +77,4 @@ namespace ElectronNET.API.Entities /// public InputEventType Type { get; set; } } -} - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/JumpListCategory.cs b/src/ElectronNET.API/API/Entities/JumpListCategory.cs index 9c99d8f..660a782 100644 --- a/src/ElectronNET.API/API/Entities/JumpListCategory.cs +++ b/src/ElectronNET.API/API/Entities/JumpListCategory.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -23,5 +22,4 @@ namespace ElectronNET.API.Entities /// public JumpListCategoryType Type { get; set; } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/JumpListItem.cs b/src/ElectronNET.API/API/Entities/JumpListItem.cs index b2e41df..9c57ba8 100644 --- a/src/ElectronNET.API/API/Entities/JumpListItem.cs +++ b/src/ElectronNET.API/API/Entities/JumpListItem.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -54,6 +53,4 @@ namespace ElectronNET.API.Entities /// public JumpListItemType Type { get; set; } } -} - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/MemoryInfo.cs b/src/ElectronNET.API/API/Entities/MemoryInfo.cs index 840cb5d..a7eb094 100644 --- a/src/ElectronNET.API/API/Entities/MemoryInfo.cs +++ b/src/ElectronNET.API/API/Entities/MemoryInfo.cs @@ -11,7 +11,7 @@ public int WorkingSetSize { get; set; } /// - /// The maximum amount of memory that has ever been pinned to actual physical RAM. + /// The maximum amount of memory that has ever been pinned to actual physical RAM. /// public int PeakWorkingSetSize { get; set; } diff --git a/src/ElectronNET.API/API/Entities/MenuItem.cs b/src/ElectronNET.API/API/Entities/MenuItem.cs index 200b5cd..b50b965 100644 --- a/src/ElectronNET.API/API/Entities/MenuItem.cs +++ b/src/ElectronNET.API/API/Entities/MenuItem.cs @@ -9,7 +9,7 @@ namespace ElectronNET.API.Entities public class MenuItem { /// - /// Will be called with click(menuItem, browserWindow, event) when the menu item is + /// Will be called with click(menuItem, browserWindow, event) when the menu item is /// clicked. /// [JsonIgnore] @@ -96,6 +96,4 @@ namespace ElectronNET.API.Entities /// public string Position { get; set; } } -} - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/MessageBoxOptions.cs b/src/ElectronNET.API/API/Entities/MessageBoxOptions.cs index 22284d6..b4f7e09 100644 --- a/src/ElectronNET.API/API/Entities/MessageBoxOptions.cs +++ b/src/ElectronNET.API/API/Entities/MessageBoxOptions.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -97,6 +96,4 @@ namespace ElectronNET.API.Entities Message = message; } } -} - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/MessageBoxResult.cs b/src/ElectronNET.API/API/Entities/MessageBoxResult.cs index 835c292..1894c09 100644 --- a/src/ElectronNET.API/API/Entities/MessageBoxResult.cs +++ b/src/ElectronNET.API/API/Entities/MessageBoxResult.cs @@ -21,4 +21,4 @@ /// public bool CheckboxChecked { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/NativeImageJsonConverter.cs b/src/ElectronNET.API/API/Entities/NativeImageJsonConverter.cs index 00ac690..dddcbcc 100644 --- a/src/ElectronNET.API/API/Entities/NativeImageJsonConverter.cs +++ b/src/ElectronNET.API/API/Entities/NativeImageJsonConverter.cs @@ -35,5 +35,4 @@ namespace ElectronNET.API.Entities return new NativeImage(newDictionary); } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/OnDidFailLoadInfo.cs b/src/ElectronNET.API/API/Entities/OnDidFailLoadInfo.cs index a3f0317..2a57182 100644 --- a/src/ElectronNET.API/API/Entities/OnDidFailLoadInfo.cs +++ b/src/ElectronNET.API/API/Entities/OnDidFailLoadInfo.cs @@ -15,4 +15,4 @@ public class OnDidFailLoadInfo /// Validated URL. /// public string ValidatedUrl { get; set; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/OnDidNavigateInfo.cs b/src/ElectronNET.API/API/Entities/OnDidNavigateInfo.cs index 5f8ccb9..52c2b14 100644 --- a/src/ElectronNET.API/API/Entities/OnDidNavigateInfo.cs +++ b/src/ElectronNET.API/API/Entities/OnDidNavigateInfo.cs @@ -14,4 +14,4 @@ public class OnDidNavigateInfo /// HTTP response code. /// public int HttpResponseCode { get; set; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/OpenDevToolsOptions.cs b/src/ElectronNET.API/API/Entities/OpenDevToolsOptions.cs index d280579..b94da91 100644 --- a/src/ElectronNET.API/API/Entities/OpenDevToolsOptions.cs +++ b/src/ElectronNET.API/API/Entities/OpenDevToolsOptions.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -15,5 +14,4 @@ namespace ElectronNET.API.Entities /// public DevToolsMode Mode { get; set; } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/OpenDialogOptions.cs b/src/ElectronNET.API/API/Entities/OpenDialogOptions.cs index f6c5819..26cd6ec 100644 --- a/src/ElectronNET.API/API/Entities/OpenDialogOptions.cs +++ b/src/ElectronNET.API/API/Entities/OpenDialogOptions.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -41,7 +40,7 @@ namespace ElectronNET.API.Entities public string Message { get; set; } /// - /// The filters specifies an array of file types that can be displayed or + /// The filters specifies an array of file types that can be displayed or /// selected when you want to limit the user to a specific type. For example: /// /// @@ -57,5 +56,4 @@ namespace ElectronNET.API.Entities /// public FileFilter[] Filters { get; set; } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/PageSize.cs b/src/ElectronNET.API/API/Entities/PageSize.cs index 607a59c..4256225 100644 --- a/src/ElectronNET.API/API/Entities/PageSize.cs +++ b/src/ElectronNET.API/API/Entities/PageSize.cs @@ -17,4 +17,4 @@ public class PageSize public static implicit operator string(PageSize pageSize) => pageSize?._value; public static implicit operator PageSize(string value) => new(value); -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/PathName.cs b/src/ElectronNET.API/API/Entities/PathName.cs index e9500c2..e83ba8b 100644 --- a/src/ElectronNET.API/API/Entities/PathName.cs +++ b/src/ElectronNET.API/API/Entities/PathName.cs @@ -20,7 +20,7 @@ namespace ElectronNET.API.Entities AppData, /// - /// The directory for storing your app’s configuration files, + /// The directory for storing your app’s configuration files, /// which by default it is the appData directory appended with your app’s name. /// [Description("userData")] @@ -92,4 +92,4 @@ namespace ElectronNET.API.Entities [Description("PepperFlashSystemPlugin")] PepperFlashSystemPlugin } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ProcessVersions.cs b/src/ElectronNET.API/API/Entities/ProcessVersions.cs index 4e6fe54..d7d3c01 100644 --- a/src/ElectronNET.API/API/Entities/ProcessVersions.cs +++ b/src/ElectronNET.API/API/Entities/ProcessVersions.cs @@ -7,4 +7,4 @@ namespace ElectronNET.API.Entities /// Value representing Electron's version string /// public record ProcessVersions(string Chrome, string Electron); -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ProgressBarOptions.cs b/src/ElectronNET.API/API/Entities/ProgressBarOptions.cs index 898486e..ee01720 100644 --- a/src/ElectronNET.API/API/Entities/ProgressBarOptions.cs +++ b/src/ElectronNET.API/API/Entities/ProgressBarOptions.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -13,5 +12,4 @@ namespace ElectronNET.API.Entities /// public ProgressBarMode Mode { get; set; } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ProgressInfo.cs b/src/ElectronNET.API/API/Entities/ProgressInfo.cs index 75c9497..1427cf8 100644 --- a/src/ElectronNET.API/API/Entities/ProgressInfo.cs +++ b/src/ElectronNET.API/API/Entities/ProgressInfo.cs @@ -30,4 +30,4 @@ /// public string Transferred { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ProxyConfig.cs b/src/ElectronNET.API/API/Entities/ProxyConfig.cs index 3dd9ac0..c9df647 100644 --- a/src/ElectronNET.API/API/Entities/ProxyConfig.cs +++ b/src/ElectronNET.API/API/Entities/ProxyConfig.cs @@ -33,4 +33,4 @@ ProxyBypassRules = proxyBypassRules; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ReleaseNoteInfo.cs b/src/ElectronNET.API/API/Entities/ReleaseNoteInfo.cs index c9ebf2a..6b0c977 100644 --- a/src/ElectronNET.API/API/Entities/ReleaseNoteInfo.cs +++ b/src/ElectronNET.API/API/Entities/ReleaseNoteInfo.cs @@ -15,4 +15,4 @@ /// public string Note { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/RemovePassword.cs b/src/ElectronNET.API/API/Entities/RemovePassword.cs index 811c19e..b2afb41 100644 --- a/src/ElectronNET.API/API/Entities/RemovePassword.cs +++ b/src/ElectronNET.API/API/Entities/RemovePassword.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities @@ -25,7 +24,7 @@ namespace ElectronNET.API.Entities public string Realm { get; set; } /// - /// Scheme of the authentication. Can be basic, digest, ntlm, negotiate. + /// Scheme of the authentication. Can be basic, digest, ntlm, negotiate. /// Must be provided if removing by origin. /// public Scheme Scheme { get; set; } @@ -49,6 +48,4 @@ namespace ElectronNET.API.Entities Type = type; } } -} - - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ResizeOptions.cs b/src/ElectronNET.API/API/Entities/ResizeOptions.cs index 1490ccd..e506cb8 100644 --- a/src/ElectronNET.API/API/Entities/ResizeOptions.cs +++ b/src/ElectronNET.API/API/Entities/ResizeOptions.cs @@ -20,4 +20,4 @@ /// public string Quality { get; set; } = "best"; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/SaveDialogOptions.cs b/src/ElectronNET.API/API/Entities/SaveDialogOptions.cs index 16811d7..9c549a7 100644 --- a/src/ElectronNET.API/API/Entities/SaveDialogOptions.cs +++ b/src/ElectronNET.API/API/Entities/SaveDialogOptions.cs @@ -27,7 +27,7 @@ namespace ElectronNET.API public string ButtonLabel { get; set; } /// - /// The filters specifies an array of file types that can be displayed or + /// The filters specifies an array of file types that can be displayed or /// selected when you want to limit the user to a specific type. For example: /// /// diff --git a/src/ElectronNET.API/API/Entities/ShortcutLinkOperation.cs b/src/ElectronNET.API/API/Entities/ShortcutLinkOperation.cs index fda0aae..c2b6d3f 100644 --- a/src/ElectronNET.API/API/Entities/ShortcutLinkOperation.cs +++ b/src/ElectronNET.API/API/Entities/ShortcutLinkOperation.cs @@ -25,4 +25,4 @@ namespace ElectronNET.API.Entities [Description("replace")] Replace } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ThumbarButton.cs b/src/ElectronNET.API/API/Entities/ThumbarButton.cs index 051976f..af9bcce 100644 --- a/src/ElectronNET.API/API/Entities/ThumbarButton.cs +++ b/src/ElectronNET.API/API/Entities/ThumbarButton.cs @@ -56,5 +56,4 @@ namespace ElectronNET.API.Entities Icon = icon; } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/TitleBarStyle.cs b/src/ElectronNET.API/API/Entities/TitleBarStyle.cs index f28ac95..7d117f3 100644 --- a/src/ElectronNET.API/API/Entities/TitleBarStyle.cs +++ b/src/ElectronNET.API/API/Entities/TitleBarStyle.cs @@ -1,4 +1,3 @@ - using System.Text.Json.Serialization; namespace ElectronNET.API.Entities diff --git a/src/ElectronNET.API/API/Entities/ToBitmapOptions.cs b/src/ElectronNET.API/API/Entities/ToBitmapOptions.cs index 1a08c3b..98593fa 100644 --- a/src/ElectronNET.API/API/Entities/ToBitmapOptions.cs +++ b/src/ElectronNET.API/API/Entities/ToBitmapOptions.cs @@ -10,4 +10,4 @@ /// public float ScaleFactor { get; set; } = 1.0f; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ToDataUrlOptions.cs b/src/ElectronNET.API/API/Entities/ToDataUrlOptions.cs index 0df4aa9..748b206 100644 --- a/src/ElectronNET.API/API/Entities/ToDataUrlOptions.cs +++ b/src/ElectronNET.API/API/Entities/ToDataUrlOptions.cs @@ -10,4 +10,4 @@ /// public float ScaleFactor { get; set; } = 1.0f; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/ToPNGOptions.cs b/src/ElectronNET.API/API/Entities/ToPNGOptions.cs index f4e36b1..47a2cd0 100644 --- a/src/ElectronNET.API/API/Entities/ToPNGOptions.cs +++ b/src/ElectronNET.API/API/Entities/ToPNGOptions.cs @@ -10,4 +10,4 @@ /// public float ScaleFactor { get; set; } = 1.0f; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/UpdateCheckResult.cs b/src/ElectronNET.API/API/Entities/UpdateCheckResult.cs index 66c75aa..ed3b409 100644 --- a/src/ElectronNET.API/API/Entities/UpdateCheckResult.cs +++ b/src/ElectronNET.API/API/Entities/UpdateCheckResult.cs @@ -20,4 +20,4 @@ /// public UpdateCancellationToken CancellationToken { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/UpdateFileInfo.cs b/src/ElectronNET.API/API/Entities/UpdateFileInfo.cs index 5f5d6f6..4163ac1 100644 --- a/src/ElectronNET.API/API/Entities/UpdateFileInfo.cs +++ b/src/ElectronNET.API/API/Entities/UpdateFileInfo.cs @@ -10,4 +10,4 @@ /// public string Url { get; set; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Entities/WebPreferences.cs b/src/ElectronNET.API/API/Entities/WebPreferences.cs index 12d8bf4..07f5100 100644 --- a/src/ElectronNET.API/API/Entities/WebPreferences.cs +++ b/src/ElectronNET.API/API/Entities/WebPreferences.cs @@ -213,4 +213,4 @@ namespace ElectronNET.API.Entities [DefaultValue(false)] public bool EnableRemoteModule { get; set; } = false; } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Extensions/ThumbarButtonExtensions.cs b/src/ElectronNET.API/API/Extensions/ThumbarButtonExtensions.cs index 3b15554..11cdaf1 100644 --- a/src/ElectronNET.API/API/Extensions/ThumbarButtonExtensions.cs +++ b/src/ElectronNET.API/API/Extensions/ThumbarButtonExtensions.cs @@ -36,4 +36,4 @@ namespace ElectronNET.API.Extensions return result; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/GlobalShortcut.cs b/src/ElectronNET.API/API/GlobalShortcut.cs index 9786fe6..46a6b91 100644 --- a/src/ElectronNET.API/API/GlobalShortcut.cs +++ b/src/ElectronNET.API/API/GlobalShortcut.cs @@ -39,10 +39,10 @@ namespace ElectronNET.API private Dictionary _shortcuts = new Dictionary(); /// - /// Registers a global shortcut of accelerator. + /// Registers a global shortcut of accelerator. /// The callback is called when the registered shortcut is pressed by the user. /// - /// When the accelerator is already taken by other applications, this call will + /// When the accelerator is already taken by other applications, this call will /// silently fail.This behavior is intended by operating systems, since they don’t /// want applications to fight for global shortcuts. /// @@ -66,7 +66,7 @@ namespace ElectronNET.API } /// - /// When the accelerator is already taken by other applications, + /// When the accelerator is already taken by other applications, /// this call will still return false. This behavior is intended by operating systems, /// since they don’t want applications to fight for global shortcuts. /// diff --git a/src/ElectronNET.API/API/HostHook.cs b/src/ElectronNET.API/API/HostHook.cs index 634f760..31bbc45 100644 --- a/src/ElectronNET.API/API/HostHook.cs +++ b/src/ElectronNET.API/API/HostHook.cs @@ -8,7 +8,7 @@ namespace ElectronNET.API /// /// Allows you to execute native JavaScript/TypeScript code from the host process. /// - /// It is only possible if the Electron.NET CLI has previously added an + /// It is only possible if the Electron.NET CLI has previously added an /// ElectronHostHook directory: /// electronize add HostHook /// @@ -48,10 +48,7 @@ namespace ElectronNET.API /// Optional parameters. public void Call(string socketEventName, params dynamic[] arguments) { - BridgeConnector.Socket.Once(socketEventName + "Error" + oneCallguid, (result) => - { - Electron.Dialog.ShowErrorBox("Host Hook Exception", result); - }); + BridgeConnector.Socket.Once(socketEventName + "Error" + oneCallguid, (result) => { Electron.Dialog.ShowErrorBox("Host Hook Exception", result); }); BridgeConnector.Socket.Emit(socketEventName, arguments, oneCallguid); } @@ -95,7 +92,5 @@ namespace ElectronNET.API return tcs.Task; } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/IpcMain.cs b/src/ElectronNET.API/API/IpcMain.cs index 21c2592..239098b 100644 --- a/src/ElectronNET.API/API/IpcMain.cs +++ b/src/ElectronNET.API/API/IpcMain.cs @@ -39,7 +39,7 @@ namespace ElectronNET.API } /// - /// Listens to channel, when a new message arrives listener would be called with + /// Listens to channel, when a new message arrives listener would be called with /// listener(event, args...). /// /// Channelname. @@ -71,7 +71,7 @@ namespace ElectronNET.API } /// - /// Send a message to the renderer process synchronously via channel, + /// Send a message to the renderer process synchronously via channel, /// you can also send arbitrary arguments. /// /// Note: Sending a synchronous message will block the whole renderer process, @@ -160,7 +160,5 @@ namespace ElectronNET.API { BridgeConnector.Socket.Emit("sendToIpcRendererBrowserView", browserView.Id, channel, data); } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Menu.cs b/src/ElectronNET.API/API/Menu.cs index c037532..7571ef0 100644 --- a/src/ElectronNET.API/API/Menu.cs +++ b/src/ElectronNET.API/API/Menu.cs @@ -129,7 +129,5 @@ namespace ElectronNET.API { BridgeConnector.Socket.Emit("menu-contextMenuPopup", browserWindow.Id); } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/NativeTheme.cs b/src/ElectronNET.API/API/NativeTheme.cs index 5e7c991..0879fe8 100644 --- a/src/ElectronNET.API/API/NativeTheme.cs +++ b/src/ElectronNET.API/API/NativeTheme.cs @@ -8,7 +8,7 @@ namespace ElectronNET.API /// /// Read and respond to changes in Chromium's native color theme. /// - public sealed class NativeTheme: ApiBase + public sealed class NativeTheme : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketEventNameTypes SocketEventNameType => SocketEventNameTypes.DashedLower; @@ -59,7 +59,7 @@ namespace ElectronNET.API /// /// /// The 'updated' event will be emitted - /// + /// /// /// /// Settings this property to will have the following effects: @@ -79,7 +79,7 @@ namespace ElectronNET.API /// /// The 'updated' event will be emitted /// - /// + /// /// The usage of this property should align with a classic "dark mode" state machine in your application where the user has three options. /// /// diff --git a/src/ElectronNET.API/API/Notification.cs b/src/ElectronNET.API/API/Notification.cs index fe17bf9..a5f03f9 100644 --- a/src/ElectronNET.API/API/Notification.cs +++ b/src/ElectronNET.API/API/Notification.cs @@ -9,7 +9,7 @@ namespace ElectronNET.API /// /// Create OS desktop notifications /// - public sealed class Notification: ApiBase + public sealed class Notification : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.NoDashUpperFirst; private static Notification _notification; @@ -88,10 +88,7 @@ namespace ElectronNET.API isActionDefined = true; BridgeConnector.Socket.Off("NotificationEventReply"); - BridgeConnector.Socket.On("NotificationEventReply", (args) => - { - _notificationOptions.Single(x => x.ReplyID == args[0]).OnReply(args[1]); - }); + BridgeConnector.Socket.On("NotificationEventReply", (args) => { _notificationOptions.Single(x => x.ReplyID == args[0]).OnReply(args[1]); }); } if (notificationOptions.OnAction != null) @@ -100,10 +97,7 @@ namespace ElectronNET.API isActionDefined = true; BridgeConnector.Socket.Off("NotificationEventAction"); - BridgeConnector.Socket.On("NotificationEventAction", (args) => - { - _notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]); - }); + BridgeConnector.Socket.On("NotificationEventAction", (args) => { _notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]); }); } if (isActionDefined) @@ -118,4 +112,4 @@ namespace ElectronNET.API /// public Task IsSupportedAsync() => this.InvokeAsync(); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/PowerMonitor.cs b/src/ElectronNET.API/API/PowerMonitor.cs index 51ae281..5e14daf 100644 --- a/src/ElectronNET.API/API/PowerMonitor.cs +++ b/src/ElectronNET.API/API/PowerMonitor.cs @@ -7,13 +7,13 @@ namespace ElectronNET.API /// /// Monitor power state changes.. /// - public sealed class PowerMonitor: ApiBase + public sealed class PowerMonitor : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketEventNameTypes SocketEventNameType => SocketEventNameTypes.DashedLower; /// - /// Emitted when the system is about to lock the screen. + /// Emitted when the system is about to lock the screen. /// public event Action OnLockScreen { @@ -22,7 +22,7 @@ namespace ElectronNET.API } /// - /// Emitted when the system is about to unlock the screen. + /// Emitted when the system is about to unlock the screen. /// public event Action OnUnLockScreen { diff --git a/src/ElectronNET.API/API/Process.cs b/src/ElectronNET.API/API/Process.cs index 3edf1b5..e3c2d26 100644 --- a/src/ElectronNET.API/API/Process.cs +++ b/src/ElectronNET.API/API/Process.cs @@ -9,10 +9,11 @@ namespace ElectronNET.API /// Electron's process object is extended from the Node.js process object. It adds the /// events, properties, and methods. /// - public sealed class Process: ApiBase + public sealed class Process : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst; + internal Process() { } @@ -43,7 +44,7 @@ namespace ElectronNET.API /// /// The process.execPath property returns the absolute pathname of the executable that /// started the Node.js process. Symbolic links, if any, are resolved. - /// + /// public Task ExecPathAsync => this.InvokeAsync(); /// @@ -64,7 +65,7 @@ namespace ElectronNET.API /// /// The process.versions property returns an object listing the version strings of /// chrome and electron. - /// + /// public Task VersionsAsync => this.InvokeAsync(); /// @@ -105,4 +106,4 @@ namespace ElectronNET.API /// public Task PlatformAsync => this.InvokeAsync(); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Screen.cs b/src/ElectronNET.API/API/Screen.cs index 17bf13f..65c0107 100644 --- a/src/ElectronNET.API/API/Screen.cs +++ b/src/ElectronNET.API/API/Screen.cs @@ -10,7 +10,7 @@ namespace ElectronNET.API /// /// Retrieve information about screen size, displays, cursor position, etc. /// - public sealed class Screen: ApiBase + public sealed class Screen : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst; @@ -35,8 +35,8 @@ namespace ElectronNET.API } /// - /// Emitted when one or more metrics change in a display. - /// The changedMetrics is an array of strings that describe the changes. + /// Emitted when one or more metrics change in a display. + /// The changedMetrics is an array of strings that describe the changes. /// Possible changes are bounds, workArea, scaleFactor and rotation. /// public event Action OnDisplayMetricsChanged @@ -56,6 +56,7 @@ namespace ElectronNET.API BridgeConnector.Socket.Emit("register-screen-display-metrics-changed", GetHashCode()); } + _onDisplayMetricsChanged += value; } remove @@ -134,4 +135,4 @@ namespace ElectronNET.API /// The display that most closely intersects the provided bounds. public Task GetDisplayMatchingAsync(Rectangle rectangle) => this.InvokeAsync(rectangle); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Session.cs b/src/ElectronNET.API/API/Session.cs index bee7566..ef3b44d 100644 --- a/src/ElectronNET.API/API/Session.cs +++ b/src/ElectronNET.API/API/Session.cs @@ -373,7 +373,5 @@ namespace ElectronNET.API return tcs.Task; } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Shell.cs b/src/ElectronNET.API/API/Shell.cs index 14bfcbc..3b3d22a 100644 --- a/src/ElectronNET.API/API/Shell.cs +++ b/src/ElectronNET.API/API/Shell.cs @@ -68,7 +68,7 @@ namespace ElectronNET.API } /// - /// Open the given external protocol URL in the desktop’s default manner. + /// Open the given external protocol URL in the desktop’s default manner. /// (For example, mailto: URLs in the user’s default mail agent). /// /// Max 2081 characters on windows. @@ -79,7 +79,7 @@ namespace ElectronNET.API } /// - /// Open the given external protocol URL in the desktop’s default manner. + /// Open the given external protocol URL in the desktop’s default manner. /// (For example, mailto: URLs in the user’s default mail agent). /// /// Max 2081 characters on windows. @@ -158,7 +158,5 @@ namespace ElectronNET.API return tcs.Task; } - - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/Tray.cs b/src/ElectronNET.API/API/Tray.cs index a18b178..ad9bc95 100644 --- a/src/ElectronNET.API/API/Tray.cs +++ b/src/ElectronNET.API/API/Tray.cs @@ -14,7 +14,7 @@ namespace ElectronNET.API /// /// Add icons and context menus to the system's notification area. /// - public sealed class Tray: ApiBase + public sealed class Tray : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketEventNameTypes SocketEventNameType => SocketEventNameTypes.DashedLower; @@ -38,6 +38,7 @@ namespace ElectronNET.API BridgeConnector.Socket.Emit("register-tray-click", GetHashCode()); } + _click += value; } remove @@ -72,6 +73,7 @@ namespace ElectronNET.API BridgeConnector.Socket.Emit("register-tray-right-click", GetHashCode()); } + _rightClick += value; } remove @@ -106,6 +108,7 @@ namespace ElectronNET.API BridgeConnector.Socket.Emit("register-tray-double-click", GetHashCode()); } + _doubleClick += value; } remove @@ -140,7 +143,7 @@ namespace ElectronNET.API } /// - /// Windows: Emitted when the tray balloon is closed + /// Windows: Emitted when the tray balloon is closed /// because of timeout or user manually closes it. /// public event Action OnBalloonClosed @@ -295,7 +298,6 @@ namespace ElectronNET.API } - private const string ModuleName = "tray"; /// @@ -330,4 +332,4 @@ namespace ElectronNET.API public async Task Once(string eventName, Action action) => await Events.Instance.Once(ModuleName, eventName, action).ConfigureAwait(false); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/WebContents.cs b/src/ElectronNET.API/API/WebContents.cs index 5c598d2..2ded9f6 100644 --- a/src/ElectronNET.API/API/WebContents.cs +++ b/src/ElectronNET.API/API/WebContents.cs @@ -9,7 +9,7 @@ namespace ElectronNET.API; /// /// Render and control web pages. /// -public class WebContents: ApiBase +public class WebContents : ApiBase { protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst; protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst; @@ -147,6 +147,7 @@ public class WebContents: ApiBase /// /// success public Task PrintAsync(PrintOptions options) => this.InvokeAsync(options); + /// /// Prints window's web page. /// @@ -155,8 +156,8 @@ public class WebContents: ApiBase /// /// Prints window's web page as PDF with Chromium's preview printing custom - /// settings.The landscape will be ignored if @page CSS at-rule is used in the web page. - /// By default, an empty options will be regarded as: Use page-break-before: always; + /// settings.The landscape will be ignored if @page CSS at-rule is used in the web page. + /// By default, an empty options will be regarded as: Use page-break-before: always; /// CSS style to force to print to a new page. /// /// @@ -222,7 +223,7 @@ public class WebContents: ApiBase } /// - /// The async method will resolve when the page has finished loading, + /// The async method will resolve when the page has finished loading, /// and rejects if the page fails to load. /// /// A noop rejection handler is already attached, which avoids unhandled rejection @@ -239,7 +240,7 @@ public class WebContents: ApiBase } /// - /// The async method will resolve when the page has finished loading, + /// The async method will resolve when the page has finished loading, /// and rejects if the page fails to load. /// /// A noop rejection handler is already attached, which avoids unhandled rejection @@ -261,10 +262,7 @@ public class WebContents: ApiBase tcs.SetResult(null); }); - BridgeConnector.Socket.Once("webContents-loadURL-error" + Id, (error) => - { - tcs.SetException(new InvalidOperationException(error)); - }); + BridgeConnector.Socket.Once("webContents-loadURL-error" + Id, (error) => { tcs.SetException(new InvalidOperationException(error)); }); BridgeConnector.Socket.Emit("webContents-loadURL", Id, url, options); @@ -282,4 +280,4 @@ public class WebContents: ApiBase { BridgeConnector.Socket.Emit("webContents-insertCSS", Id, isBrowserWindow, path); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/WebRequest.cs b/src/ElectronNET.API/API/WebRequest.cs index 0bbd5ef..a39a97b 100644 --- a/src/ElectronNET.API/API/WebRequest.cs +++ b/src/ElectronNET.API/API/WebRequest.cs @@ -59,4 +59,4 @@ namespace ElectronNET.API.Entities } } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/WindowManager.cs b/src/ElectronNET.API/API/WindowManager.cs index 665aef0..20a6b19 100644 --- a/src/ElectronNET.API/API/WindowManager.cs +++ b/src/ElectronNET.API/API/WindowManager.cs @@ -158,8 +158,8 @@ namespace ElectronNET.API } /// - /// A BrowserView can be used to embed additional web content into a BrowserWindow. - /// It is like a child window, except that it is positioned relative to its owning window. + /// A BrowserView can be used to embed additional web content into a BrowserWindow. + /// It is like a child window, except that it is positioned relative to its owning window. /// It is meant to be an alternative to the webview tag. /// /// @@ -169,8 +169,8 @@ namespace ElectronNET.API } /// - /// A BrowserView can be used to embed additional web content into a BrowserWindow. - /// It is like a child window, except that it is positioned relative to its owning window. + /// A BrowserView can be used to embed additional web content into a BrowserWindow. + /// It is like a child window, except that it is positioned relative to its owning window. /// It is meant to be an alternative to the webview tag. /// /// @@ -192,6 +192,5 @@ namespace ElectronNET.API return await tcs.Task.ConfigureAwait(false); } - } } \ No newline at end of file diff --git a/src/ElectronNET.API/Bridge/SocketIOFacade.cs b/src/ElectronNET.API/Bridge/SocketIOFacade.cs index ed13afc..06015a0 100644 --- a/src/ElectronNET.API/Bridge/SocketIOFacade.cs +++ b/src/ElectronNET.API/Bridge/SocketIOFacade.cs @@ -121,4 +121,4 @@ internal class SocketIoFacade { _socket.Dispose(); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Common/Extensions.cs b/src/ElectronNET.API/Common/Extensions.cs index 515488b..a5de118 100644 --- a/src/ElectronNET.API/Common/Extensions.cs +++ b/src/ElectronNET.API/Common/Extensions.cs @@ -51,14 +51,14 @@ namespace ElectronNET.Common return str; } - + public static string StripOn(this string str) { if (string.IsNullOrWhiteSpace(str) || !str.StartsWith("On", StringComparison.Ordinal)) { return str; } - + return str.Substring(2); } @@ -66,7 +66,7 @@ namespace ElectronNET.Common { return string.Join("-", Regex.Split(str.StripOn(), "(?> { throw new JsonException("Expected array for ModifierType list"); } + while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndArray) break; @@ -30,6 +31,7 @@ public class ModifierTypeListConverter : JsonConverter> var s = reader.GetString(); list.Add((ModifierType)Enum.Parse(typeof(ModifierType), s, ignoreCase: true)); } + return list; } @@ -40,6 +42,7 @@ public class ModifierTypeListConverter : JsonConverter> { writer.WriteStringValue(modifier.ToString()); } + writer.WriteEndArray(); } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Converter/PageSizeConverter.cs b/src/ElectronNET.API/Converter/PageSizeConverter.cs index c79dc27..d896c7a 100644 --- a/src/ElectronNET.API/Converter/PageSizeConverter.cs +++ b/src/ElectronNET.API/Converter/PageSizeConverter.cs @@ -42,5 +42,4 @@ public class PageSizeConverter : JsonConverter JsonSerializer.Serialize(writer, value, ElectronJson.Options); } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/Converter/TitleBarOverlayConverter.cs b/src/ElectronNET.API/Converter/TitleBarOverlayConverter.cs index 2d6044a..e41fca0 100644 --- a/src/ElectronNET.API/Converter/TitleBarOverlayConverter.cs +++ b/src/ElectronNET.API/Converter/TitleBarOverlayConverter.cs @@ -42,5 +42,4 @@ public class TitleBarOverlayConverter : JsonConverter JsonSerializer.Serialize(writer, value, ElectronJson.Options); } } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.API/ElectronNetRuntime.cs b/src/ElectronNET.API/ElectronNetRuntime.cs index 8fd0f0b..3f6fb43 100644 --- a/src/ElectronNET.API/ElectronNetRuntime.cs +++ b/src/ElectronNET.API/ElectronNetRuntime.cs @@ -52,4 +52,4 @@ return RuntimeControllerCore?.Socket; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Runtime/Data/DotnetAppType.cs b/src/ElectronNET.API/Runtime/Data/DotnetAppType.cs index d52328a..9a48304 100644 --- a/src/ElectronNET.API/Runtime/Data/DotnetAppType.cs +++ b/src/ElectronNET.API/Runtime/Data/DotnetAppType.cs @@ -8,4 +8,4 @@ /// ASP.NET Core cross-platform app. AspNetCoreApp, } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Runtime/Data/LifetimeState.cs b/src/ElectronNET.API/Runtime/Data/LifetimeState.cs index 1785887..a643a04 100644 --- a/src/ElectronNET.API/Runtime/Data/LifetimeState.cs +++ b/src/ElectronNET.API/Runtime/Data/LifetimeState.cs @@ -9,4 +9,4 @@ Stopping, Stopped, } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Runtime/Data/StartupMethod.cs b/src/ElectronNET.API/Runtime/Data/StartupMethod.cs index 9d3e380..2dcf68a 100644 --- a/src/ElectronNET.API/Runtime/Data/StartupMethod.cs +++ b/src/ElectronNET.API/Runtime/Data/StartupMethod.cs @@ -34,4 +34,4 @@ /// UnpackedDotnetFirst, } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs b/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs index 8320cfe..203fb47 100644 --- a/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs +++ b/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs @@ -69,4 +69,4 @@ return null; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Runtime/Helpers/PortHelper.cs b/src/ElectronNET.API/Runtime/Helpers/PortHelper.cs index 3a14108..f627c97 100644 --- a/src/ElectronNET.API/Runtime/Helpers/PortHelper.cs +++ b/src/ElectronNET.API/Runtime/Helpers/PortHelper.cs @@ -21,6 +21,5 @@ port += 2; } } - } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs b/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs index d4fbd9d..f5c5f54 100644 --- a/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs +++ b/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs @@ -106,4 +106,4 @@ return null; } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/Serialization/ElectronJson.cs b/src/ElectronNET.API/Serialization/ElectronJson.cs index 3720985..3fa06dd 100644 --- a/src/ElectronNET.API/Serialization/ElectronJson.cs +++ b/src/ElectronNET.API/Serialization/ElectronJson.cs @@ -30,5 +30,4 @@ namespace ElectronNET.API.Serialization internal partial class ElectronJsonContext : JsonSerializerContext { } -} - +} \ No newline at end of file diff --git a/src/ElectronNET.Build/ElectronNET.Build.csproj b/src/ElectronNET.Build/ElectronNET.Build.csproj index 1bcb426..e7cb1b9 100644 --- a/src/ElectronNET.Build/ElectronNET.Build.csproj +++ b/src/ElectronNET.Build/ElectronNET.Build.csproj @@ -1,36 +1,36 @@  - + - - netstandard2.0 - False - - - - - - - - - - - <_DllTargetPath>$(MSBuildThisFileDirectory)\..\ElectronNET\build - - - - + + netstandard2.0 + False + - + - - - + + + <_DllTargetPath>$(MSBuildThisFileDirectory)\..\ElectronNET\build + + + + + + + + + + + + + + diff --git a/src/ElectronNET.Host/api/process.ts b/src/ElectronNET.Host/api/process.ts index e7a6b54..6d3afd0 100644 --- a/src/ElectronNET.Host/api/process.ts +++ b/src/ElectronNET.Host/api/process.ts @@ -37,7 +37,7 @@ export = (socket: Socket) => { electronSocket.emit('process-isMainFrame-completed', false); return; } - electronSocket.emit('process-isMainFrame-completed', process.isMainFrame); + electronSocket.emit('process-isMainFrame-completed', process.isMainFrame); }); socket.on('process-resourcesPath', () => { diff --git a/src/ElectronNET.Host/api/screen.ts b/src/ElectronNET.Host/api/screen.ts index beac16a..61289cf 100644 --- a/src/ElectronNET.Host/api/screen.ts +++ b/src/ElectronNET.Host/api/screen.ts @@ -4,7 +4,7 @@ let electronSocket; export = (socket: Socket) => { electronSocket = socket; - + socket.on('register-screen-display-added', (id) => { screen.on('display-added', (event, display) => { electronSocket.emit('screen-display-added' + id, display); diff --git a/src/ElectronNET.Host/api/shell.ts b/src/ElectronNET.Host/api/shell.ts index 9a0dfd7..eac4dc4 100644 --- a/src/ElectronNET.Host/api/shell.ts +++ b/src/ElectronNET.Host/api/shell.ts @@ -39,7 +39,7 @@ export = (socket: Socket) => { await shell.trashItem(fullPath); success = true; } catch (error) { - success = false; + success = false; } electronSocket.emit('shell-trashItem-completed', success); diff --git a/src/ElectronNET.IntegrationTests/Tests/AppTests.cs b/src/ElectronNET.IntegrationTests/Tests/AppTests.cs index 4512f6b..7658b62 100644 --- a/src/ElectronNET.IntegrationTests/Tests/AppTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/AppTests.cs @@ -12,6 +12,7 @@ namespace ElectronNET.IntegrationTests.Tests { // ReSharper disable once NotAccessedField.Local private readonly ElectronFixture fx; + public AppTests(ElectronFixture fx) { this.fx = fx; @@ -151,7 +152,7 @@ namespace ElectronNET.IntegrationTests.Tests success.Should().BeTrue(); var count = await Electron.App.GetBadgeCountAsync(); // Allow fallback to0 on platforms without badge support - (count ==3 || count ==0).Should().BeTrue(); + (count == 3 || count == 0).Should().BeTrue(); } [Fact(Timeout = 20000)] diff --git a/src/ElectronNET.IntegrationTests/Tests/AutoUpdaterTests.cs b/src/ElectronNET.IntegrationTests/Tests/AutoUpdaterTests.cs index 4da2734..0713832 100644 --- a/src/ElectronNET.IntegrationTests/Tests/AutoUpdaterTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/AutoUpdaterTests.cs @@ -7,18 +7,19 @@ public class AutoUpdaterTests { private readonly ElectronFixture fx; + public AutoUpdaterTests(ElectronFixture fx) { this.fx = fx; } - + [Fact(Timeout = 20000)] public async Task AutoDownload_check() { Electron.AutoUpdater.AutoDownload = false; - var test1 = Electron.AutoUpdater.AutoDownload; + var test1 = Electron.AutoUpdater.AutoDownload; Electron.AutoUpdater.AutoDownload = true; - var test2 = Electron.AutoUpdater.AutoDownload; + var test2 = Electron.AutoUpdater.AutoDownload; test1.Should().BeFalse(); test2.Should().BeTrue(); } @@ -27,9 +28,9 @@ public async Task AutoInstallOnAppQuit_check() { Electron.AutoUpdater.AutoInstallOnAppQuit = false; - var test1 = Electron.AutoUpdater.AutoInstallOnAppQuit; + var test1 = Electron.AutoUpdater.AutoInstallOnAppQuit; Electron.AutoUpdater.AutoInstallOnAppQuit = true; - var test2 = Electron.AutoUpdater.AutoInstallOnAppQuit; + var test2 = Electron.AutoUpdater.AutoInstallOnAppQuit; test1.Should().BeFalse(); test2.Should().BeTrue(); } @@ -38,9 +39,9 @@ public async Task AllowPrerelease_check() { Electron.AutoUpdater.AllowPrerelease = false; - var test1 = Electron.AutoUpdater.AllowPrerelease; + var test1 = Electron.AutoUpdater.AllowPrerelease; Electron.AutoUpdater.AllowPrerelease = true; - var test2 = Electron.AutoUpdater.AllowPrerelease; + var test2 = Electron.AutoUpdater.AllowPrerelease; test1.Should().BeFalse(); test2.Should().BeTrue(); } @@ -49,9 +50,9 @@ public async Task FullChangelog_check() { Electron.AutoUpdater.FullChangelog = false; - var test1 = Electron.AutoUpdater.FullChangelog; + var test1 = Electron.AutoUpdater.FullChangelog; Electron.AutoUpdater.FullChangelog = true; - var test2 = Electron.AutoUpdater.FullChangelog; + var test2 = Electron.AutoUpdater.FullChangelog; test1.Should().BeFalse(); test2.Should().BeTrue(); } @@ -60,9 +61,9 @@ public async Task AllowDowngrade_check() { Electron.AutoUpdater.AllowDowngrade = false; - var test1 = Electron.AutoUpdater.AllowDowngrade; + var test1 = Electron.AutoUpdater.AllowDowngrade; Electron.AutoUpdater.AllowDowngrade = true; - var test2 = Electron.AutoUpdater.AllowDowngrade; + var test2 = Electron.AutoUpdater.AllowDowngrade; test1.Should().BeFalse(); test2.Should().BeTrue(); } @@ -70,10 +71,10 @@ [Fact(Timeout = 20000)] public async Task UpdateConfigPath_check() { - var test1 = Electron.AutoUpdater.UpdateConfigPath; + var test1 = Electron.AutoUpdater.UpdateConfigPath; test1.Should().Be(string.Empty); } - + [Fact(Timeout = 20000)] public async Task CurrentVersionAsync_check() { @@ -107,26 +108,26 @@ test.Count.Should().Be(1); test["key1"].Should().Be("value1"); } - + [Fact(Timeout = 20000)] public async Task CheckForUpdatesAsync_check() { var test = await Electron.AutoUpdater.CheckForUpdatesAsync(); test.Should().BeNull(); } - + [Fact(Timeout = 20000)] public async Task CheckForUpdatesAndNotifyAsync_check() { var test = await Electron.AutoUpdater.CheckForUpdatesAsync(); test.Should().BeNull(); } - + [Fact(Timeout = 20000)] public async Task GetFeedURLAsync_check() { var test = await Electron.AutoUpdater.GetFeedURLAsync(); test.Should().Contain("Deprecated"); } - } -} + } +} \ No newline at end of file diff --git a/src/ElectronNET.IntegrationTests/Tests/BrowserViewTests.cs b/src/ElectronNET.IntegrationTests/Tests/BrowserViewTests.cs index 3e1b626..8405da7 100644 --- a/src/ElectronNET.IntegrationTests/Tests/BrowserViewTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/BrowserViewTests.cs @@ -7,6 +7,7 @@ namespace ElectronNET.IntegrationTests.Tests public class BrowserViewTests { private readonly ElectronFixture fx; + public BrowserViewTests(ElectronFixture fx) { this.fx = fx; diff --git a/src/ElectronNET.IntegrationTests/Tests/CookiesTests.cs b/src/ElectronNET.IntegrationTests/Tests/CookiesTests.cs index 3113fe5..1cba009 100644 --- a/src/ElectronNET.IntegrationTests/Tests/CookiesTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/CookiesTests.cs @@ -4,6 +4,7 @@ namespace ElectronNET.IntegrationTests.Tests public class CookiesTests { private readonly ElectronFixture fx; + public CookiesTests(ElectronFixture fx) { this.fx = fx; diff --git a/src/ElectronNET.IntegrationTests/Tests/IpcMainTests.cs b/src/ElectronNET.IntegrationTests/Tests/IpcMainTests.cs index 7390189..2596e9b 100644 --- a/src/ElectronNET.IntegrationTests/Tests/IpcMainTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/IpcMainTests.cs @@ -6,6 +6,7 @@ namespace ElectronNET.IntegrationTests.Tests public class IpcMainTests { private readonly ElectronFixture fx; + public IpcMainTests(ElectronFixture fx) { this.fx = fx; diff --git a/src/ElectronNET.IntegrationTests/Tests/MenuTests.cs b/src/ElectronNET.IntegrationTests/Tests/MenuTests.cs index d40d898..85a9d84 100644 --- a/src/ElectronNET.IntegrationTests/Tests/MenuTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/MenuTests.cs @@ -7,6 +7,7 @@ namespace ElectronNET.IntegrationTests.Tests public class MenuTests { private readonly ElectronFixture fx; + public MenuTests(ElectronFixture fx) { this.fx = fx; diff --git a/src/ElectronNET.IntegrationTests/Tests/NativeImageTests.cs b/src/ElectronNET.IntegrationTests/Tests/NativeImageTests.cs index da59c92..fd8cac8 100644 --- a/src/ElectronNET.IntegrationTests/Tests/NativeImageTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/NativeImageTests.cs @@ -5,7 +5,7 @@ namespace ElectronNET.IntegrationTests.Tests { using System.Drawing; using ElectronNET.API.Entities; - + [SupportedOSPlatform("Windows")] public class NativeImageTests { diff --git a/src/ElectronNET.IntegrationTests/Tests/NativeThemeTests.cs b/src/ElectronNET.IntegrationTests/Tests/NativeThemeTests.cs index f6b8f5c..16f6f44 100644 --- a/src/ElectronNET.IntegrationTests/Tests/NativeThemeTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/NativeThemeTests.cs @@ -45,14 +45,14 @@ namespace ElectronNET.IntegrationTests.Tests fired.Should().BeTrue(); } - + [Fact(Timeout = 20000)] public async Task Should_use_high_contrast_colors_check() { var metrics = await Electron.NativeTheme.ShouldUseHighContrastColorsAsync(); metrics.Should().Be(false); } - + [Fact(Timeout = 20000)] public async Task Should_use_inverted_colors_check() { diff --git a/src/ElectronNET.IntegrationTests/Tests/ProcessTests.cs b/src/ElectronNET.IntegrationTests/Tests/ProcessTests.cs index d581c3b..6a8eafd 100644 --- a/src/ElectronNET.IntegrationTests/Tests/ProcessTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/ProcessTests.cs @@ -19,41 +19,39 @@ namespace ElectronNET.IntegrationTests.Tests { var execPath = await Electron.Process.ExecPathAsync; execPath.Should().NotBeNullOrWhiteSpace(); - + var pid = await Electron.Process.PidAsync; pid.Should().BeGreaterThan(0); - + var platform = await Electron.Process.PlatformAsync; platform.Should().NotBeNullOrWhiteSpace(); - + var argv = await Electron.Process.ArgvAsync; argv.Should().NotBeNull(); argv.Length.Should().BeGreaterThan(0); - + var type = await Electron.Process.TypeAsync; type.Should().NotBeNullOrWhiteSpace(); - + var version = await Electron.Process.VersionsAsync; version.Should().NotBeNull(); version.Chrome.Should().NotBeNullOrWhiteSpace(); version.Electron.Should().NotBeNullOrWhiteSpace(); - + var defaultApp = await Electron.Process.DefaultAppAsync; defaultApp.Should().BeTrue(); - + var isMainFrame = await Electron.Process.IsMainFrameAsync; isMainFrame.Should().BeFalse(); - + var resourcePath = await Electron.Process.ResourcesPathAsync; resourcePath.Should().NotBeNullOrWhiteSpace(); var upTime = await Electron.Process.UpTimeAsync; upTime.Should().BeGreaterThan(0); - + var arch = await Electron.Process.ArchAsync; arch.Should().NotBeNullOrWhiteSpace(); - } - } } \ No newline at end of file diff --git a/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs b/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs index 1cdb534..5ac585d 100644 --- a/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs @@ -64,7 +64,7 @@ namespace ElectronNET.IntegrationTests.Tests display.Size.Width.Should().BeGreaterThan(0); display.Size.Height.Should().BeGreaterThan(0); } - + [Fact(Timeout = 20000)] public async Task GetDisplayMatching_check() { diff --git a/src/ElectronNET.IntegrationTests/Tests/TrayTests.cs b/src/ElectronNET.IntegrationTests/Tests/TrayTests.cs index c52a913..f5b07ff 100644 --- a/src/ElectronNET.IntegrationTests/Tests/TrayTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/TrayTests.cs @@ -7,6 +7,7 @@ namespace ElectronNET.IntegrationTests.Tests { // ReSharper disable once NotAccessedField.Local private readonly ElectronFixture fx; + public TrayTests(ElectronFixture fx) { this.fx = fx; diff --git a/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs b/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs index c7bdde7..a3d62b2 100644 --- a/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs @@ -71,11 +71,11 @@ namespace ElectronNET.IntegrationTests.Tests var ok = await this.fx.MainWindow.WebContents.PrintAsync(new PrintOptions { Silent = true, PrintBackground = true }); ok.Should().BeTrue(); } - + [SkippableFact(Timeout = 20000)] public async Task GetPrintersAsync_check() { - Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null, "Skipping printer test in CI environment."); + Skip.If(Environment.GetEnvironmentVariable("GITHUB_TOKEN") != null, "Skipping printer test in CI environment."); var info = await fx.MainWindow.WebContents.GetPrintersAsync(); info.Should().NotBeNull(); } diff --git a/src/ElectronNET.WebApp/Controllers/HomeController.cs b/src/ElectronNET.WebApp/Controllers/HomeController.cs index ca610a0..45c4d87 100644 --- a/src/ElectronNET.WebApp/Controllers/HomeController.cs +++ b/src/ElectronNET.WebApp/Controllers/HomeController.cs @@ -25,7 +25,7 @@ namespace ElectronNET.WebApp.Controllers Electron.PowerMonitor.OnBattery += () => { Console.WriteLine("The system is about to change to battery power"); }; } } - + return View(); } } diff --git a/src/ElectronNET.WebApp/Controllers/HostHookController.cs b/src/ElectronNET.WebApp/Controllers/HostHookController.cs index bfc5291..db7a52e 100644 --- a/src/ElectronNET.WebApp/Controllers/HostHookController.cs +++ b/src/ElectronNET.WebApp/Controllers/HostHookController.cs @@ -16,7 +16,7 @@ namespace ElectronNET.WebApp.Controllers var mainWindow = Electron.WindowManager.BrowserWindows.First(); var options = new OpenDialogOptions { - Properties = new OpenDialogProperty[] + Properties = new OpenDialogProperty[] { OpenDialogProperty.openDirectory } diff --git a/src/ElectronNET.WebApp/Controllers/UpdateController.cs b/src/ElectronNET.WebApp/Controllers/UpdateController.cs index 1f2c891..e145ec7 100644 --- a/src/ElectronNET.WebApp/Controllers/UpdateController.cs +++ b/src/ElectronNET.WebApp/Controllers/UpdateController.cs @@ -31,7 +31,7 @@ namespace ElectronNET.WebApp.Controllers { // Electron.NET CLI Command for deploy: // electronize build /target win /electron-params --publish=always - + var currentVersion = await Electron.App.GetVersionAsync(); var updateCheckResult = await Electron.AutoUpdater.CheckForUpdatesAndNotifyAsync(); var availableVersion = updateCheckResult.UpdateInfo.Version; diff --git a/src/ElectronNET.WebApp/ElectronHostHook/connector.ts b/src/ElectronNET.WebApp/ElectronHostHook/connector.ts index 7ba9c0b..5512557 100644 --- a/src/ElectronNET.WebApp/ElectronHostHook/connector.ts +++ b/src/ElectronNET.WebApp/ElectronHostHook/connector.ts @@ -1,7 +1,7 @@ import { Socket } from 'socket.io'; -export class Connector { - constructor(private socket: Socket, +export class Connector { + constructor(private socket: Socket, public app: any) { } on(key: string, javaScriptCode: Function): void {