Fix whitespace formatting

This commit is contained in:
softworkz
2025-11-15 08:05:31 +01:00
parent 30b547b8d3
commit 8e7892ebd4
106 changed files with 296 additions and 349 deletions

View File

@@ -85,7 +85,7 @@ public sealed class ReleaseNotesParser
// Parse content.
var notes = new List<string>();
while (true)
{
// Sanity checks.

View File

@@ -1,4 +1,5 @@
// ReSharper disable InconsistentNaming
namespace ElectronNET.API
{
using Common;
@@ -17,6 +18,7 @@ namespace ElectronNET.API
DashesLowerFirst,
NoDashUpperFirst
}
protected enum SocketTaskMessageNameTypes
{
DashesLowerFirst,
@@ -370,4 +372,4 @@ namespace ElectronNET.API
}
}
}
}
}

View File

@@ -58,7 +58,7 @@ namespace ElectronNET.API
private event Action _windowAllClosed;
/// <summary>
/// Emitted before the application starts closing its windows.
/// Emitted before the application starts closing its windows.
/// <para/>
/// Note: If application quit was initiated by <see cref="AutoUpdater.QuitAndInstall"/> then <see cref="BeforeQuit"/>
/// is emitted after emitting close event on all windows and closing them.
@@ -399,7 +399,6 @@ namespace ElectronNET.API
private static object _syncRoot = new object();
/// <summary>
/// Try to close all windows. The <see cref="BeforeQuit"/> event will be emitted first. If all windows are successfully
/// closed, the <see cref="WillQuit"/> event will be emitted and by default the application will terminate. This method
@@ -558,7 +557,7 @@ namespace ElectronNET.API
}
/// <summary>
/// The version of the loaded application. If no version is found in the applications package.json file,
/// The version of the loaded application. If no version is found in the applications package.json file,
/// the version of the current bundle or executable is returned.
/// </summary>
/// <returns>The version of the loaded application.</returns>
@@ -1245,7 +1244,7 @@ namespace ElectronNET.API
return Task.Run(() =>
{
var taskCompletionSource = new TaskCompletionSource<string>();
BridgeConnector.Socket.Once<string>("appGetUserAgentFallbackCompleted", taskCompletionSource.SetResult);
BridgeConnector.Socket.Emit("appGetUserAgentFallback");
@@ -1295,4 +1294,4 @@ namespace ElectronNET.API
public async Task Once(string eventName, Action<object> action)
=> await Events.Instance.Once(ModuleName, eventName, action).ConfigureAwait(false);
}
}
}

View File

@@ -10,7 +10,7 @@ namespace ElectronNET.API
/// <summary>
/// Enable apps to automatically update themselves. Based on electron-updater.
/// </summary>
public sealed class AutoUpdater: ApiBase
public sealed class AutoUpdater : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst;
@@ -49,7 +49,7 @@ namespace ElectronNET.API
}
/// <summary>
/// *GitHub provider only.* Whether to allow update to pre-release versions.
/// *GitHub provider only.* Whether to allow update to pre-release versions.
/// Defaults to "true" if application version contains prerelease components (e.g. "0.12.1-alpha.1", here "alpha" is a prerelease component), otherwise "false".
///
/// If "true", downgrade will be allowed("allowDowngrade" will be set to "true").
@@ -67,7 +67,7 @@ namespace ElectronNET.API
}
/// <summary>
/// *GitHub provider only.*
/// *GitHub provider only.*
/// Get all release notes (from current version to latest), not just the latest (Default is false).
/// </summary>
public bool FullChangelog
@@ -122,7 +122,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Get the update channel. Not applicable for GitHub.
/// Get the update channel. Not applicable for GitHub.
/// Doesnt return channel from the update configuration, only if was previously set.
/// </summary>
[Obsolete("Use the asynchronous version ChannelAsync instead")]
@@ -135,7 +135,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Get the update channel. Not applicable for GitHub.
/// Get the update channel. Not applicable for GitHub.
/// Doesnt return channel from the update configuration, only if was previously set.
/// </summary>
public Task<string> ChannelAsync
@@ -147,7 +147,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Set the update channel. Not applicable for GitHub.
/// Set the update channel. Not applicable for GitHub.
/// </summary>
public string SetChannel
{
@@ -199,7 +199,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Emitted when there is an available update.
/// Emitted when there is an available update.
/// The update is downloaded automatically if AutoDownload is true.
/// </summary>
public event Action<UpdateInfo> OnUpdateAvailable
@@ -332,11 +332,11 @@ namespace ElectronNET.API
}
/// <summary>
/// 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.
/// </summary>
/// <param name="isSilent">*windows-only* Runs the installer in silent mode. Defaults to `false`.</param>
/// <param name="isForceRunAfter">Run the app after finish even on silent install. Not applicable for macOS. Ignored if `isSilent` is set to `false`.</param>
@@ -374,9 +374,5 @@ namespace ElectronNET.API
return tcs.Task;
}
}
}
}

View File

@@ -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.
/// </summary>
public class BrowserView: ApiBase
public class BrowserView : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst;
/// <summary>
/// Gets the identifier.
/// </summary>
@@ -69,5 +70,4 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("browserView-setBackgroundColor", Id, color);
}
}
}
}

View File

