FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Electron.NET/src/ElectronNET.API/API/BrowserView.cs at develop · ElectronNET/Electron.NET · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ElectronNET
/
Electron.NET
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
743
Star
7.6k
Code
Issues
21
Pull requests
1
Discussions
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Electron.NET
/
src
/
ElectronNET.API
/
API
/
BrowserView.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (65 loc) · 2.41 KB
Breadcrumbs
Electron.NET
/
src
/
ElectronNET.API
/
API
/
BrowserView.cs
Copy path
File metadata and controls
73 lines (65 loc) · 2.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using
ElectronNET
.
API
.
Entities
;
using
System
.
Threading
.
Tasks
;
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.
/// It is meant to be an alternative to the webview tag.
/// </summary>
public
class
BrowserView
:
ApiBase
{
protected
override
SocketTaskEventNameTypes
SocketTaskEventNameType
=>
SocketTaskEventNameTypes
.
DashesLowerFirst
;
protected
override
SocketTaskMessageNameTypes
SocketTaskMessageNameType
=>
SocketTaskMessageNameTypes
.
DashesLowerFirst
;
/// <summary>
/// Gets the identifier.
/// </summary>
public
override
int
Id
{
get
;
protected
set
;
}
/// <summary>
/// Render and control web pages.
/// </summary>
public
WebContents
WebContents
{
get
;
internal
set
;
}
/// <summary>
/// Resizes and moves the view to the supplied bounds relative to the window.
/// (experimental)
/// </summary>
public
Rectangle
Bounds
{
get
{
return
Task
.
Run
(
(
)
=>
this
.
InvokeAsync
<
Rectangle
>
(
)
)
.
Result
;
}
set
{
BridgeConnector
.
Socket
.
Emit
(
"browserView-bounds-set"
,
Id
,
value
)
;
}
}
/// <summary>
/// BrowserView
/// </summary>
internal
BrowserView
(
int
id
)
{
Id
=
id
;
// Workaround: increase the Id so as not to conflict with BrowserWindow id
// the backend detect about the value an BrowserView
WebContents
=
new
WebContents
(
id
+
1000
)
;
}
/// <summary>
/// (experimental)
/// </summary>
/// <param name="options"></param>
public
void
SetAutoResize
(
AutoResizeOptions
options
)
{
BridgeConnector
.
Socket
.
Emit
(
"browserView-setAutoResize"
,
Id
,
options
)
;
}
/// <summary>
/// Color in #aarrggbb or #argb form. The alpha channel is optional.
/// (experimental)
/// </summary>
/// <param name="color">Color in #aarrggbb or #argb form. The alpha channel is optional.</param>
public
void
SetBackgroundColor
(
string
color
)
{
BridgeConnector
.
Socket
.
Emit
(
"browserView-setBackgroundColor"
,
Id
,
color
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL