Upload via GUI (298 Dateien)

This commit is contained in:
Git Manager GUI
2026-08-07 08:53:16 +02:00
parent 12dfec7330
commit 1958a47b3a
8 changed files with 9832 additions and 8 deletions

241
bundle.js
View File

@@ -39,7 +39,7 @@ const aboutBody =
'const o=y("p");o.innerHTML=`Git: ${a.link().outerHTML}`,' +
'e.appendChild(y("div",[y("div|class:version",[_t.render(),' +
'y("div|class:version-details",[y("h1:MyStart|class:version-app-name"),' +
'y("p:Version 1.0.1|class:version-number")])]),y("hr"),s,o,y("div|id:mystart-autostart-row,class:mystart-autostart-row")]))';
'y("p:Version 1.0.2|class:version-number")])]),y("hr"),s,o,y("div|id:mystart-autostart-row,class:mystart-autostart-row")]))';
mainJs = mainJs.slice(0, i) + aboutBody + mainJs.slice(j + aEndMarker.length);
// --- 2) Rename branding (visible text + storage keys) consistently ---
@@ -188,13 +188,13 @@ const windowControlsJs = `(function(){
}
document.addEventListener('mousemove',function(ev){
if(ev.buttons)return; // an active drag (e.g. scrollbar) is in progress -> leave it alone
var onCtrls=ev.target.closest&&ev.target.closest('#mystart-winctrls');
var onCtrls=ev.target.closest&&ev.target.closest('#mystart-winctrls,#mystart-profiles');
var edge=onCtrls?null:edgeAt(ev.clientX,ev.clientY);
document.documentElement.style.cursor=edge?CURSOR[edge]:'';
},true);
document.addEventListener('mousedown',function(ev){
if(ev.button!==0)return;
if(ev.target.closest&&ev.target.closest('#mystart-winctrls'))return;
if(ev.target.closest&&ev.target.closest('#mystart-winctrls,#mystart-profiles'))return;
var edge=edgeAt(ev.clientX,ev.clientY);
if(edge){ev.preventDefault();send2('window-resize',{edge:edge});}
},true);
@@ -202,7 +202,240 @@ const windowControlsJs = `(function(){
function send2(t,extra){try{window.chrome.webview.postMessage(Object.assign({type:t},extra));}catch(e){}}
})();`;
mainJs = trInfra + autostartJs + windowControlsJs + mainJs;
// Optional, self-named data "Reiter" (tabs) in the top-left corner -- e.g.
// one for the office, one for a second workplace. Opt-in: with none created,
// only a small unobtrusive "+" shows -- nothing changes for anyone who
// doesn't want this. nightTab keeps its ENTIRE state (bookmarks, groups,
// theme, layout, ...) in a single localStorage key (the app name, here
// "MyStart"); switching swaps that key's content with a saved per-tab slot
// and reloads. Purely local to this install, no server/sync involved.
const profilesJs = `(function(){
var KEY='${APPNAME}';
var ACTIVE=KEY+'-slot-active';
var LIST=KEY+'-profiles';
function slotKey(id){return KEY+'-slot-'+id;}
function getProfiles(){try{var a=JSON.parse(localStorage.getItem(LIST));return Array.isArray(a)?a:[];}catch(e){return[];}}
function saveProfiles(a){localStorage.setItem(LIST,JSON.stringify(a));}
function getActive(){return localStorage.getItem(ACTIVE);}
function newId(){return 'p'+Date.now().toString(36)+Math.random().toString(36).slice(2,6);}
// Users of the earlier fixed "Büro"/"Extern" build had an old-format
// marker (ACTIVE='a' or 'b', no profiles list). Turn that into the new
// list format once, in place, without moving any data around.
function migrateLegacy(){
if(localStorage.getItem(LIST)!=null)return;
var legacyActive=localStorage.getItem(ACTIVE);
if(legacyActive==null)return;
var profiles=[];
['a','b'].forEach(function(s){
if(localStorage.getItem(slotKey(s))!=null||legacyActive===s){
var label=localStorage.getItem(KEY+'-slot-'+s+'-label')||(s==='a'?'Büro':'Extern');
profiles.push({id:s,label:label});
}
});
if(profiles.length)saveProfiles(profiles);else localStorage.removeItem(ACTIVE);
}
function loadDataInto(json){
if(json!=null){
localStorage.setItem(KEY,json);
// Pre-set the flash-prevention theme flag so reload doesn't briefly
// flash the previous tab's background colour.
try{
var style=JSON.parse(json).state.theme.style;
if(style==='dark'||style==='light')localStorage.setItem(KEY+'Style',style);
else localStorage.removeItem(KEY+'Style');
}catch(e){}
}else{
localStorage.removeItem(KEY);
localStorage.removeItem(KEY+'Style');
}
}
function switchTo(id){
var active=getActive();
if(id===active)return;
if(active!=null){
var live=localStorage.getItem(KEY);
if(live!=null)localStorage.setItem(slotKey(active),live);else localStorage.removeItem(slotKey(active));
}
loadDataInto(localStorage.getItem(slotKey(id)));
localStorage.setItem(ACTIVE,id);
location.reload();
}
function addProfile(){
var name=window.prompt('Name für den neuen Reiter:','');
if(!name||!name.trim())return;
name=name.trim();
var profiles=getProfiles();
var id=newId();
if(profiles.length===0&&getActive()==null){
// First tab ever: adopt whatever is currently loaded, nothing lost, no reload needed.
var current=localStorage.getItem(KEY);
if(current!=null)localStorage.setItem(slotKey(id),current);
localStorage.setItem(ACTIVE,id);
profiles.push({id:id,label:name});
saveProfiles(profiles);
render();
}else{
// Additional tab: stash the current one, start this one blank.
var active=getActive();
if(active!=null){
var live=localStorage.getItem(KEY);
if(live!=null)localStorage.setItem(slotKey(active),live);else localStorage.removeItem(slotKey(active));
}
loadDataInto(null);
profiles.push({id:id,label:name});
saveProfiles(profiles);
localStorage.setItem(ACTIVE,id);
location.reload();
}
}
function renameProfile(id){
var profiles=getProfiles();
var p=profiles.find(function(x){return x.id===id;});
if(!p)return;
var name=window.prompt('Name für diesen Reiter:',p.label);
if(name&&name.trim()){p.label=name.trim();saveProfiles(profiles);render();}
}
function deleteProfile(id){
var profiles=getProfiles();
var p=profiles.find(function(x){return x.id===id;});
if(!p)return;
if(!window.confirm('"'+p.label+'" wirklich entfernen? Die darin gespeicherten Daten dieses Reiters gehen dabei verloren.'))return;
profiles=profiles.filter(function(x){return x.id!==id;});
localStorage.removeItem(slotKey(id));
var wasActive=getActive()===id;
saveProfiles(profiles);
if(wasActive){
if(profiles.length){
var next=profiles[0].id;
loadDataInto(localStorage.getItem(slotKey(next)));
localStorage.setItem(ACTIVE,next);
location.reload();
}else{
// No tabs left -> back to a single, un-tabbed dataset (whatever was loaded stays, nothing wiped).
localStorage.removeItem(ACTIVE);
render();
}
}else{
render();
}
}
// --- Cloud sync hooks, called from the native host (Program.cs), which
// polls an OneDrive-synced JSON file. The host treats the exported blob as
// opaque; only this page understands/produces/consumes its structure. ---
window.__mystartSyncExport=function(){
var profiles=getProfiles();
var active=getActive();
var slots={};
profiles.forEach(function(p){
var raw=(p.id===active)?localStorage.getItem(KEY):localStorage.getItem(slotKey(p.id));
if(raw!=null){try{slots[p.id]=JSON.parse(raw);}catch(e){}}
});
var live=null;
if(active==null){
var liveRaw=localStorage.getItem(KEY);
if(liveRaw!=null){try{live=JSON.parse(liveRaw);}catch(e){}}
}
var data={profiles:profiles,active:active,slots:slots,live:live};
return JSON.stringify({data:data,savedAt:new Date().toISOString()});
};
window.__mystartSyncImport=function(json){
try{
var payload=JSON.parse(json);
var data=payload.data;
if(data.active==null){
if(data.live!=null)localStorage.setItem(KEY,JSON.stringify(data.live));else localStorage.removeItem(KEY);
localStorage.removeItem(LIST);
localStorage.removeItem(ACTIVE);
}else{
saveProfiles(data.profiles||[]);
localStorage.setItem(ACTIVE,data.active);
(data.profiles||[]).forEach(function(p){
var val=data.slots?data.slots[p.id]:null;
if(val!=null)localStorage.setItem(slotKey(p.id),JSON.stringify(val));
});
var activeVal=data.slots?data.slots[data.active]:null;
loadDataInto(activeVal!=null?JSON.stringify(activeVal):null);
}
location.reload();
return true;
}catch(e){return false;}
};
var syncDot;
function mkSyncDot(){
var d=document.createElement('div');
d.style.cssText='width:8px;height:8px;border-radius:50%;background:#565d68;margin-left:6px;flex:0 0 auto;';
d.title='OneDrive-Sync: noch kein Status';
syncDot=d;
return d;
}
if(window.chrome&&window.chrome.webview){
window.chrome.webview.addEventListener('message',function(ev){
var d=ev.data;
if(!d||d.type!=='sync-status'||!syncDot)return;
syncDot.style.background=d.ok?'#2ea043':'#e8b923';
syncDot.title=d.ok?('OneDrive-Sync: '+d.message):('OneDrive-Sync-Problem: '+d.message);
});
}
var bar;
var TXT_SHADOW='text-shadow:0 1px 3px rgba(0,0,0,.85),0 0 1px rgba(0,0,0,.6);';
function mkPlus(){
var b=document.createElement('div');
b.textContent='+';
b.title='Neuen Reiter anlegen';
b.style.cssText='width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-family:"Segoe UI",system-ui,sans-serif;font-size:15px;font-weight:600;color:#c7cbd3;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:6px;transition:background .12s,color .12s;'+TXT_SHADOW;
b.onmouseenter=function(){b.style.background='rgba(255,255,255,0.16)';b.style.color='#fff';};
b.onmouseleave=function(){b.style.background='transparent';b.style.color='#c7cbd3';};
b.addEventListener('click',function(){addProfile();});
return b;
}
function mkTab(p,isActive){
var wrap=document.createElement('div');
wrap.style.cssText='position:relative;display:flex;align-items:center;';
var b=document.createElement('div');
b.textContent=p.label;
b.title='Zu diesem Reiter wechseln — Doppelklick zum Umbenennen';
b.style.cssText='padding:6px 22px 6px 12px;font-family:"Segoe UI",system-ui,sans-serif;font-size:12.5px;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:6px;transition:background .12s,color .12s;'+TXT_SHADOW+
(isActive
? 'color:#ffffff;font-weight:700;background:rgba(255,255,255,0.22);box-shadow:inset 0 0 0 1px rgba(255,255,255,0.28);'
: 'color:#d7dae0;font-weight:500;background:transparent;');
b.addEventListener('click',function(){switchTo(p.id);});
b.addEventListener('dblclick',function(ev){ev.preventDefault();renameProfile(p.id);});
var x=document.createElement('div');
x.textContent='\\u00d7';
x.title='Reiter entfernen';
x.style.cssText='position:absolute;right:2px;top:50%;transform:translateY(-50%);width:16px;height:16px;display:flex;align-items:center;justify-content:center;font-size:12px;color:#c7cbd3;cursor:pointer;opacity:0;transition:opacity .12s,color .12s,background .12s;border-radius:4px;';
x.addEventListener('click',function(ev){ev.stopPropagation();deleteProfile(p.id);});
// Toggle on the wrapper (not the label itself) so moving the cursor
// from the label onto the x doesn't count as "leaving" and hide it again mid-click.
wrap.addEventListener('mouseenter',function(){if(!isActive)b.style.background='rgba(255,255,255,0.14)';x.style.opacity='1';});
wrap.addEventListener('mouseleave',function(){if(!isActive)b.style.background='transparent';x.style.opacity='0';});
x.onmouseenter=function(){x.style.color='#fff';x.style.background='#e81123';};
x.onmouseleave=function(){x.style.color='#c7cbd3';x.style.background='transparent';};
wrap.appendChild(b);wrap.appendChild(x);
return wrap;
}
function render(){
if(!bar)return;
bar.innerHTML='';
var active=getActive();
getProfiles().forEach(function(p){bar.appendChild(mkTab(p,p.id===active));});
bar.appendChild(mkPlus());
bar.appendChild(mkSyncDot());
}
function add(){
if(!document.body||document.getElementById('mystart-profiles'))return;
migrateLegacy();
bar=document.createElement('div');
bar.id='mystart-profiles';
bar.style.cssText='position:fixed;top:6px;left:6px;display:flex;align-items:center;gap:2px;padding:4px;z-index:2147483647;background:rgba(22,24,29,0.68);border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,0.4),inset 0 0 0 1px rgba(255,255,255,0.06);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);';
document.body.appendChild(bar);
render();
}
if(document.body)add();else document.addEventListener('DOMContentLoaded',add);
new MutationObserver(function(){if(!document.getElementById('mystart-profiles'))add();}).observe(document.documentElement,{childList:true,subtree:true});
})();`;
mainJs = trInfra + autostartJs + windowControlsJs + profilesJs + mainJs;
const trPatches = [
// panel header (top-level AND sub, both go through element.header)

View File

@@ -8,7 +8,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>MyStart</AssemblyName>
<RootNamespace>MyStart</RootNamespace>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<ApplicationIcon>app.ico</ApplicationIcon>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>

View File

@@ -27,6 +27,11 @@ class MainForm : Form
private readonly WebView2 _web = new() { Dock = DockStyle.Fill };
private const string Host = "mystart.local";
private bool _pendingMaximize;
private System.Windows.Forms.Timer? _syncTimer;
private string? _syncFilePath; // OneDrive\MyStart\sync.json, or null if no OneDrive found
private string? _syncMarkerPath; // local record of what we last pushed/pulled, survives restarts
private string? _lastSyncedDataRaw;
private bool _syncInProgress;
public MainForm(bool startMinimized = false)
{
@@ -90,6 +95,26 @@ class MainForm : Form
"MyStart");
Directory.CreateDirectory(dataDir);
// Optional OneDrive sync: if OneDrive is set up on this PC, drop a JSON
// snapshot of the whole app state (all Reiter/profiles) in a MyStart
// subfolder there. OneDrive itself does the actual transfer between
// PCs; we just poll that file. No OneDrive -> sync silently stays off.
string? oneDriveRoot = Environment.GetEnvironmentVariable("OneDrive")
?? Environment.GetEnvironmentVariable("OneDriveConsumer")
?? Environment.GetEnvironmentVariable("OneDriveCommercial");
if (!string.IsNullOrEmpty(oneDriveRoot))
{
try
{
string syncDir = Path.Combine(oneDriveRoot, "MyStart");
Directory.CreateDirectory(syncDir);
_syncFilePath = Path.Combine(syncDir, "sync.json");
_syncMarkerPath = Path.Combine(dataDir, "sync-marker.json");
_lastSyncedDataRaw = File.Exists(_syncMarkerPath) ? File.ReadAllText(_syncMarkerPath) : null;
}
catch { _syncFilePath = null; }
}
var env = await CoreWebView2Environment.CreateAsync(null, dataDir);
await _web.EnsureCoreWebView2Async(env);
@@ -171,9 +196,122 @@ class MainForm : Form
}
};
// Kick a sync check after every completed load (first start, and any
// reload the sync pull/push itself triggers), then keep polling.
core.NavigationCompleted += async (_, e) =>
{
if (!e.IsSuccess) return;
await SyncTickAsync(isClosing: false);
if (_syncTimer == null && _syncFilePath != null)
{
_syncTimer = new System.Windows.Forms.Timer { Interval = 30_000 };
_syncTimer.Tick += async (_, _) => await SyncTickAsync(isClosing: false);
_syncTimer.Start();
}
};
core.Navigate("https://" + Host + "/index.html");
}
// --- OneDrive sync tick: export current state from the page (opaque JSON
// blob, the page understands its own structure -- we don't), compare with
// what's on disk, and push or pull whichever side is behind. "Local
// changed since last sync" always wins a push; a pull is skipped while
// the window is actively focused so we never yank a reload out from under
// someone mid-edit -- it'll catch up on the next tick after they click away. ---
private async Task SyncTickAsync(bool isClosing)
{
if (_syncFilePath == null || _syncInProgress) return;
_syncInProgress = true;
try
{
string raw = await _web.CoreWebView2.ExecuteScriptAsync(
"window.__mystartSyncExport && window.__mystartSyncExport()");
string? exportJson = JsonSerializer.Deserialize<string>(raw);
if (string.IsNullOrEmpty(exportJson)) return;
string? localDataRaw = ExtractDataRaw(exportJson);
if (localDataRaw == null) return;
string? fileFullJson = null;
string? fileDataRaw = null;
if (File.Exists(_syncFilePath))
{
fileFullJson = await File.ReadAllTextAsync(_syncFilePath);
fileDataRaw = ExtractDataRaw(fileFullJson);
}
if (localDataRaw != _lastSyncedDataRaw)
{
// Something changed here since we last synced -> push (last writer wins).
await File.WriteAllTextAsync(_syncFilePath, exportJson);
_lastSyncedDataRaw = localDataRaw;
TryWriteMarker(localDataRaw);
PostSyncStatus(true, "gesendet");
}
else if (fileDataRaw != null && fileDataRaw != localDataRaw && !isClosing)
{
// Nothing changed locally, but the shared file moved on -> pull,
// unless we're actively being used right now.
if (!ContainsFocus || WindowState == FormWindowState.Minimized)
{
string js = "window.__mystartSyncImport && window.__mystartSyncImport(" +
JsonSerializer.Serialize(fileFullJson) + ")";
await _web.CoreWebView2.ExecuteScriptAsync(js);
_lastSyncedDataRaw = fileDataRaw;
TryWriteMarker(fileDataRaw);
PostSyncStatus(true, "aktualisiert");
}
}
else
{
PostSyncStatus(true, "aktuell");
}
}
catch (Exception ex)
{
PostSyncStatus(false, ex.Message);
}
finally
{
_syncInProgress = false;
}
}
private static string? ExtractDataRaw(string json)
{
try
{
using var doc = JsonDocument.Parse(json);
return doc.RootElement.TryGetProperty("data", out var data) ? data.GetRawText() : null;
}
catch { return null; }
}
private void TryWriteMarker(string dataRaw)
{
try { if (_syncMarkerPath != null) File.WriteAllText(_syncMarkerPath, dataRaw); }
catch { /* best effort */ }
}
private void PostSyncStatus(bool ok, string message)
{
try
{
var json = JsonSerializer.Serialize(new { type = "sync-status", ok, message });
_web.CoreWebView2.PostWebMessageAsJson(json);
}
catch { /* page may be mid-reload */ }
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
// Best-effort final push; not awaited/blocking (would risk deadlocking
// the UI thread against WebView2's own message pump on shutdown). The
// 30s poll already covers normal use -- this just shaves the tail end.
if (_syncFilePath != null) _ = SyncTickAsync(isClosing: true);
}
// --- Autostart (per-user HKCU Run key, points at THIS exe with --minimized) ---
private const string RunKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Run";
private const string RunValueName = "MyStart";

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,510 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Web.WebView2.WinForms</name>
</assembly>
<members>
<member name="T:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties">
<summary>
This class is a bundle of the most common parameters used to create <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> and <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/> instances.
Its main purpose is to be set to <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> in order to customize the environment and/or controller used by a <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/> during implicit initialization.
</summary>
<remarks>
This class isn't intended to contain all possible environment or controller customization options.
If you need complete control over the environment and/or controller used by a WebView2 control then you'll need to initialize the control explicitly by
creating your own environment (with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/>) and/or controller options (with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2ControllerOptions"/>) and passing them to <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/>
*before* you set the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property to anything.
See the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/> class documentation for an initialization overview.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.#ctor">
<summary>
Creates a new instance of <see cref="T:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties"/> with default data for all properties.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.BrowserExecutableFolder">
<summary>
Gets or sets the value to pass as the browserExecutableFolder parameter of <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.UserDataFolder">
<summary>
Gets or sets the value to pass as the userDataFolder parameter of <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.Language">
<summary>
Gets or sets the value to use for the Language property of the CoreWebView2EnvironmentOptions parameter passed to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.ProfileName">
<summary>
Gets or sets the value to use for the ProfileName property of the CoreWebView2ControllerOptions parameter passed to CreateCoreWebView2ControllerWithOptionsAsync when creating an controller with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.AdditionalBrowserArguments">
<summary>
Gets or sets the value to pass as the AdditionalBrowserArguments parameter of <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions"/> which is passed to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> when creating an environment with this instance.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.IsInPrivateModeEnabled">
<summary>
Gets or sets the value to use for the IsInPrivateModeEnabled property of the CoreWebView2ControllerOptions parameter passed to CreateCoreWebView2ControllerWithOptionsAsync when creating an controller with this instance.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.CreateEnvironmentAsync">
<summary>
Create a <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> using the current values of this instance's properties.
</summary>
<returns>A task which will provide the created environment on completion, or null if no environment-related options are set.</returns>
<remarks>
As long as no other properties on this instance are changed, repeated calls to this method will return the same task/environment as earlier calls.
If some other property is changed then the next call to this method will return a different task/environment.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.CoreWebView2CreationProperties.CreateCoreWebView2ControllerOptions(Microsoft.Web.WebView2.Core.CoreWebView2Environment)">
<summary>
Creates a <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> using the current values of this instance's properties.
</summary>
<returns>A <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> object or null if no controller-related properties are set.</returns>
<exception cref="T:System.NullReferenceException">Thrown if the parameter environment is null.</exception>
</member>
<member name="T:Microsoft.Web.WebView2.WinForms.WebView2">
<summary>
Control to embed WebView2 in WinForms.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.#ctor">
<summary>
Create a new WebView2 WinForms control.
After construction the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property is <c>null</c>.
Call <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> to initialize the underlying <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/>.
</summary>
<remarks>
This control is effectively a wrapper around the WebView2 COM API, which you can find documentation for here: https://aka.ms/webview2
You can directly access the underlying ICoreWebView2 interface and all of its functionality by accessing the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property.
Some of the most common COM functionality is also accessible directly through wrapper methods/properties/events on the control.
Upon creation, the control's CoreWebView2 property will be null.
This is because creating the CoreWebView2 is an expensive operation which involves things like launching Edge browser processes.
There are two ways to cause the CoreWebView2 to be created:
1) Call the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> method. This is referred to as explicit initialization.
2) Set the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property. This is referred to as implicit initialization.
Either option will start initialization in the background and return back to the caller without waiting for it to finish.
To specify options regarding the initialization process, either pass your own <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> to EnsureCoreWebView2Async or set the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> property prior to initialization.
When initialization has finished (regardless of how it was triggered) then the following things will occur, in this order:
1) The control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked. If you need to perform one time setup operations on the CoreWebView2 prior to its use then you should do so in a handler for that event.
2) If a Uri has been set to the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property then the control will start navigating to it in the background (i.e. these steps will continue without waiting for the navigation to finish).
3) The Task returned from <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> will complete.
For more details about any of the methods/properties/events involved in the initialization process, see its specific documentation.
Accelerator key presses (e.g. Ctrl+P) that occur within the control will
fire standard key press events such as OnKeyDown. You can suppress the
control's default implementation of an accelerator key press (e.g.
printing, in the case of Ctrl+P) by setting the Handled property of its
EventArgs to true. Also note that the underlying browser process is
blocked while these handlers execute, so:
<list type="number">
<item>
You should avoid doing a lot of work in these handlers.
</item>
<item>
Some of the WebView2 and CoreWebView2 APIs may throw errors if
invoked within these handlers due to being unable to communicate with
the browser process.
</item>
</list>
If you need to do a lot of work and/or invoke WebView2 APIs in response to
accelerator keys then consider kicking off a background task or queuing
the work for later execution on the UI thread.
</remarks>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Dispose(System.Boolean)">
<summary>
Cleans up any resources being used.
</summary>
<param name="disposing"><c>true</c> if managed resources should be disposed; otherwise, <c>false</c>.</param>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnPaint(System.Windows.Forms.PaintEventArgs)">
<summary>
Overrides the base OnPaint event to have custom actions
in designer mode
</summary>
<param name="e">The graphics devices which is the source</param>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.WndProc(System.Windows.Forms.Message@)">
<summary>
Overrides the base WndProc events to handle specific window messages.
</summary>
<param name="m">The Message object containing the HWND window message and parameters</param>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties">
<summary>
Gets or sets a bag of options which are used during initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
This property cannot be modified (an exception will be thrown) after initialization of the control's CoreWebView2 has started.
</summary>
<exception cref="T:System.InvalidOperationException">Thrown if initialization of the control's CoreWebView2 has already started.</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)">
<summary>
Explicitly trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
</summary>
<param name="environment">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> that should be used to create the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
Creating your own environment gives you control over several options that affect how the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is initialized.
If you pass <c>null</c> (the default value) then a default environment will be created and used automatically.
</param>
<param name="controllerOptions">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions"/> that should be used to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/>.
Creating your own controller options gives you control over several options that affect how the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2"/> is initialized.
If you pass a controllerOptions to this method then it will override any settings specified on the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> property.
If you pass <c>null</c> (the default value) and no value has been set to <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> then a default controllerOptions will be created and used automatically.
</param>
<returns>
A Task that represents the background initialization process.
When the task completes then the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property will be available for use (i.e. non-null).
Note that the control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked before the task completes
or on exceptions.
</returns>
<remarks>
Unless previous initialization has already failed, calling this method additional times with the same parameter will have no effect (any specified environment is ignored) and return the same Task as the first call.
Unless previous initialization has already failed, calling this method after initialization has been implicitly triggered by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property will have no effect if no environment is given
and simply return a Task representing that initialization already in progress.
Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an <see cref="T:System.ArgumentException"/>. For example, this can happen if you begin initialization
by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property and then call this method with a new environment, if you begin initialization with <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> and then call this method with a new
environment, or if you begin initialization with one environment and then call this method with no environment specified.
When this method is called after previous initialization has failed, it will trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> again.
Note that even though this method is asynchronous and returns a Task, it still must be called on the UI thread like most public functionality of most UI controls.
<para>
The following summarizes the possible error values and a description of why these errors occur.
<list type="table">
<listheader>
<description>Error Value</description>
<description>Description</description>
</listheader>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)</c></description>
<description>*\\Edge\\Application* path used in browserExecutableFolder.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_INVALID_STATE)</c></description>
<description>Specified options do not match the options of the WebViews that are currently running in the shared browser process.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_INVALID_WINDOW_HANDLE)</c></description>
<description>WebView2 Initialization failed due to an invalid host HWND parentWindow.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_DISK_FULL)</c></description>
<description>WebView2 Initialization failed due to reaching the maximum number of installed runtime versions.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED</c></description>
<description>If the Webview depends upon an installed WebView2 Runtime version and it is uninstalled.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)</c></description>
<description>Could not find Edge installation.</description>
</item>
<item>
<description><c>HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)</c></description>
<description>User data folder cannot be created because a file with the same name already exists.</description>
</item>
<item>
<description><c>E_ACCESSDENIED</c></description>
<description>Unable to create user data folder, Access Denied.</description>
</item>
<item>
<description><c>E_FAIL</c></description>
<description>Edge runtime unable to start.</description>
</item>
</list>
</para>
</remarks>
<exception cref="T:System.ArgumentException">
Thrown if this method is called with a different environment than when it was initialized. See Remarks for more info.
</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if this instance of <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is already disposed, or if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.
May also be thrown if the browser process has crashed unexpectedly and left the control in an invalid state. We are considering throwing a different type of exception for this case in the future.
</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment)">
<summary>
Explicitly trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
</summary>
<param name="environment">
A pre-created <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Environment"/> that should be used to create the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>.
Creating your own environment gives you control over several options that affect how the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is initialized.
If you pass <c>null</c> then a default environment will be created and used automatically.
</param>
<returns>
A Task that represents the background initialization process.
When the task completes then the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> property will be available for use (i.e. non-null).
Note that the control's <see cref="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted"/> event will be invoked before the task completes
or on exceptions.
</returns>
<remarks>
Unless previous initialization has already failed, calling this method additional times with the same parameter will have no effect (any specified environment is ignored) and return the same Task as the first call.
Unless previous initialization has already failed, calling this method after initialization has been implicitly triggered by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property will have no effect if no environment is given
and simply return a Task representing that initialization already in progress.
Unless previous initialization has already failed, calling this method with a different environment after initialization has begun will result in an <see cref="T:System.ArgumentException"/>. For example, this can happen if you begin initialization
by setting the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property and then call this method with a new environment, if you begin initialization with <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CreationProperties"/> and then call this method with a new
environment, or if you begin initialization with one environment and then call this method with no environment specified.
When this method is called after previous initialization has failed, it will trigger initialization of the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> again.
Note that even though this method is asynchronous and returns a Task, it still must be called on the UI thread like most public functionality of most UI controls.
</remarks>
<exception cref="T:System.ArgumentException">
Thrown if this method is called with a different environment than when it was initialized. See Remarks for more info.
</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if this instance of <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is already disposed, or if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.
May also be thrown if the browser process has crashed unexpectedly and left the control in an invalid state. We are considering throwing a different type of exception for this case in the future.
</exception>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.InitCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)">
<summary>
This is the private function which implements the actual background initialization task.
Cannot be called if the control is already initialized or has been disposed.
</summary>
<param name="environment">
The environment to use to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/>.
If that is null then a default environment is created with <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(System.String,System.String,Microsoft.Web.WebView2.Core.CoreWebView2EnvironmentOptions)"/> and its default parameters.
</param>
<param name="controllerOptions">
The controllerOptions to use to create the <see cref="T:Microsoft.Web.WebView2.Core.CoreWebView2Controller"/>.
If that is null then a default controllerOptions is created with its default parameters.
</param>
<returns>A task representing the background initialization process.</returns>
<remarks>All the event handlers added here need to be removed in <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.Dispose(System.Boolean)"/>.</remarks>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CreateParams">
<summary>
Protected CreateParams property. Used to set custom window styles to the forms HWND.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnVisibleChanged(System.EventArgs)">
<summary>
Protected VisibilityChanged handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnSizeChanged(System.EventArgs)">
<summary>
Protected SizeChanged handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Select(System.Boolean,System.Boolean)">
<summary>
Protected Select method: override this to capture tab direction when WebView control is activated
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.ProcessDialogKey(System.Windows.Forms.Keys)">
<summary>Processes a dialog key.</summary>
<param name="keyData">One of the <see cref="T:System.Windows.Forms.Keys" /> values that represents the key to process.</param>
<returns>
<see langword="true" /> if the key was processed by the control; otherwise, <see langword="false" />.</returns>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnGotFocus(System.EventArgs)">
<summary>
Protected OnGotFocus handler.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.OnParentChanged(System.EventArgs)">
<summary>
Protected OnParentChanged handler.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.IsInitialized">
<summary>
True if initialization finished successfully and the control is not disposed yet.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GetSitedParentSite(System.Windows.Forms.Control)">
<summary>
Recursive retrieval of the parent control
</summary>
<param name="control">The control to get the parent for</param>
<returns>The root parent control</returns>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2">
<summary>
The underlying CoreWebView2. Use this property to perform more operations on the WebView2 content than is exposed
on the WebView2. This value is null until it is initialized and the object itself has undefined behaviour once the control is disposed.
You can force the underlying CoreWebView2 to
initialize via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment,Microsoft.Web.WebView2.Core.CoreWebView2ControllerOptions)"/> method.
</summary>
<exception cref="T:System.InvalidOperationException">Thrown if the calling thread isn't the thread which created this object (usually the UI thread). See <see cref="P:System.Windows.Forms.Control.InvokeRequired"/> for more info.</exception>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactor">
<summary>
The zoom factor for the WebView.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.AllowExternalDrop">
<summary>
Enable/disable external drop.
</summary>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.Source">
<summary>
The Source property is the URI of the top level document of the
WebView2. Setting the Source is equivalent to calling <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Navigate(System.String)"/>.
Setting the Source will trigger initialization of the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/>, if not already initialized.
The default value of Source is <c>null</c>, indicating that the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.
</summary>
<exception cref="T:System.ArgumentException">Specified value is not an absolute <see cref="T:System.Uri"/>.</exception>
<exception cref="T:System.NotImplementedException">Specified value is <c>null</c> and the control is initialized.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Navigate(System.String)"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CanGoForward">
<summary>
Returns true if the webview can navigate to a next page in the
navigation history via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.GoForward"/> method.
This is equivalent to the <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoForward"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this property is <c>false</c>.
</summary>
<seealso cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoForward"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.CanGoBack">
<summary>
Returns <c>true</c> if the webview can navigate to a previous page in the
navigation history via the <see cref="M:Microsoft.Web.WebView2.WinForms.WebView2.GoBack"/> method.
This is equivalent to the <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoBack"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this property is <c>false</c>.
</summary>
<seealso cref="P:Microsoft.Web.WebView2.Core.CoreWebView2.CanGoBack"/>
</member>
<member name="P:Microsoft.Web.WebView2.WinForms.WebView2.DefaultBackgroundColor">
<summary>
The default background color for the WebView.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.ExecuteScriptAsync(System.String)">
<summary>
Executes the provided script in the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.ExecuteScriptAsync(System.String)"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.ExecuteScriptAsync(System.String)"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Reload">
<summary>
Reloads the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Reload"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Reload"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GoForward">
<summary>
Navigates to the next page in navigation history.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoForward"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoForward"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.GoBack">
<summary>
Navigates to the previous page in navigation history.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoBack"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.GoBack"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.NavigateToString(System.String)">
<summary>
Renders the provided HTML as the top level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String)"/>.
</summary>
<exception cref="T:System.InvalidOperationException">The underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized.</exception>
<exception cref="T:System.InvalidOperationException">Thrown when browser process has unexpectedly and left this control in an invalid state. We are considering throwing a different type of exception for this case in the future.</exception>
<remarks>The <c>htmlContent</c> parameter may not be larger than 2 MB (2 * 1024 * 1024 bytes) in total size. The origin of the new page is <c>about:blank</c>.</remarks>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String)"/>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.Stop">
<summary>
Stops any in progress navigation in the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to <see cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Stop"/>.
If the underlying <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> is not yet initialized, this method does nothing.
</summary>
<seealso cref="M:Microsoft.Web.WebView2.Core.CoreWebView2.Stop"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2InitializationCompleted">
<summary>
This event is triggered either 1) when the control's <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.CoreWebView2"/> has finished being initialized (regardless of how it was triggered or whether it succeeded) but before it is used for anything
OR 2) the initialization failed.
You should handle this event if you need to perform one time setup operations on the CoreWebView2 which you want to affect all of its usages
(e.g. adding event handlers, configuring settings, installing document creation scripts, adding host objects).
</summary>
<remarks>
This sender will be the WebView2 control, whose CoreWebView2 property will now be valid (i.e. non-null) for the first time
if <see cref="P:Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs.IsSuccess"/> is true.
Unlikely this event can fire second time (after reporting initialization success first)
if the initialization is followed by navigation which fails.
</remarks>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.NavigationStarting">
<summary>
NavigationStarting dispatches before a new navigate starts for the top
level document of the <see cref="T:Microsoft.Web.WebView2.WinForms.WebView2"/>.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationStarting"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationStarting"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.NavigationCompleted">
<summary>
NavigationCompleted dispatches after a navigate of the top level
document completes rendering either successfully or not.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationCompleted"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.NavigationCompleted"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.WebMessageReceived">
<summary>
WebMessageReceived dispatches after web content sends a message to the
app host via <c>chrome.webview.postMessage</c>.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.WebMessageReceived"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.WebMessageReceived"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.SourceChanged">
<summary>
SourceChanged dispatches after the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.Source"/> property changes. This may happen
during a navigation or if otherwise the script in the page changes the
URI of the document.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.SourceChanged"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.SourceChanged"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.ContentLoading">
<summary>
ContentLoading dispatches after a navigation begins to a new URI and the
content of that URI begins to render.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.ContentLoading"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2.ContentLoading"/>
</member>
<member name="E:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactorChanged">
<summary>
ZoomFactorChanged dispatches when the <see cref="P:Microsoft.Web.WebView2.WinForms.WebView2.ZoomFactor"/> property changes.
This is equivalent to the <see cref="E:Microsoft.Web.WebView2.Core.CoreWebView2Controller.ZoomFactorChanged"/> event.
</summary>
<seealso cref="E:Microsoft.Web.WebView2.Core.CoreWebView2Controller.ZoomFactorChanged"/>
</member>
<member name="F:Microsoft.Web.WebView2.WinForms.WebView2.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:Microsoft.Web.WebView2.WinForms.WebView2.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

BIN
webview2/out_v6/MyStart.exe Normal file

Binary file not shown.