@@ -27,7 +27,7 @@ public class BrowserWindow : ApiBase
public override int Id { get; protected set; }
/// <summary>
/// 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.
/// </summary>
public event Action OnReadyToShow
@@ -55,8 +55,8 @@ public class BrowserWindow : ApiBase
}
/// <summary>
/// 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.
/// </summary>
public event Action OnClosed
@@ -230,12 +230,12 @@ public class BrowserWindow : ApiBase
}
/// <summary>
/// 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.
/// </summary>
public event Action<string> OnAppCommand
@@ -287,15 +287,15 @@ public class BrowserWindow : ApiBase
}
/// <summary>
/// Force closing the window, the unload and beforeunload event wont be
/// emitted for the web page, and close event will also not be emitted
/// Force closing the window, the unload and beforeunload event wont 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.
/// </summary>
public void Destroy() => this.CallMethod0();
/// <summary>
/// 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.
/// </summary>
public void Close() => this.CallMethod0();
@@ -393,7 +393,7 @@ public class BrowserWindow : ApiBase
public Task<bool> IsFullScreenAsync() => this.InvokeAsync<bool>();
/// <summary>
/// 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 windows size and its content size.
///
@@ -401,7 +401,7 @@ public class BrowserWindow : ApiBase
/// of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below
/// the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
/// the player itself we would call this function with arguments of 16/9 and[40, 50]. The second argument
/// doesnt care where the extra width and height are within the content viewonly that they exist. Just
/// doesnt care where the extra width and height are within the content viewonly that they exist. Just
/// sum any extra width and height areas you have within the overall content view.
/// </summary>
/// <param name="aspectRatio">The aspect ratio to maintain for some portion of the content view.</param>
@@ -410,7 +410,7 @@ public class BrowserWindow : ApiBase
this.CallMethod2(aspectRatio, extraSize);
/// <summary>
/// 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 windows size and its content size.
///
@@ -418,7 +418,7 @@ public class BrowserWindow : ApiBase
/// of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below
/// the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
/// the player itself we would call this function with arguments of 16/9 and[40, 50]. The second argument
/// doesnt care where the extra width and height are within the content viewonly that they exist. Just
/// doesnt care where the extra width and height are within the content viewonly that they exist. Just
/// sum any extra width and height areas you have within the overall content view.
/// </summary>
/// <param name="aspectRatio">The aspect ratio to maintain for some portion of the content view.</param>
@@ -429,18 +429,18 @@ public class BrowserWindow : ApiBase
/// <summary>
/// Uses Quick Look to preview a file at a given path.
/// </summary>
/// <param name="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
/// <param name="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
/// file to open.</param>
public void PreviewFile(string path) => this.CallMethod1(path);
/// <summary>
/// Uses Quick Look to preview a file at a given path.
/// </summary>
/// <param name="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
/// <param name="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
/// file to open.</param>
/// <param name="displayname">The name of the file to display on the Quick Look modal view. This is
/// <param name="displayname">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.</param>
public void PreviewFile(string path, string displayname) => this.CallMethod2(path, displayname);
@@ -636,34 +636,34 @@ public class BrowserWindow : ApiBase
public Task<bool> IsClosableAsync() => this.InvokeAsync<bool>();
/// <summary>
/// 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.
/// </summary>
/// <param name="flag"></param>
public void SetAlwaysOnTop(bool flag) => this.CallMethod1(flag);
/// <summary>
/// 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.
/// </summary>
/// <param name="flag"></param>
/// <param name="level">Values include normal, floating, torn-off-menu, modal-panel, main-menu,
/// status, pop-up-menu and screen-saver. The default is floating.
/// <param name="level">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</param>
public void SetAlwaysOnTop(bool flag, OnTopLevel level) => this.CallMethod2(flag, level.GetDescription());
/// <summary>
/// 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.
/// </summary>
/// <param name="flag"></param>
/// <param name="level">Values include normal, floating, torn-off-menu, modal-panel, main-menu,
/// status, pop-up-menu and screen-saver. The default is floating.
/// <param name="level">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</param>
/// <param name="relativeLevel">The number of layers higher to set this window relative to the given level.
/// <param name="relativeLevel">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.</param>
public void SetAlwaysOnTop(bool flag, OnTopLevel level, int relativeLevel) => this.CallMethod3(flag, level.GetDescription(), relativeLevel);
@@ -738,16 +738,16 @@ public class BrowserWindow : ApiBase
public Task<string> GetTitleAsync() => this.InvokeAsync<string>();
/// <summary>
/// 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.
/// </summary>
/// <param name="offsetY"></param>
public void SetSheetOffset(float offsetY) => this.CallMethod1(offsetY);
/// <summary>
/// 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.
/// </summary>
/// <param name="offsetY"></param>
@@ -785,7 +785,7 @@ public class BrowserWindow : ApiBase
public Task<string> GetNativeWindowHandle() => this.InvokeAsync<string>();
/// <summary>
/// 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 windows title bar.
/// </summary>
/// <param name="filename"></param>
@@ -798,7 +798,7 @@ public class BrowserWindow : ApiBase
public Task<string> GetRepresentedFilenameAsync() => this.InvokeAsync<string>();
/// <summary>
/// Specifies whether the windows document has been edited,
/// Specifies whether the windows document has been edited,
/// and the icon in title bar will become gray when set to true.
/// </summary>
/// <param name="edited"></param>
@@ -821,14 +821,14 @@ public class BrowserWindow : ApiBase
public void BlurWebView() => this.CallMethod0();
/// <summary>
/// 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.
/// </summary>
/// <param name="url"></param>
public void LoadURL(string url) => this.CallMethod1(url);
/// <summary>
/// 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.
/// </summary>
/// <param name="url"></param>
@@ -857,7 +857,7 @@ public class BrowserWindow : ApiBase
private List<MenuItem> _items = new List<MenuItem>();
/// <summary>
/// Sets the menu as the windows menu bar,
/// Sets the menu as the windows menu bar,
/// setting it to null will remove the menu bar.
/// </summary>
/// <param name="menuItems"></param>
@@ -939,11 +939,11 @@ public class BrowserWindow : ApiBase
private List<ThumbarButton> _thumbarButtons = new List<ThumbarButton>();
/// <summary>
/// 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 platforms limitation.But you can call the API with an
/// empty array to clean the buttons.
@@ -988,7 +988,7 @@ public class BrowserWindow : ApiBase
/// <summary>
/// Sets the properties for the windows 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.
/// </summary>
/// <param name="options"></param>
@@ -1000,7 +1000,7 @@ public class BrowserWindow : ApiBase
public void ShowDefinitionForSelection() => this.CallMethod0();
/// <summary>
/// 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) wont hide it immediately.
@@ -1046,7 +1046,7 @@ public class BrowserWindow : ApiBase
/// <summary>
/// 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.
/// </summary>
/// <param name="ignore"></param>
@@ -1055,7 +1055,7 @@ public class BrowserWindow : ApiBase
/// <summary>
/// Prevents the window contents from being captured by other apps.
///
/// On macOS it sets the NSWindows sharingType to NSWindowSharingNone.
/// On macOS it sets the NSWindows sharingType to NSWindowSharingNone.
/// On Windows it calls SetWindowDisplayAffinity with WDA_MONITOR.
/// </summary>
/// <param name="enable"></param>
@@ -1068,7 +1068,7 @@ public class BrowserWindow : ApiBase
public void SetFocusable(bool focusable) => this.CallMethod1(focusable);
/// <summary>
/// Sets parent as current windows parent window,
/// Sets parent as current windows parent window,
/// passing null will turn current window into a top-level window.
/// </summary>
/// <param name="parent"></param>
@@ -1120,11 +1120,11 @@ public class BrowserWindow : ApiBase
public void SetAutoHideCursor(bool autoHide) => this.CallMethod1(autoHide);
/// <summary>
/// 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.
/// </summary>
/// <param name="type">Can be appearance-based, light, dark, titlebar, selection,
/// menu, popover, sidebar, medium-light or ultra-dark.
/// <param name="type">Can be appearance-based, light, dark, titlebar, selection,
/// menu, popover, sidebar, medium-light or ultra-dark.
/// See the macOS documentation for more details.</param>
public void SetVibrancy(Vibrancy type) => this.CallMethod1(type.GetDescription());
@@ -1134,8 +1134,8 @@ public class BrowserWindow : ApiBase
public WebContents WebContents { get; internal set; }
/// <summary>
/// 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.
/// </summary>
/// <param name="browserView"></param>

