mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-14 05:34:48 +00:00
Merge branch 'develop'
This commit is contained in:
@@ -48,7 +48,9 @@ public class BrowserWindow
|
||||
_readyToShow -= value;
|
||||
|
||||
if (_readyToShow == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-ready-to-show" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +79,9 @@ public class BrowserWindow
|
||||
_pageTitleUpdated -= value;
|
||||
|
||||
if (_pageTitleUpdated == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-page-title-updated" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +110,9 @@ public class BrowserWindow
|
||||
_close -= value;
|
||||
|
||||
if (_close == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-close" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +143,9 @@ public class BrowserWindow
|
||||
_closed -= value;
|
||||
|
||||
if (_closed == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-closed" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +174,9 @@ public class BrowserWindow
|
||||
_sessionEnd -= value;
|
||||
|
||||
if (_sessionEnd == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-session-end" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +205,9 @@ public class BrowserWindow
|
||||
_unresponsive -= value;
|
||||
|
||||
if (_unresponsive == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-unresponsive" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +236,9 @@ public class BrowserWindow
|
||||
_responsive -= value;
|
||||
|
||||
if (_responsive == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-responsive" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +267,9 @@ public class BrowserWindow
|
||||
_blur -= value;
|
||||
|
||||
if (_blur == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-blur" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +298,9 @@ public class BrowserWindow
|
||||
_focus -= value;
|
||||
|
||||
if (_focus == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-focus" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +329,9 @@ public class BrowserWindow
|
||||
_show -= value;
|
||||
|
||||
if (_show == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-show" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +360,9 @@ public class BrowserWindow
|
||||
_hide -= value;
|
||||
|
||||
if (_hide == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-hide" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,7 +391,9 @@ public class BrowserWindow
|
||||
_maximize -= value;
|
||||
|
||||
if (_maximize == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-maximize" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +422,9 @@ public class BrowserWindow
|
||||
_unmaximize -= value;
|
||||
|
||||
if (_unmaximize == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-unmaximize" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +453,9 @@ public class BrowserWindow
|
||||
_minimize -= value;
|
||||
|
||||
if (_minimize == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-minimize" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +484,9 @@ public class BrowserWindow
|
||||
_restore -= value;
|
||||
|
||||
if (_restore == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-restore" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +515,9 @@ public class BrowserWindow
|
||||
_resize -= value;
|
||||
|
||||
if (_resize == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-resize" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,7 +548,9 @@ public class BrowserWindow
|
||||
_move -= value;
|
||||
|
||||
if (_move == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-move" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +579,9 @@ public class BrowserWindow
|
||||
_moved -= value;
|
||||
|
||||
if (_moved == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-moved" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,7 +610,9 @@ public class BrowserWindow
|
||||
_enterFullScreen -= value;
|
||||
|
||||
if (_enterFullScreen == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-enter-full-screen" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,7 +641,9 @@ public class BrowserWindow
|
||||
_leaveFullScreen -= value;
|
||||
|
||||
if (_leaveFullScreen == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-leave-full-screen" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,7 +672,9 @@ public class BrowserWindow
|
||||
_enterHtmlFullScreen -= value;
|
||||
|
||||
if (_enterHtmlFullScreen == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-enter-html-full-screen" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,7 +703,9 @@ public class BrowserWindow
|
||||
_leaveHtmlFullScreen -= value;
|
||||
|
||||
if (_leaveHtmlFullScreen == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-leave-html-full-screen" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -696,7 +740,9 @@ public class BrowserWindow
|
||||
_appCommand -= value;
|
||||
|
||||
if (_appCommand == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-app-command" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,7 +771,9 @@ public class BrowserWindow
|
||||
_swipe -= value;
|
||||
|
||||
if (_swipe == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-swipe" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -754,7 +802,9 @@ public class BrowserWindow
|
||||
_sheetBegin -= value;
|
||||
|
||||
if (_sheetBegin == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-sheet-begin" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +833,9 @@ public class BrowserWindow
|
||||
_sheetEnd -= value;
|
||||
|
||||
if (_sheetEnd == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-sheet-end" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -812,7 +864,9 @@ public class BrowserWindow
|
||||
_newWindowForTab -= value;
|
||||
|
||||
if (_newWindowForTab == null)
|
||||
{
|
||||
BridgeConnector.Socket.Off("browserWindow-new-window-for-tab" + Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1055,6 +1109,25 @@ public class BrowserWindow
|
||||
return taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// Consider a normal window with an HD video player and associated controls.Perhaps there are 15 pixels
|
||||
/// 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
|
||||
/// 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>
|
||||
/// <param name="extraSize">The extra size not to be included while maintaining the aspect ratio.</param>
|
||||
public void SetAspectRatio(double aspectRatio, Size extraSize)
|
||||
{
|
||||
BridgeConnector.Socket.Emit("browserWindowSetAspectRatio", Id, aspectRatio, JObject.FromObject(extraSize, _jsonSerializer));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace ElectronNET.API
|
||||
public Task<string[]> ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialogOptions options)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<string[]>();
|
||||
string guid = Guid.NewGuid().ToString();
|
||||
var guid = Guid.NewGuid().ToString();
|
||||
|
||||
BridgeConnector.Socket.On("showOpenDialogComplete" + guid, (filePaths) =>
|
||||
{
|
||||
@@ -75,7 +75,7 @@ namespace ElectronNET.API
|
||||
public Task<string> ShowSaveDialogAsync(BrowserWindow browserWindow, SaveDialogOptions options)
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<string>();
|
||||
string guid = Guid.NewGuid().ToString();
|
||||
var guid = Guid.NewGuid().ToString();
|
||||
|
||||
BridgeConnector.Socket.On("showSaveDialogComplete" + guid, (filename) =>
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ public class PrintToPDFOptions
|
||||
/// `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
|
||||
/// `height` and `width` in inches. Defaults to `Letter`.
|
||||
/// </summary>
|
||||
public string PageSize { get; set; } = "Letter";
|
||||
public object PageSize { get; set; } = "Letter";
|
||||
|
||||
/// <summary>
|
||||
/// Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string,
|
||||
|
||||
@@ -38,9 +38,20 @@
|
||||
public bool Sandboxed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// One of the following values:
|
||||
/// One of the following values:
|
||||
/// untrusted | low | medium | high | unknown
|
||||
/// </summary>
|
||||
public string IntegrityLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the process.
|
||||
/// Examples for utility: Audio Service, Content Decryption Module Service, Network Service, Video Capture, etc.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The non-localized name of the process.
|
||||
/// </summary>
|
||||
public string ServiceName { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user