コード例 #1
0
        private string ResolveObjectUrl(Uri uri)
        {
            byte[] imageData = EmbeddedResourceLoader.LoadResourceData(uri);
            string mimeType  = converter.ToMimeTypeString(GetExtension(uri.GetLocalPath()));

            return(InteropBridge.Invoke(InteropCall.CreateBlobUrl, elementId: 0, (imageData, mimeType)));
        }
コード例 #2
0
ファイル: Document.cs プロジェクト: Ref12/Grazor
        public static HtmlElement CreateElementNS(string namespaceUri, string qualifiedName)
        {
            var element = new HtmlElement(namespaceUri, qualifiedName);

            InteropBridge.SendMessage(InteropCall.CreateElementNS, element.ElementId, (namespaceUri, qualifiedName));
            return(element);
        }
コード例 #3
0
ファイル: Document.cs プロジェクト: Ref12/Grazor
        public static HtmlElement CreateElement(string tagName)
        {
            var element = new HtmlElement(null, tagName);

            InteropBridge.SendMessage(InteropCall.CreateElement, element.ElementId, tagName);
            return(element);
        }
コード例 #4
0
ファイル: Document.cs プロジェクト: Ref12/Grazor
        public static HtmlElement GetBody()
        {
            var element = new HtmlElement(null, BodyElementName);

            InteropBridge.SendMessage(InteropCall.RegisterBody, element.ElementId);
            return(element);
        }
コード例 #5
0
ファイル: HtmlElement.cs プロジェクト: Ref12/Grazor
 public TResult Invoke <TResult>(InteropCall <IBrowserComponent, None, TResult> kind)
 {
     return(InteropBridge.Invoke(kind, ElementId));
 }
コード例 #6
0
ファイル: HtmlElement.cs プロジェクト: Ref12/Grazor
 public TResult Invoke <TArg, TResult>(InteropCall <IBrowserComponent, TArg, TResult> kind, TArg arg)
 {
     return(InteropBridge.Invoke(kind, ElementId, arg));
 }
コード例 #7
0
ファイル: HtmlElement.cs プロジェクト: Ref12/Grazor
 public void Send(InteropCall <IBrowserComponent, None> kind)
 {
     InteropBridge.SendMessage(kind, ElementId);
 }
コード例 #8
0
ファイル: HtmlElement.cs プロジェクト: Ref12/Grazor
 public void Send <TArg>(InteropCall <IBrowserComponent, TArg> kind, TArg arg)
 {
     InteropBridge.SendMessage(kind, ElementId, arg);
 }
コード例 #9
0
ファイル: Document.cs プロジェクト: Ref12/Grazor
 public static void Print(string message)
 {
     InteropBridge.SendMessage(InteropCall.Print, 0, message);
 }
コード例 #10
0
ファイル: Window.cs プロジェクト: Ref12/Grazor
 public static void SetApplicationListener(IHtmlApplicationListener listener)
 {
     ApplicationListenerHandle = new JSHandle();
     ApplicationComponent.Add(ApplicationListenerHandle.Id, listener);
     InteropBridge.SendMessage(InteropCall.HandleApplicationEvents, ApplicationListenerHandle.Id);
 }