View File

@@ -2,6 +2,7 @@ using ElectronNET.API.Entities;
using ElectronNET.API.Serialization;
using System.Text.Json;
using System.Threading.Tasks;
// ReSharper disable InconsistentNaming
namespace ElectronNET.API
@@ -9,7 +10,7 @@ namespace ElectronNET.API
/// <summary>
/// Perform copy and paste operations on the system clipboard.
/// </summary>
public sealed class Clipboard: ApiBase
public sealed class Clipboard : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst;
@@ -92,8 +93,8 @@ namespace ElectronNET.API
}
/// <summary>
/// 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.
/// </summary>
/// <returns></returns>
@@ -103,7 +104,7 @@ namespace ElectronNET.API
/// Writes the title and url into the clipboard as a bookmark.
///
/// Note: Most apps on Windows dont 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.
/// </summary>
/// <param name="title"></param>
@@ -123,7 +124,7 @@ namespace ElectronNET.API
public Task<string> ReadFindTextAsync() => this.InvokeAsync<string>();
/// <summary>
/// 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.
/// </summary>
/// <param name="text"></param>
@@ -175,4 +176,4 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("clipboard-writeImage", JsonSerializer.Serialize(image, ElectronJson.Options), type);
}
}
}
}

View File

@@ -59,7 +59,5 @@ namespace ElectronNET.API
}
private event Action<Cookie, CookieChangedCause, bool> _changed;
}
}
}

View File

@@ -37,8 +37,8 @@ namespace ElectronNET.API
}
/// <summary>
/// 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.
/// </summary>
/// <param name="browserWindow">The browserWindow argument allows the dialog to attach itself to a parent window, making it modal.</param>
@@ -50,9 +50,9 @@ namespace ElectronNET.API
var guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.Once<string[]>("showOpenDialogComplete" + guid, tcs.SetResult);
BridgeConnector.Socket.Emit("showOpenDialog",
browserWindow,
options,
BridgeConnector.Socket.Emit("showOpenDialog",
browserWindow,
options,
guid);
return tcs.Task;
@@ -167,9 +167,9 @@ namespace ElectronNET.API
/// <summary>
/// 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.
/// </summary>
/// <param name="title">The title to display in the error box.</param>
@@ -181,7 +181,7 @@ namespace ElectronNET.API
/// <summary>
/// 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.
/// </summary>
/// <param name="options"></param>
@@ -193,7 +193,7 @@ namespace ElectronNET.API
/// <summary>
/// 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.
/// </summary>
/// <param name="browserWindow"></param>
@@ -212,7 +212,5 @@ namespace ElectronNET.API
return tcs.Task;
}
}
}
}

View File

@@ -208,7 +208,5 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Emit("dock-setIcon", image);
}
}
}
}

View File

@@ -140,7 +140,7 @@
/// <summary>
/// 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:
/// <c>electronize add HostHook</c>
/// </summary>
@@ -153,7 +153,7 @@
}
/// <summary>
/// Allows you to execute native Lock and Unlock process.
/// Allows you to execute native Lock and Unlock process.
/// </summary>
public static PowerMonitor PowerMonitor
{

View File

@@ -35,4 +35,4 @@ namespace ElectronNET.API.Entities
[DefaultValue(false)]
public bool Vertical { get; set; } = false;
}
}
}

View File

@@ -10,4 +10,4 @@
/// </summary>
public float ScaleFactor { get; set; } = 1.0f;
}
}
}

View File

@@ -28,4 +28,4 @@
/// </summary>
public bool IsAdminRightsRequired { get; set; }
}
}
}

View File

@@ -22,4 +22,4 @@
/// </summary>
public string ProxyCredentials { get; set; }
}
}
}

View File

@@ -1,5 +1,4 @@
using ElectronNET.Converter;
using System.ComponentModel;
using System.Text.Json.Serialization;
@@ -296,8 +295,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public string ProxyCredentials { get; set; }
}
}
}

View File

@@ -11,9 +11,9 @@
public double PercentCPUUsage { get; set; }
/// <summary>
/// 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.
/// </summary>
public int IdleWakeupsPerSecond { get; set; }
}
}
}

View File

@@ -26,4 +26,4 @@
/// </summary>
public string Version { get; set; }
}
}
}

View File

@@ -21,4 +21,4 @@
/// </summary>
public string[] Quotas { get; set; }
}
}
}

View File

@@ -1,10 +1,9 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
{
/// <summary>
/// The cause of the change
/// The cause of the change
/// </summary>
public enum CookieChangedCause
{
@@ -35,4 +34,4 @@ namespace ElectronNET.API.Entities
[JsonPropertyName("expired_overwrite")]
expiredOverwrite
}
}
}

