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 00000000..299bb98f --- /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 00000000..1eab21f2 --- /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 | 42 +++---- 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, 292 insertions(+), 345 deletions(-) diff --git a/nuke/ReleaseNotesParser.cs b/nuke/ReleaseNotesParser.cs index d449a53e..7b7f5f0b 100644 --- a/nuke/ReleaseNotesParser.cs +++ b/nuke/ReleaseNotesParser.cs @@ -85,7 +85,7 @@ private IReadOnlyList ParseComplexFormat(string[] lines) // 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 f2b061c8..95231fe1 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 @@ protected enum SocketTaskEventNameTypes DashesLowerFirst, NoDashUpperFirst } + protected enum SocketTaskMessageNameTypes { DashesLowerFirst, @@ -370,4 +372,4 @@ public bool Unregister(Action receiver) } } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/App.cs b/src/ElectronNET.API/API/App.cs index ee44f096..1c1ffc56 100644 --- a/src/ElectronNET.API/API/App.cs +++ b/src/ElectronNET.API/API/App.cs @@ -58,7 +58,7 @@ public event Action WindowAllClosed 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 @@ internal static App Instance 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 @@ public void SetPath(PathName name, string path) } /// - /// 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 @@ public Task UserAgentFallbackAsync return Task.Run(() => { var taskCompletionSource = new TaskCompletionSource(); - + BridgeConnector.Socket.Once("appGetUserAgentFallbackCompleted", taskCompletionSource.SetResult); BridgeConnector.Socket.Emit("appGetUserAgentFallback"); @@ -1295,4 +1294,4 @@ public void Once(string eventName, Action action) 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 639cd8ca..d0b178b9 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 @@ public bool AutoInstallOnAppQuit } /// - /// *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 @@ public bool AllowPrerelease } /// - /// *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 @@ public Task CurrentVersionAsync } /// - /// 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 @@ public string Channel } /// - /// 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 @@ public Task ChannelAsync } /// - /// Set the update channel. Not applicable for GitHub. + /// Set the update channel. Not applicable for GitHub. /// public string SetChannel { @@ -199,7 +199,7 @@ public event Action OnCheckingForUpdate } /// - /// 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 @@ public Task CheckForUpdatesAndNotifyAsync() } /// - /// 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 @@ public Task GetFeedURLAsync() 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 32030736..21d393fe 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 @@ public void SetBackgroundColor(string color) 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 7cb99386..67f8b969 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 event Action OnClose } /// - /// 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 event Action OnLeaveHtmlFullScreen } /// - /// 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 @@ internal BrowserWindow(int id) } /// - /// 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 @@ internal BrowserWindow(int id) 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 @@ internal BrowserWindow(int id) /// 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 void SetAspectRatio(double aspectRatio, Size extraSize) => 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 void SetAspectRatio(double aspectRatio, Size extraSize) => /// 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 void SetAspectRatio(int aspectRatio, Size extraSize) => /// /// 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 void SetAspectRatio(int aspectRatio, Size extraSize) => 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 @@ private bool isWindows10() 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 @@ private bool isWindows10() 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 @@ private bool isWindows10() 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 @@ private bool isWindows10() 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 IReadOnlyCollection MenuItems 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 IReadOnlyCollection ThumbarButtons 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 Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) /// /// 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 Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) 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 Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) /// /// 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 Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) /// /// 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 Task SetThumbarButtonsAsync(ThumbarButton[] thumbarButtons) 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 async Task> GetChildWindowsAsync() 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 async Task> GetChildWindowsAsync() 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 1a011be9..4b063275 100644 --- a/src/ElectronNET.API/API/Clipboard.cs +++ b/src/ElectronNET.API/API/Clipboard.cs @@ -2,6 +2,7 @@ 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 @@ public void WriteRTF(string text, string type = "") } /// - /// 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 @@ public void WriteRTF(string text, string type = "") /// 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 @@ public void WriteBookmark(string title, string url, string type = "") 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 @@ public void WriteImage(NativeImage image, string type = "") 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 8540598d..dac0d2d0 100644 --- a/src/ElectronNET.API/API/Cookies.cs +++ b/src/ElectronNET.API/API/Cookies.cs @@ -59,7 +59,5 @@ public event Action OnChanged } 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 933c6ea4..fa60840c 100644 --- a/src/ElectronNET.API/API/Dialog.cs +++ b/src/ElectronNET.API/API/Dialog.cs @@ -37,8 +37,8 @@ internal static Dialog Instance } /// - /// 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 @@ public Task ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialo 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 @@ public Task ShowMessageBoxAsync(BrowserWindow browserWindow, M /// /// 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 @@ public void ShowErrorBox(string title, string content) /// /// 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 @@ public Task ShowCertificateTrustDialogAsync(CertificateTrustDialogOptions option /// /// 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 @@ public Task ShowCertificateTrustDialogAsync(BrowserWindow browserWindow, Certifi 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 0a84b27d..1e77d211 100644 --- a/src/ElectronNET.API/API/Dock.cs +++ b/src/ElectronNET.API/API/Dock.cs @@ -208,7 +208,5 @@ public void SetIcon(string image) { 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 9148016a..2866c6e6 100644 --- a/src/ElectronNET.API/API/Electron.cs +++ b/src/ElectronNET.API/API/Electron.cs @@ -140,7 +140,7 @@ public static Clipboard Clipboard /// /// 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 @@ public static HostHook HostHook } /// - /// 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 32289d43..e4b350d2 100644 --- a/src/ElectronNET.API/API/Entities/AutoResizeOptions.cs +++ b/src/ElectronNET.API/API/Entities/AutoResizeOptions.cs @@ -35,4 +35,4 @@ public class AutoResizeOptions [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 d3aaebba..6c7a463b 100644 --- a/src/ElectronNET.API/API/Entities/BitmapOptions.cs +++ b/src/ElectronNET.API/API/Entities/BitmapOptions.cs @@ -10,4 +10,4 @@ public class BitmapOptions /// 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 24b45f60..9260b7c8 100644 --- a/src/ElectronNET.API/API/Entities/BlockMapDataHolder.cs +++ b/src/ElectronNET.API/API/Entities/BlockMapDataHolder.cs @@ -28,4 +28,4 @@ public class BlockMapDataHolder /// 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 a0b3411e..f9eb8ef3 100644 --- a/src/ElectronNET.API/API/Entities/BrowserViewConstructorOptions.cs +++ b/src/ElectronNET.API/API/Entities/BrowserViewConstructorOptions.cs @@ -22,4 +22,4 @@ public class BrowserViewConstructorOptions /// 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 8677aeb0..9b1e1fd8 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 @@ public class BrowserWindowOptions /// 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 f9b73261..acd4746f 100644 --- a/src/ElectronNET.API/API/Entities/CPUUsage.cs +++ b/src/ElectronNET.API/API/Entities/CPUUsage.cs @@ -11,9 +11,9 @@ public class CPUUsage 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 52bc2dc4..36115a9f 100644 --- a/src/ElectronNET.API/API/Entities/ChromeExtensionInfo.cs +++ b/src/ElectronNET.API/API/Entities/ChromeExtensionInfo.cs @@ -26,4 +26,4 @@ public ChromeExtensionInfo(string name, string version) /// 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 45ebb974..d3940e7f 100644 --- a/src/ElectronNET.API/API/Entities/ClearStorageDataOptions.cs +++ b/src/ElectronNET.API/API/Entities/ClearStorageDataOptions.cs @@ -21,4 +21,4 @@ public class ClearStorageDataOptions /// 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 0038357f..ae1a42db 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 @@ public enum CookieChangedCause [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 3c44de6a..389e8ce5 100644 --- a/src/ElectronNET.API/API/Entities/CookieDetails.cs +++ b/src/ElectronNET.API/API/Entities/CookieDetails.cs @@ -49,7 +49,7 @@ public class CookieDetails 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 6b80c219..b2239983 100644 --- a/src/ElectronNET.API/API/Entities/CreateFromBitmapOptions.cs +++ b/src/ElectronNET.API/API/Entities/CreateFromBitmapOptions.cs @@ -20,4 +20,4 @@ public class CreateFromBitmapOptions /// 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 e7d066e7..b28f6166 100644 --- a/src/ElectronNET.API/API/Entities/CreateInterruptedDownloadOptions.cs +++ b/src/ElectronNET.API/API/Entities/CreateInterruptedDownloadOptions.cs @@ -64,4 +64,4 @@ public CreateInterruptedDownloadOptions(string path, string[] urlChain, int offs 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 967cc53d..64fed7a1 100644 --- a/src/ElectronNET.API/API/Entities/EnableNetworkEmulationOptions.cs +++ b/src/ElectronNET.API/API/Entities/EnableNetworkEmulationOptions.cs @@ -25,4 +25,4 @@ public class EnableNetworkEmulationOptions /// 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 6bd8cbe1..d4edd975 100644 --- a/src/ElectronNET.API/API/Entities/Extension.cs +++ b/src/ElectronNET.API/API/Entities/Extension.cs @@ -35,4 +35,4 @@ public class Extension /// 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 1a49de9b..1904958c 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 8c0cb632..98370e5e 100644 --- a/src/ElectronNET.API/API/Entities/InputEvent.cs +++ b/src/ElectronNET.API/API/Entities/InputEvent.cs @@ -77,6 +77,4 @@ public class InputEvent /// 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 9c99d8ff..660a7825 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 @@ public class JumpListCategory /// 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 b2e41df2..9c57ba82 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 @@ public class JumpListItem /// 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 840cb5d7..a7eb0949 100644 --- a/src/ElectronNET.API/API/Entities/MemoryInfo.cs +++ b/src/ElectronNET.API/API/Entities/MemoryInfo.cs @@ -11,7 +11,7 @@ public class MemoryInfo 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 200b5cd4..b50b9658 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 @@ public class MenuItem /// 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 22284d66..b4f7e09d 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 @@ public MessageBoxOptions(string message) 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 835c292c..1894c09c 100644 --- a/src/ElectronNET.API/API/Entities/MessageBoxResult.cs +++ b/src/ElectronNET.API/API/Entities/MessageBoxResult.cs @@ -21,4 +21,4 @@ public class MessageBoxResult /// 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 00ac690c..dddcbccc 100644 --- a/src/ElectronNET.API/API/Entities/NativeImageJsonConverter.cs +++ b/src/ElectronNET.API/API/Entities/NativeImageJsonConverter.cs @@ -35,5 +35,4 @@ public override NativeImage Read(ref Utf8JsonReader reader, Type typeToConvert, 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 a3f03176..2a57182f 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 5f8ccb9f..52c2b149 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 d280579b..b94da91f 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 @@ public class OpenDevToolsOptions /// 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 f6c58198..26cd6ecc 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 @@ public class OpenDialogOptions 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 @@ public class OpenDialogOptions /// 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 607a59c3..42562256 100644 --- a/src/ElectronNET.API/API/Entities/PageSize.cs +++ b/src/ElectronNET.API/API/Entities/PageSize.cs @@ -17,4 +17,4 @@ public 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 e9500c21..e83ba8b0 100644 --- a/src/ElectronNET.API/API/Entities/PathName.cs +++ b/src/ElectronNET.API/API/Entities/PathName.cs @@ -20,7 +20,7 @@ public enum PathName 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 @@ public enum PathName [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 4e6fe54c..d7d3c012 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 898486e6..ee01720a 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 @@ public class ProgressBarOptions /// 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 75c94970..1427cf8c 100644 --- a/src/ElectronNET.API/API/Entities/ProgressInfo.cs +++ b/src/ElectronNET.API/API/Entities/ProgressInfo.cs @@ -30,4 +30,4 @@ public class ProgressInfo /// 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 3dd9ac00..c9df6475 100644 --- a/src/ElectronNET.API/API/Entities/ProxyConfig.cs +++ b/src/ElectronNET.API/API/Entities/ProxyConfig.cs @@ -33,4 +33,4 @@ public ProxyConfig(string pacScript, string proxyRules, string proxyBypassRules) 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 c9ebf2aa..6b0c9777 100644 --- a/src/ElectronNET.API/API/Entities/ReleaseNoteInfo.cs +++ b/src/ElectronNET.API/API/Entities/ReleaseNoteInfo.cs @@ -15,4 +15,4 @@ public class ReleaseNoteInfo /// 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 811c19ed..b2afb415 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 @@ public class RemovePassword 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 @@ public RemovePassword(string type) 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 1490ccdb..e506cb82 100644 --- a/src/ElectronNET.API/API/Entities/ResizeOptions.cs +++ b/src/ElectronNET.API/API/Entities/ResizeOptions.cs @@ -20,4 +20,4 @@ public class ResizeOptions /// 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 16811d70..9c549a7f 100644 --- a/src/ElectronNET.API/API/Entities/SaveDialogOptions.cs +++ b/src/ElectronNET.API/API/Entities/SaveDialogOptions.cs @@ -27,7 +27,7 @@ public class SaveDialogOptions 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 fda0aaee..c2b6d3f9 100644 --- a/src/ElectronNET.API/API/Entities/ShortcutLinkOperation.cs +++ b/src/ElectronNET.API/API/Entities/ShortcutLinkOperation.cs @@ -25,4 +25,4 @@ public enum ShortcutLinkOperation [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 051976f5..af9bcce7 100644 --- a/src/ElectronNET.API/API/Entities/ThumbarButton.cs +++ b/src/ElectronNET.API/API/Entities/ThumbarButton.cs @@ -56,5 +56,4 @@ public ThumbarButton(string icon) 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 f28ac954..7d117f30 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 1a08c3bf..98593fa7 100644 --- a/src/ElectronNET.API/API/Entities/ToBitmapOptions.cs +++ b/src/ElectronNET.API/API/Entities/ToBitmapOptions.cs @@ -10,4 +10,4 @@ public class ToBitmapOptions /// 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 0df4aa99..748b206a 100644 --- a/src/ElectronNET.API/API/Entities/ToDataUrlOptions.cs +++ b/src/ElectronNET.API/API/Entities/ToDataUrlOptions.cs @@ -10,4 +10,4 @@ public class ToDataUrlOptions /// 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 f4e36b10..47a2cd0b 100644 --- a/src/ElectronNET.API/API/Entities/ToPNGOptions.cs +++ b/src/ElectronNET.API/API/Entities/ToPNGOptions.cs @@ -10,4 +10,4 @@ public class ToPNGOptions /// 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 66c75aa2..ed3b4097 100644 --- a/src/ElectronNET.API/API/Entities/UpdateCheckResult.cs +++ b/src/ElectronNET.API/API/Entities/UpdateCheckResult.cs @@ -20,4 +20,4 @@ public class UpdateCheckResult /// 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 5f5d6f62..4163ac1f 100644 --- a/src/ElectronNET.API/API/Entities/UpdateFileInfo.cs +++ b/src/ElectronNET.API/API/Entities/UpdateFileInfo.cs @@ -10,4 +10,4 @@ public class UpdateFileInfo : BlockMapDataHolder /// 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 12d8bf40..07f51001 100644 --- a/src/ElectronNET.API/API/Entities/WebPreferences.cs +++ b/src/ElectronNET.API/API/Entities/WebPreferences.cs @@ -213,4 +213,4 @@ public class WebPreferences [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 3b155546..11cdaf12 100644 --- a/src/ElectronNET.API/API/Extensions/ThumbarButtonExtensions.cs +++ b/src/ElectronNET.API/API/Extensions/ThumbarButtonExtensions.cs @@ -36,4 +36,4 @@ public static ThumbarButton GetThumbarButton(this List thumbarBut 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 9786fe6c..46a6b911 100644 --- a/src/ElectronNET.API/API/GlobalShortcut.cs +++ b/src/ElectronNET.API/API/GlobalShortcut.cs @@ -39,10 +39,10 @@ internal static GlobalShortcut Instance 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 @@ public void Register(string accelerator, Action function) } /// - /// 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 634f7603..31bbc455 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 @@ internal static HostHook Instance /// 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 @@ public Task CallAsync(string socketEventName, params dynamic[] arguments) 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 21c25922..239098b8 100644 --- a/src/ElectronNET.API/API/IpcMain.cs +++ b/src/ElectronNET.API/API/IpcMain.cs @@ -39,7 +39,7 @@ internal static IpcMain Instance } /// - /// 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 @@ private static List FormatArguments(JsonElement args) } /// - /// 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 @@ public void Send(BrowserView browserView, string channel, params object[] data) { 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 c037532c..7571ef02 100644 --- a/src/ElectronNET.API/API/Menu.cs +++ b/src/ElectronNET.API/API/Menu.cs @@ -129,7 +129,5 @@ public void ContextMenuPopup(BrowserWindow browserWindow) { 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 5e7c9915..0879fe80 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 @@ internal static NativeTheme Instance /// /// /// The 'updated' event will be emitted - /// + /// /// /// /// Settings this property to will have the following effects: @@ -79,7 +79,7 @@ internal static NativeTheme Instance /// /// 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 fe17bf94..a5f03f94 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 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio 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 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio 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 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio /// 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 51ae2818..5e14dafe 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 @@ public event Action OnLockScreen } /// - /// 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 3edf1b56..e3c2d264 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 @@ internal static Process Instance /// /// 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 @@ internal static Process Instance /// /// The process.versions property returns an object listing the version strings of /// chrome and electron. - /// + /// public Task VersionsAsync => this.InvokeAsync(); /// @@ -105,4 +106,4 @@ internal static Process Instance /// 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 17bf13f0..65c01079 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 @@ public event Action OnDisplayRemoved } /// - /// 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 @@ public event Action OnDisplayMetricsChanged BridgeConnector.Socket.Emit("register-screen-display-metrics-changed", GetHashCode()); } + _onDisplayMetricsChanged += value; } remove @@ -134,4 +135,4 @@ internal static Screen Instance /// 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 bee7566c..ef3b44df 100644 --- a/src/ElectronNET.API/API/Session.cs +++ b/src/ElectronNET.API/API/Session.cs @@ -373,7 +373,5 @@ public Task LoadExtensionAsync(string path, bool allowFileAccess = fa 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 14bfcbcb..3b3d22aa 100644 --- a/src/ElectronNET.API/API/Shell.cs +++ b/src/ElectronNET.API/API/Shell.cs @@ -68,7 +68,7 @@ public Task OpenPathAsync(string path) } /// - /// 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 @@ public Task OpenExternalAsync(string url) } /// - /// 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 @@ public Task ReadShortcutLinkAsync(string shortcutPath) 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 a18b178e..ad9bc959 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 @@ public event Action OnClick BridgeConnector.Socket.Emit("register-tray-click", GetHashCode()); } + _click += value; } remove @@ -72,6 +73,7 @@ public event Action OnRightClick BridgeConnector.Socket.Emit("register-tray-right-click", GetHashCode()); } + _rightClick += value; } remove @@ -106,6 +108,7 @@ public event Action OnDoubleClick BridgeConnector.Socket.Emit("register-tray-double-click", GetHashCode()); } + _doubleClick += value; } remove @@ -140,7 +143,7 @@ public event Action OnBalloonClick } /// - /// 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 @@ public async Task IsDestroyedAsync() } - private const string ModuleName = "tray"; /// @@ -330,4 +332,4 @@ public void Once(string eventName, Action action) 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 5c598d2f..2ded9f60 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 void OpenDevTools(OpenDevToolsOptions openDevToolsOptions) /// /// success public Task PrintAsync(PrintOptions options) => this.InvokeAsync(options); + /// /// Prints window's web page. /// @@ -155,8 +156,8 @@ public void OpenDevTools(OpenDevToolsOptions openDevToolsOptions) /// /// 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 Task GetUrl() } /// - /// 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 Task LoadURLAsync(string url) } /// - /// 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 Task LoadURLAsync(string url, LoadURLOptions options) 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 void InsertCSS(bool isBrowserWindow, string path) { 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 0bbd5efa..a39a97b7 100644 --- a/src/ElectronNET.API/API/WebRequest.cs +++ b/src/ElectronNET.API/API/WebRequest.cs @@ -59,4 +59,4 @@ public void RemoveListener(Action> listen } } } -} +} \ No newline at end of file diff --git a/src/ElectronNET.API/API/WindowManager.cs b/src/ElectronNET.API/API/WindowManager.cs index 665aef0a..20a6b193 100644 --- a/src/ElectronNET.API/API/WindowManager.cs +++ b/src/ElectronNET.API/API/WindowManager.cs @@ -158,8 +158,8 @@ private bool IsWindows10() } /// - /// 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 @@ public Task CreateBrowserViewAsync() } /// - /// 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 @@ public async Task CreateBrowserViewAsync(BrowserViewConstructorOpti 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 ed13afc9..06015a0a 100644 --- a/src/ElectronNET.API/Bridge/SocketIOFacade.cs +++ b/src/ElectronNET.API/Bridge/SocketIOFacade.cs @@ -121,4 +121,4 @@ public void DisposeSocket() { _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 515488b0..a5de118c 100644 --- a/src/ElectronNET.API/Common/Extensions.cs +++ b/src/ElectronNET.API/Common/Extensions.cs @@ -51,14 +51,14 @@ public static string StripAsync(this string str) 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 @@ public static string ToDashedEventName(this string str) { return string.Join("-", Regex.Split(str.StripOn(), "(? Read(ref Utf8JsonReader reader, Type typeToCo { throw new JsonException("Expected array for ModifierType list"); } + while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndArray) break; @@ -30,6 +31,7 @@ public override List Read(ref Utf8JsonReader reader, Type typeToCo var s = reader.GetString(); list.Add((ModifierType)Enum.Parse(typeof(ModifierType), s, ignoreCase: true)); } + return list; } @@ -40,6 +42,7 @@ public override void Write(Utf8JsonWriter writer, List value, Json { 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 c79dc278..d896c7ad 100644 --- a/src/ElectronNET.API/Converter/PageSizeConverter.cs +++ b/src/ElectronNET.API/Converter/PageSizeConverter.cs @@ -42,5 +42,4 @@ public override void Write(Utf8JsonWriter writer, PageSize value, JsonSerializer 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 2d6044a9..e41fca09 100644 --- a/src/ElectronNET.API/Converter/TitleBarOverlayConverter.cs +++ b/src/ElectronNET.API/Converter/TitleBarOverlayConverter.cs @@ -42,5 +42,4 @@ public override void Write(Utf8JsonWriter writer, TitleBarOverlay value, JsonSer 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 8fd0f0b0..3f6fb434 100644 --- a/src/ElectronNET.API/ElectronNetRuntime.cs +++ b/src/ElectronNET.API/ElectronNetRuntime.cs @@ -52,4 +52,4 @@ internal static SocketIoFacade GetSocket() 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 d52328a6..9a48304b 100644 --- a/src/ElectronNET.API/Runtime/Data/DotnetAppType.cs +++ b/src/ElectronNET.API/Runtime/Data/DotnetAppType.cs @@ -8,4 +8,4 @@ public enum DotnetAppType /// 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 1785887a..a643a043 100644 --- a/src/ElectronNET.API/Runtime/Data/LifetimeState.cs +++ b/src/ElectronNET.API/Runtime/Data/LifetimeState.cs @@ -9,4 +9,4 @@ public enum LifetimeState 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 9d3e380b..2dcf68a8 100644 --- a/src/ElectronNET.API/Runtime/Data/StartupMethod.cs +++ b/src/ElectronNET.API/Runtime/Data/StartupMethod.cs @@ -34,4 +34,4 @@ public enum StartupMethod /// 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 8320cfe0..203fb476 100644 --- a/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs +++ b/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs @@ -69,4 +69,4 @@ public static bool CheckIsLaunchedByDotNet() 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 3a141082..f627c971 100644 --- a/src/ElectronNET.API/Runtime/Helpers/PortHelper.cs +++ b/src/ElectronNET.API/Runtime/Helpers/PortHelper.cs @@ -21,6 +21,5 @@ public static int GetFreePort(int? defaultPost) 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 d4fbd9da..f5c5f549 100644 --- a/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs +++ b/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs @@ -106,4 +106,4 @@ public static bool CheckIsUnpackaged() 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 37209850..3fa06ddf 100644 --- a/src/ElectronNET.API/Serialization/ElectronJson.cs +++ b/src/ElectronNET.API/Serialization/ElectronJson.cs @@ -30,5 +30,4 @@ internal static class ElectronJson 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 1bcb4269..e7cb1b9e 100644 --- a/src/ElectronNET.Build/ElectronNET.Build.csproj +++ b/src/ElectronNET.Build/ElectronNET.Build.csproj @@ -1,36 +1,36 @@  - + - - netstandard2.0 - False - + + netstandard2.0 + False + - - - + + + - - - <_DllTargetPath>$(MSBuildThisFileDirectory)\..\ElectronNET\build + - + <_DllTargetPath>$(MSBuildThisFileDirectory)\..\ElectronNET\build - + - - - + + + + + - + - + - + diff --git a/src/ElectronNET.Host/api/process.ts b/src/ElectronNET.Host/api/process.ts index e7a6b541..6d3afd0f 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 beac16a0..61289cf5 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 9a0dfd7f..eac4dc46 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 4512f6b9..7658b623 100644 --- a/src/ElectronNET.IntegrationTests/Tests/AppTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/AppTests.cs @@ -12,6 +12,7 @@ public class AppTests { // ReSharper disable once NotAccessedField.Local private readonly ElectronFixture fx; + public AppTests(ElectronFixture fx) { this.fx = fx; @@ -151,7 +152,7 @@ public async Task App_badge_count_roundtrip() 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 4da2734b..07138323 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 AutoDownload_check() 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 AutoInstallOnAppQuit_check() 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 AllowPrerelease_check() 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 FullChangelog_check() 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 @@ public async Task AllowDowngrade_check() [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 @@ public async Task RequestHeadersAsync_check() 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 3e1b626f..8405da75 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 3113fe52..1cba009b 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 73901897..2596e9bd 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 d40d8984..85a9d847 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 da59c925..fd8cac8a 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 f6b8f5ce..16f6f44e 100644 --- a/src/ElectronNET.IntegrationTests/Tests/NativeThemeTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/NativeThemeTests.cs @@ -45,14 +45,14 @@ public async Task Updated_event_fires_on_change() 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 d581c3b4..6a8eafd8 100644 --- a/src/ElectronNET.IntegrationTests/Tests/ProcessTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/ProcessTests.cs @@ -19,41 +19,39 @@ public async Task Process_properties_are_populated() { 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 1cdb5347..5ac585df 100644 --- a/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs @@ -64,7 +64,7 @@ public async Task GetDisplayNearestPoint_check() 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 c52a9137..f5b07ff1 100644 --- a/src/ElectronNET.IntegrationTests/Tests/TrayTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/TrayTests.cs @@ -7,6 +7,7 @@ public class TrayTests { // 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 c7bdde7a..a3d62b29 100644 --- a/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs @@ -71,11 +71,11 @@ public async Task Can_basic_print() 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 ca610a0f..45c4d875 100644 --- a/src/ElectronNET.WebApp/Controllers/HomeController.cs +++ b/src/ElectronNET.WebApp/Controllers/HomeController.cs @@ -25,7 +25,7 @@ public IActionResult Index() 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 bfc5291f..db7a52e6 100644 --- a/src/ElectronNET.WebApp/Controllers/HostHookController.cs +++ b/src/ElectronNET.WebApp/Controllers/HostHookController.cs @@ -16,7 +16,7 @@ public IActionResult Index() 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 1f2c8919..e145ec77 100644 --- a/src/ElectronNET.WebApp/Controllers/UpdateController.cs +++ b/src/ElectronNET.WebApp/Controllers/UpdateController.cs @@ -31,7 +31,7 @@ public IActionResult Index() { // 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 7ba9c0b3..55125575 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 {