本文整理汇总了C#中ScriptObject.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptObject.Invoke方法的具体用法?C# ScriptObject.Invoke怎么用?C# ScriptObject.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptObject
的用法示例。
在下文中一共展示了ScriptObject.Invoke方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadTextureAsync
public void LoadTextureAsync(string uri, object token, ScriptObject completedDelegate)
{
BitmapImage bi = new BitmapImage();
bi.ImageFailed += delegate(object sender, System.Windows.ExceptionRoutedEventArgs e)
{
completedDelegate.Invoke("loadTextureCompleted", -1, -1, -1, token, new Object());
};
bi.ImageOpened += delegate(object sender, System.Windows.RoutedEventArgs e)
{
Texture t = new Texture(bi);
_textures[t.Id] = t;
completedDelegate.Invoke("loadTextureCompleted", t.Id, t.Width, t.Height, token, null);
};
//Make sure we download the texture now, without it being part of the DOM
bi.CreateOptions = BitmapCreateOptions.None;
bi.UriSource = new Uri(uri, UriKind.Absolute);
}
示例2: ReCaptcha_Loaded
void ReCaptcha_Loaded(object sender, RoutedEventArgs e)
{
VisualStateManager.GoToState(this, imageStateName, false);
if (System.ComponentModel.DesignerProperties.IsInDesignTool)
return;
AddScriptContent(recaptchaJavascript);
recaptchaJSObject = HtmlPage.Window.GetProperty("Recaptcha") as ScriptObject;
recaptchaJSObject.Invoke("set_Plugin", HtmlPage.Plugin);
HtmlPage.RegisterScriptableObject("Recaptcha", this);
recaptchaJSObject.Invoke("set_ManagedObject", "Recaptcha");
isLoaded = true;
RefreshApiServer();
if (!string.IsNullOrEmpty(PublicKey))
Challenge();
}