View File

@@ -49,7 +49,7 @@ namespace ElectronNET.API.Entities
public bool HttpOnly { get; set; }
/// <summary>
/// (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.
/// </summary>
[DefaultValue(0)]

View File

@@ -20,4 +20,4 @@
/// </summary>
public float ScaleFactor { get; set; } = 1.0f;
}
}
}

View File

@@ -64,4 +64,4 @@
ETag = eTag;
}
}
}
}

View File

@@ -25,4 +25,4 @@
/// </summary>
public int UploadThroughput { get; set; }
}
}
}

View File

@@ -35,4 +35,4 @@
/// </summary>
public string Version { get; set; }
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities

View File

@@ -77,6 +77,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public InputEventType Type { get; set; }
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -23,5 +22,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public JumpListCategoryType Type { get; set; }
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -54,6 +53,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public JumpListItemType Type { get; set; }
}
}
}

View File

@@ -11,7 +11,7 @@
public int WorkingSetSize { get; set; }
/// <summary>
/// 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.
/// </summary>
public int PeakWorkingSetSize { get; set; }

View File

@@ -9,7 +9,7 @@ namespace ElectronNET.API.Entities
public class MenuItem
{
/// <summary>
/// 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.
/// </summary>
[JsonIgnore]
@@ -96,6 +96,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public string Position { get; set; }
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -97,6 +96,4 @@ namespace ElectronNET.API.Entities
Message = message;
}
}
}
}

View File

@@ -21,4 +21,4 @@
/// </value>
public bool CheckboxChecked { get; set; }
}
}
}

View File

@@ -35,5 +35,4 @@ namespace ElectronNET.API.Entities
return new NativeImage(newDictionary);
}
}
}
}

View File

@@ -15,4 +15,4 @@ public class OnDidFailLoadInfo
/// Validated URL.
/// </summary>
public string ValidatedUrl { get; set; }
}
}

View File

@@ -14,4 +14,4 @@ public class OnDidNavigateInfo
/// HTTP response code.
/// </summary>
public int HttpResponseCode { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -15,5 +14,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public DevToolsMode Mode { get; set; }
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -41,7 +40,7 @@ namespace ElectronNET.API.Entities
public string Message { get; set; }
/// <summary>
/// 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:
/// </summary>
/// <example>
@@ -57,5 +56,4 @@ namespace ElectronNET.API.Entities
/// </example>
public FileFilter[] Filters { get; set; }
}
}
}

View File

@@ -17,4 +17,4 @@ public class PageSize
public static implicit operator string(PageSize pageSize) => pageSize?._value;
public static implicit operator PageSize(string value) => new(value);
}
}

View File

@@ -20,7 +20,7 @@ namespace ElectronNET.API.Entities
AppData,
/// <summary>
/// The directory for storing your apps configuration files,
/// The directory for storing your apps configuration files,
/// which by default it is the appData directory appended with your apps name.
/// </summary>
[Description("userData")]
@@ -92,4 +92,4 @@ namespace ElectronNET.API.Entities
[Description("PepperFlashSystemPlugin")]
PepperFlashSystemPlugin
}
}
}

View File

@@ -7,4 +7,4 @@ namespace ElectronNET.API.Entities
/// <param name="Electron">Value representing Electron's version string</param>
/// <returns></returns>
public record ProcessVersions(string Chrome, string Electron);
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -13,5 +12,4 @@ namespace ElectronNET.API.Entities
/// </summary>
public ProgressBarMode Mode { get; set; }
}
}
}

View File

@@ -30,4 +30,4 @@
/// </summary>
public string Transferred { get; set; }
}
}
}

View File

@@ -33,4 +33,4 @@
ProxyBypassRules = proxyBypassRules;
}
}
}
}

View File

@@ -15,4 +15,4 @@
/// </summary>
public string Note { get; set; }
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
@@ -25,7 +24,7 @@ namespace ElectronNET.API.Entities
public string Realm { get; set; }
/// <summary>
/// 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.
/// </summary>
public Scheme Scheme { get; set; }
@@ -49,6 +48,4 @@ namespace ElectronNET.API.Entities
Type = type;
}
}
}
}

View File

@@ -20,4 +20,4 @@
/// </summary>
public string Quality { get; set; } = "best";
}
}
}

View File

@@ -27,7 +27,7 @@ namespace ElectronNET.API
public string ButtonLabel { get; set; }
/// <summary>
/// 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:
/// </summary>
/// <example>

View File

@@ -25,4 +25,4 @@ namespace ElectronNET.API.Entities
[Description("replace")]
Replace
}
}
}

View File

@@ -56,5 +56,4 @@ namespace ElectronNET.API.Entities
Icon = icon;
}
}
}
}

View File

@@ -1,4 +1,3 @@
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities

View File

@@ -10,4 +10,4 @@
/// </summary>
public float ScaleFactor { get; set; } = 1.0f;
}
}
}

View File

@@ -10,4 +10,4 @@
/// </summary>
public float ScaleFactor { get; set; } = 1.0f;
}
}
}

View File

@@ -10,4 +10,4 @@
/// </summary>
public float ScaleFactor { get; set; } = 1.0f;
}
}
}

View File

@@ -20,4 +20,4 @@
/// </summary>
public UpdateCancellationToken CancellationToken { get; set; }
}
}
}

View File

@@ -10,4 +10,4 @@
/// </summary>
public string Url { get; set; }
}
}
}

View File

@@ -213,4 +213,4 @@ namespace ElectronNET.API.Entities
[DefaultValue(false)]
public bool EnableRemoteModule { get; set; } = false;
}
}
}

View File

@@ -36,4 +36,4 @@ namespace ElectronNET.API.Extensions
return result;
}
}
}
}

View File

@@ -39,10 +39,10 @@ namespace ElectronNET.API
private Dictionary<string, Action> _shortcuts = new Dictionary<string, Action>();
/// <summary>
/// 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 dont
/// want applications to fight for global shortcuts.
/// </summary>
@@ -66,7 +66,7 @@ namespace ElectronNET.API
}
/// <summary>
/// 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 dont want applications to fight for global shortcuts.
/// </summary>

