public JsInfo CreateContext() { var resultString = WebAssemblyRuntime.InvokeJSWithInterop($"return {this}.createContext('{Panel.GetHtmlId()}');"); var result = resultString?.Split(','); if (result?.Length != 5) { return(default);
protected override void SetAnimationFramesInterval() { if (Handle.IsAlive) { WebAssemblyRuntime.InvokeJSWithInterop($"{this}.SetAnimationFramesInterval();"); } else if (this.Log().IsEnabled(LogLevel.Debug)) { this.Log().Debug("Cannot SetAnimationFramesInterval as Handle is no longer alive."); } }
protected override void SetStartFrameDelay(long delayMs) { if (Handle.IsAlive) { WebAssemblyRuntime.InvokeJSWithInterop($"{this}.SetStartFrameDelay({delayMs});"); } else if (this.Log().IsEnabled(LogLevel.Debug)) { this.Log().Debug("Cannot SetStartFrameDelay as Handle is no longer alive."); } }
protected override void DisableFrameReporting() { if (Handle.IsAlive) { WebAssemblyRuntime.InvokeJSWithInterop($"{this}.DisableFrameReporting();"); } else if (this.Log().IsEnabled(LogLevel.Debug)) { this.Log().Debug("Cannot DisableFrameReporting as Handle is no longer alive."); } }
public void ResizeCanvas() => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.resizeCanvas();");
public void SetEnableRenderLoop(bool enable) => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.setEnableRenderLoop({(enable ? "true" : "false")});");
public void RequestAnimationFrame(bool renderLoop) => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.requestAnimationFrame({(renderLoop ? "true" : "false")});");
protected override void SetAnimationFramesInterval() => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.SetAnimationFramesInterval();");
protected override void SetStartFrameDelay(long delayMs) => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.SetStartFrameDelay({delayMs});");
protected override void DisableFrameReporting() => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.DisableFrameReporting();");
public void SetCurrent() => WebAssemblyRuntime.InvokeJSWithInterop($"{this}.setCurrent();");