View File

@@ -8,7 +8,7 @@ namespace ElectronNET.API
/// <summary>
/// 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:
/// <c>electronize add HostHook</c>
/// </summary>
@@ -48,10 +48,7 @@ namespace ElectronNET.API
/// <param name="arguments">Optional parameters.</param>
public void Call(string socketEventName, params dynamic[] arguments)
{
BridgeConnector.Socket.Once<string>(socketEventName + "Error" + oneCallguid, (result) =>
{
Electron.Dialog.ShowErrorBox("Host Hook Exception", result);
});
BridgeConnector.Socket.Once<string>(socketEventName + "Error" + oneCallguid, (result) => { Electron.Dialog.ShowErrorBox("Host Hook Exception", result); });
BridgeConnector.Socket.Emit(socketEventName, arguments, oneCallguid);
}
@@ -95,7 +92,5 @@ namespace ElectronNET.API
return tcs.Task;
}
}
}
}

View File

@@ -39,7 +39,7 @@ namespace ElectronNET.API
}
/// <summary>
/// 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...).
/// </summary>
/// <param name="channel">Channelname.</param>
@@ -71,7 +71,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Send a message to the renderer process synchronously via channel,
/// Send a message to the renderer process synchronously via channel,
/// you can also send arbitrary arguments.
///
/// Note: Sending a synchronous message will block the whole renderer process,
@@ -160,7 +160,5 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Emit("sendToIpcRendererBrowserView", browserView.Id, channel, data);
}
}
}
}

View File

@@ -129,7 +129,5 @@ namespace ElectronNET.API
{
BridgeConnector.Socket.Emit("menu-contextMenuPopup", browserWindow.Id);
}
}
}
}

View File

@@ -8,7 +8,7 @@ namespace ElectronNET.API
/// <summary>
/// Read and respond to changes in Chromium's native color theme.
/// </summary>
public sealed class NativeTheme: ApiBase
public sealed class NativeTheme : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketEventNameTypes SocketEventNameType => SocketEventNameTypes.DashedLower;
@@ -59,7 +59,7 @@ namespace ElectronNET.API
/// </item>
/// <item>
/// <description>The 'updated' event will be emitted</description>
/// </item>
/// </item>
/// </list>
/// <para/>
/// Settings this property to <see cref="ThemeSourceMode.Light"/> will have the following effects:
@@ -79,7 +79,7 @@ namespace ElectronNET.API
/// <item>
/// <description>The 'updated' event will be emitted</description>
/// </item>
/// </list>
/// </list>
/// The usage of this property should align with a classic "dark mode" state machine in your application where the user has three options.
/// <para/>
/// <list type="bullet">

View File

@@ -9,7 +9,7 @@ namespace ElectronNET.API
/// <summary>
/// Create OS desktop notifications
/// </summary>
public sealed class Notification: ApiBase
public sealed class Notification : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.NoDashUpperFirst;
private static Notification _notification;
@@ -88,10 +88,7 @@ namespace ElectronNET.API
isActionDefined = true;
BridgeConnector.Socket.Off("NotificationEventReply");
BridgeConnector.Socket.On<string[]>("NotificationEventReply", (args) =>
{
_notificationOptions.Single(x => x.ReplyID == args[0]).OnReply(args[1]);
});
BridgeConnector.Socket.On<string[]>("NotificationEventReply", (args) => { _notificationOptions.Single(x => x.ReplyID == args[0]).OnReply(args[1]); });
}
if (notificationOptions.OnAction != null)
@@ -100,10 +97,7 @@ namespace ElectronNET.API
isActionDefined = true;
BridgeConnector.Socket.Off("NotificationEventAction");
BridgeConnector.Socket.On<string[]>("NotificationEventAction", (args) =>
{
_notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]);
});
BridgeConnector.Socket.On<string[]>("NotificationEventAction", (args) => { _notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]); });
}
if (isActionDefined)
@@ -118,4 +112,4 @@ namespace ElectronNET.API
/// <returns></returns>
public Task<bool> IsSupportedAsync() => this.InvokeAsync<bool>();
}
}
}

View File

@@ -7,13 +7,13 @@ namespace ElectronNET.API
/// <summary>
/// Monitor power state changes..
/// </summary>
public sealed class PowerMonitor: ApiBase
public sealed class PowerMonitor : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketEventNameTypes SocketEventNameType => SocketEventNameTypes.DashedLower;
/// <summary>
/// Emitted when the system is about to lock the screen.
/// Emitted when the system is about to lock the screen.
/// </summary>
public event Action OnLockScreen
{
@@ -22,7 +22,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Emitted when the system is about to unlock the screen.
/// Emitted when the system is about to unlock the screen.
/// </summary>
public event Action OnUnLockScreen
{

View File

@@ -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.
/// </summary>
public sealed class Process: ApiBase
public sealed class Process : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst;
internal Process()
{
}
@@ -43,7 +44,7 @@ namespace ElectronNET.API
/// <summary>
/// The process.execPath property returns the absolute pathname of the executable that
/// started the Node.js process. Symbolic links, if any, are resolved.
/// </summary>
/// </summary>
public Task<string> ExecPathAsync => this.InvokeAsync<string>();
/// <summary>
@@ -64,7 +65,7 @@ namespace ElectronNET.API
/// <summary>
/// The process.versions property returns an object listing the version strings of
/// chrome and electron.
/// </summary>
/// </summary>
public Task<ProcessVersions> VersionsAsync => this.InvokeAsync<ProcessVersions>();
/// <summary>
@@ -105,4 +106,4 @@ namespace ElectronNET.API
/// </summary>
public Task<string> PlatformAsync => this.InvokeAsync<string>();
}
}
}

View File

@@ -10,7 +10,7 @@ namespace ElectronNET.API
/// <summary>
/// Retrieve information about screen size, displays, cursor position, etc.
/// </summary>
public sealed class Screen: ApiBase
public sealed class Screen : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst;
@@ -35,8 +35,8 @@ namespace ElectronNET.API
}
/// <summary>
/// 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.
/// </summary>
public event Action<Display, string[]> OnDisplayMetricsChanged
@@ -56,6 +56,7 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("register-screen-display-metrics-changed", GetHashCode());
}
_onDisplayMetricsChanged += value;
}
remove
@@ -134,4 +135,4 @@ namespace ElectronNET.API
/// <returns>The display that most closely intersects the provided bounds.</returns>
public Task<Display> GetDisplayMatchingAsync(Rectangle rectangle) => this.InvokeAsync<Display>(rectangle);
}
}
}

View File

@@ -373,7 +373,5 @@ namespace ElectronNET.API
return tcs.Task;
}
}
}
}

View File

@@ -68,7 +68,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Open the given external protocol URL in the desktops default manner.
/// Open the given external protocol URL in the desktops default manner.
/// (For example, mailto: URLs in the users default mail agent).
/// </summary>
/// <param name="url">Max 2081 characters on windows.</param>
@@ -79,7 +79,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Open the given external protocol URL in the desktops default manner.
/// Open the given external protocol URL in the desktops default manner.
/// (For example, mailto: URLs in the users default mail agent).
/// </summary>
/// <param name="url">Max 2081 characters on windows.</param>
@@ -158,7 +158,5 @@ namespace ElectronNET.API
return tcs.Task;
}
}
}
}

View File

@@ -14,7 +14,7 @@ namespace ElectronNET.API
/// <summary>
/// Add icons and context menus to the system's notification area.
/// </summary>
public sealed class Tray: ApiBase
public sealed class Tray : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketEventNameTypes SocketEventNameType => SocketEventNameTypes.DashedLower;
@@ -38,6 +38,7 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("register-tray-click", GetHashCode());
}
_click += value;
}
remove
@@ -72,6 +73,7 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("register-tray-right-click", GetHashCode());
}
_rightClick += value;
}
remove
@@ -106,6 +108,7 @@ namespace ElectronNET.API
BridgeConnector.Socket.Emit("register-tray-double-click", GetHashCode());
}
_doubleClick += value;
}
remove
@@ -140,7 +143,7 @@ namespace ElectronNET.API
}
/// <summary>
/// Windows: Emitted when the tray balloon is closed
/// Windows: Emitted when the tray balloon is closed
/// because of timeout or user manually closes it.
/// </summary>
public event Action OnBalloonClosed
@@ -295,7 +298,6 @@ namespace ElectronNET.API
}
private const string ModuleName = "tray";
/// <summary>
@@ -330,4 +332,4 @@ namespace ElectronNET.API
public async Task Once<T>(string eventName, Action<T> action)
=> await Events.Instance.Once(ModuleName, eventName, action).ConfigureAwait(false);
}
}
}

View File

@@ -9,7 +9,7 @@ namespace ElectronNET.API;
/// <summary>
/// Render and control web pages.
/// </summary>
public class WebContents: ApiBase
public class WebContents : ApiBase
{
protected override SocketTaskEventNameTypes SocketTaskEventNameType => SocketTaskEventNameTypes.DashesLowerFirst;
protected override SocketTaskMessageNameTypes SocketTaskMessageNameType => SocketTaskMessageNameTypes.DashesLowerFirst;
@@ -147,6 +147,7 @@ public class WebContents: ApiBase
/// <param name="options"></param>
/// <returns>success</returns>
public Task<bool> PrintAsync(PrintOptions options) => this.InvokeAsync<bool>(options);
/// <summary>
/// Prints window's web page.
/// </summary>
@@ -155,8 +156,8 @@ public class WebContents: ApiBase
/// <summary>
/// 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.
/// </summary>
/// <param name="path"></param>
@@ -222,7 +223,7 @@ public class WebContents: ApiBase
}
/// <summary>
/// The async method will resolve when the page has finished loading,
/// The async method will resolve when the page has finished loading,
/// and rejects if the page fails to load.
///
/// A noop rejection handler is already attached, which avoids unhandled rejection
@@ -239,7 +240,7 @@ public class WebContents: ApiBase
}
/// <summary>
/// The async method will resolve when the page has finished loading,
/// The async method will resolve when the page has finished loading,
/// and rejects if the page fails to load.
///
/// A noop rejection handler is already attached, which avoids unhandled rejection
@@ -261,10 +262,7 @@ public class WebContents: ApiBase
tcs.SetResult(null);
});
BridgeConnector.Socket.Once<string>("webContents-loadURL-error" + Id, (error) =>
{
tcs.SetException(new InvalidOperationException(error));
});
BridgeConnector.Socket.Once<string>("webContents-loadURL-error" + Id, (error) => { tcs.SetException(new InvalidOperationException(error)); });
BridgeConnector.Socket.Emit("webContents-loadURL", Id, url, options);
@@ -282,4 +280,4 @@ public class WebContents: ApiBase
{
BridgeConnector.Socket.Emit("webContents-insertCSS", Id, isBrowserWindow, path);
}
}
}

View File

@@ -59,4 +59,4 @@ namespace ElectronNET.API.Entities
}
}
}
}
}

View File

@@ -158,8 +158,8 @@ namespace ElectronNET.API
}
/// <summary>
/// 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.
/// </summary>
/// <returns></returns>
@@ -169,8 +169,8 @@ namespace ElectronNET.API
}
/// <summary>
/// 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.
/// </summary>
/// <param name="options"></param>
@@ -192,6 +192,5 @@ namespace ElectronNET.API
return await tcs.Task.ConfigureAwait(false);
}
}
}

View File

@@ -121,4 +121,4 @@ internal class SocketIoFacade
{
_socket.Dispose();
}
}
}

View File

@@ -51,14 +51,14 @@ namespace ElectronNET.Common
return str;
}
public static string StripOn(this string str)
{
if (string.IsNullOrWhiteSpace(str) || !str.StartsWith("On", StringComparison.Ordinal))
{
return str;
}
return str.Substring(2);
}
@@ -66,7 +66,7 @@ namespace ElectronNET.Common
{
return string.Join("-", Regex.Split(str.StripOn(), "(?<!^)(?=[A-Z])")).ToLower(CultureInfo.InvariantCulture);
}
public static string ToCamelCaseEventName(this string str)
{
return str.StripOn().LowerFirst();
@@ -87,4 +87,4 @@ namespace ElectronNET.Common
return service == null || service.State == LifetimeState.Stopped;
}
}
}
}

View File

@@ -23,6 +23,7 @@ public class ModifierTypeListConverter : JsonConverter<List<ModifierType>>
{
throw new JsonException("Expected array for ModifierType list");
}
while (reader.Read())
{
if (reader.TokenType == JsonTokenType.EndArray) break;
@@ -30,6 +31,7 @@ public class ModifierTypeListConverter : JsonConverter<List<ModifierType>>
var s = reader.GetString();
list.Add((ModifierType)Enum.Parse(typeof(ModifierType), s, ignoreCase: true));
}
return list;
}
@@ -40,6 +42,7 @@ public class ModifierTypeListConverter : JsonConverter<List<ModifierType>>
{
writer.WriteStringValue(modifier.ToString());
}
writer.WriteEndArray();
}
}
}

View File

@@ -42,5 +42,4 @@ public class PageSizeConverter : JsonConverter<PageSize>
JsonSerializer.Serialize(writer, value, ElectronJson.Options);
}
}
}
}

View File

@@ -42,5 +42,4 @@ public class TitleBarOverlayConverter : JsonConverter<TitleBarOverlay>
JsonSerializer.Serialize(writer, value, ElectronJson.Options);
}
}
}
}

View File

@@ -52,4 +52,4 @@
return RuntimeControllerCore?.Socket;
}
}
}
}

View File

@@ -8,4 +8,4 @@
/// <summary>ASP.NET Core cross-platform app.</summary>
AspNetCoreApp,
}
}
}

View File

@@ -9,4 +9,4 @@
Stopping,
Stopped,
}
}
}

View File

@@ -34,4 +34,4 @@
/// </remarks>
UnpackedDotnetFirst,
}
}
}

View File

@@ -69,4 +69,4 @@
return null;
}
}
}
}

View File

@@ -21,6 +21,5 @@
port += 2;
}
}
}
}
}

View File

@@ -106,4 +106,4 @@
return null;
}
}
}
}

View File

@@ -30,5 +30,4 @@ namespace ElectronNET.API.Serialization
internal partial class ElectronJsonContext : JsonSerializerContext
{
}
}
}

View File

@@ -1,36 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
</ItemGroup>
<PropertyGroup>
<_DllTargetPath>$(MSBuildThisFileDirectory)\..\ElectronNET\build</_DllTargetPath>
</PropertyGroup>
<Target BeforeTargets="AfterBuild" Name="CopyToBuildFolder">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<OutputFiles Include="$(OutDir)**\*.dll"></OutputFiles>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
</ItemGroup>
<Message Text="Copy ElectronNET.Build.dll to destination: $(_DllTargetPath)" Importance="high"/>
<Copy SourceFiles="@(OutputFiles)"
DestinationFolder="$(_DllTargetPath)\%(RecursiveDir)"
OverwriteReadOnlyFiles="true"></Copy>
</Target>
<PropertyGroup>
<_DllTargetPath>$(MSBuildThisFileDirectory)\..\ElectronNET\build</_DllTargetPath>
</PropertyGroup>
<Target BeforeTargets="AfterBuild" Name="CopyToBuildFolder">
<ItemGroup>
<OutputFiles Include="$(OutDir)**\*.dll"></OutputFiles>
</ItemGroup>
<Message Text="Copy ElectronNET.Build.dll to destination: $(_DllTargetPath)" Importance="high"/>
<Copy SourceFiles="@(OutputFiles)"
DestinationFolder="$(_DllTargetPath)\%(RecursiveDir)"
OverwriteReadOnlyFiles="true"></Copy>
</Target>
</Project>

View File

@@ -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', () => {

View File

@@ -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);

View File

@@ -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);

View File

@@ -12,6 +12,7 @@ namespace ElectronNET.IntegrationTests.Tests
{
// ReSharper disable once NotAccessedField.Local
private readonly ElectronFixture fx;
public AppTests(ElectronFixture fx)
{
this.fx = fx;
@@ -151,7 +152,7 @@ namespace ElectronNET.IntegrationTests.Tests
success.Should().BeTrue();
var count = await Electron.App.GetBadgeCountAsync();
// Allow fallback to0 on platforms without badge support
(count ==3 || count ==0).Should().BeTrue();
(count == 3 || count == 0).Should().BeTrue();
}
[Fact(Timeout = 20000)]

View File

@@ -7,18 +7,19 @@
public class AutoUpdaterTests
{
private readonly ElectronFixture fx;
public AutoUpdaterTests(ElectronFixture fx)
{
this.fx = fx;
}
[Fact(Timeout = 20000)]
public async Task AutoDownload_check()
{
Electron.AutoUpdater.AutoDownload = false;
var test1 = Electron.AutoUpdater.AutoDownload;
var test1 = Electron.AutoUpdater.AutoDownload;
Electron.AutoUpdater.AutoDownload = true;
var test2 = Electron.AutoUpdater.AutoDownload;
var test2 = Electron.AutoUpdater.AutoDownload;
test1.Should().BeFalse();
test2.Should().BeTrue();
}
@@ -27,9 +28,9 @@
public async Task AutoInstallOnAppQuit_check()
{
Electron.AutoUpdater.AutoInstallOnAppQuit = false;
var test1 = Electron.AutoUpdater.AutoInstallOnAppQuit;
var test1 = Electron.AutoUpdater.AutoInstallOnAppQuit;
Electron.AutoUpdater.AutoInstallOnAppQuit = true;
var test2 = Electron.AutoUpdater.AutoInstallOnAppQuit;
var test2 = Electron.AutoUpdater.AutoInstallOnAppQuit;
test1.Should().BeFalse();
test2.Should().BeTrue();
}
@@ -38,9 +39,9 @@
public async Task AllowPrerelease_check()
{
Electron.AutoUpdater.AllowPrerelease = false;
var test1 = Electron.AutoUpdater.AllowPrerelease;
var test1 = Electron.AutoUpdater.AllowPrerelease;
Electron.AutoUpdater.AllowPrerelease = true;
var test2 = Electron.AutoUpdater.AllowPrerelease;
var test2 = Electron.AutoUpdater.AllowPrerelease;
test1.Should().BeFalse();
test2.Should().BeTrue();
}
@@ -49,9 +50,9 @@
public async Task FullChangelog_check()
{
Electron.AutoUpdater.FullChangelog = false;
var test1 = Electron.AutoUpdater.FullChangelog;
var test1 = Electron.AutoUpdater.FullChangelog;
Electron.AutoUpdater.FullChangelog = true;
var test2 = Electron.AutoUpdater.FullChangelog;
var test2 = Electron.AutoUpdater.FullChangelog;
test1.Should().BeFalse();
test2.Should().BeTrue();
}
@@ -60,9 +61,9 @@
public async Task AllowDowngrade_check()
{
Electron.AutoUpdater.AllowDowngrade = false;
var test1 = Electron.AutoUpdater.AllowDowngrade;
var test1 = Electron.AutoUpdater.AllowDowngrade;
Electron.AutoUpdater.AllowDowngrade = true;
var test2 = Electron.AutoUpdater.AllowDowngrade;
var test2 = Electron.AutoUpdater.AllowDowngrade;
test1.Should().BeFalse();
test2.Should().BeTrue();
}
@@ -70,10 +71,10 @@
[Fact(Timeout = 20000)]
public async Task UpdateConfigPath_check()
{
var test1 = Electron.AutoUpdater.UpdateConfigPath;
var test1 = Electron.AutoUpdater.UpdateConfigPath;
test1.Should().Be(string.Empty);
}
[Fact(Timeout = 20000)]
public async Task CurrentVersionAsync_check()
{
@@ -107,26 +108,26 @@
test.Count.Should().Be(1);
test["key1"].Should().Be("value1");
}
[Fact(Timeout = 20000)]
public async Task CheckForUpdatesAsync_check()
{
var test = await Electron.AutoUpdater.CheckForUpdatesAsync();
test.Should().BeNull();
}
[Fact(Timeout = 20000)]
public async Task CheckForUpdatesAndNotifyAsync_check()
{
var test = await Electron.AutoUpdater.CheckForUpdatesAsync();
test.Should().BeNull();
}
[Fact(Timeout = 20000)]
public async Task GetFeedURLAsync_check()
{
var test = await Electron.AutoUpdater.GetFeedURLAsync();
test.Should().Contain("Deprecated");
}
}
}
}
}

View File

@@ -7,6 +7,7 @@ namespace ElectronNET.IntegrationTests.Tests
public class BrowserViewTests
{
private readonly ElectronFixture fx;
public BrowserViewTests(ElectronFixture fx)
{
this.fx = fx;

View File

@@ -4,6 +4,7 @@ namespace ElectronNET.IntegrationTests.Tests
public class CookiesTests
{
private readonly ElectronFixture fx;
public CookiesTests(ElectronFixture fx)
{
this.fx = fx;

View File

@@ -6,6 +6,7 @@ namespace ElectronNET.IntegrationTests.Tests
public class IpcMainTests
{
private readonly ElectronFixture fx;
public IpcMainTests(ElectronFixture fx)
{
this.fx = fx;

View File

@@ -7,6 +7,7 @@ namespace ElectronNET.IntegrationTests.Tests
public class MenuTests
{
private readonly ElectronFixture fx;
public MenuTests(ElectronFixture fx)
{
this.fx = fx;

View File

@@ -5,7 +5,7 @@ namespace ElectronNET.IntegrationTests.Tests
{
using System.Drawing;
using ElectronNET.API.Entities;
[SupportedOSPlatform("Windows")]
public class NativeImageTests
{

View File

@@ -45,14 +45,14 @@ namespace ElectronNET.IntegrationTests.Tests
fired.Should().BeTrue();
}
[Fact(Timeout = 20000)]
public async Task Should_use_high_contrast_colors_check()
{
var metrics = await Electron.NativeTheme.ShouldUseHighContrastColorsAsync();
metrics.Should().Be(false);
}
[Fact(Timeout = 20000)]
public async Task Should_use_inverted_colors_check()
{

View File

@@ -19,41 +19,39 @@ namespace ElectronNET.IntegrationTests.Tests
{
var execPath = await Electron.Process.ExecPathAsync;
execPath.Should().NotBeNullOrWhiteSpace();
var pid = await Electron.Process.PidAsync;
pid.Should().BeGreaterThan(0);
var platform = await Electron.Process.PlatformAsync;
platform.Should().NotBeNullOrWhiteSpace();
var argv = await Electron.Process.ArgvAsync;
argv.Should().NotBeNull();
argv.Length.Should().BeGreaterThan(0);
var type = await Electron.Process.TypeAsync;
type.Should().NotBeNullOrWhiteSpace();
var version = await Electron.Process.VersionsAsync;
version.Should().NotBeNull();
version.Chrome.Should().NotBeNullOrWhiteSpace();
version.Electron.Should().NotBeNullOrWhiteSpace();
var defaultApp = await Electron.Process.DefaultAppAsync;
defaultApp.Should().BeTrue();
var isMainFrame = await Electron.Process.IsMainFrameAsync;
isMainFrame.Should().BeFalse();
var resourcePath = await Electron.Process.ResourcesPathAsync;
resourcePath.Should().NotBeNullOrWhiteSpace();
var upTime = await Electron.Process.UpTimeAsync;
upTime.Should().BeGreaterThan(0);
var arch = await Electron.Process.ArchAsync;
arch.Should().NotBeNullOrWhiteSpace();
}
}
}

View File

@@ -64,7 +64,7 @@ namespace ElectronNET.IntegrationTests.Tests
display.Size.Width.Should().BeGreaterThan(0);
display.Size.Height.Should().BeGreaterThan(0);
}
[Fact(Timeout = 20000)]
public async Task GetDisplayMatching_check()
{

Some files were not shown because too many files have changed in this diff Show More