当前位置: 首页>>代码示例>>C#>>正文


C# Foo.AttachTo方法代码示例

本文整理汇总了C#中System.Foo.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# Foo.AttachTo方法的具体用法?C# Foo.AttachTo怎么用?C# Foo.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Foo的用法示例。


在下文中一共展示了Foo.AttachTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Application

        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            //ms InternalFieldsFromTypeInitializer view-source:35337
            //13ms GetInternalFields load fromlocalstorage!  view-source:35337
            //22ms IHTMLImage <- IHTMLDiv view-source:35337
            //23ms Task<ISVGSVGElement> <- IHTMLDiv view-source:35337
            //31ms ContinueWhenAll { Length = 1, scheduler = [object Object], ManagedThreadId = 1 } view-source:35337
            //32ms IHTMLImage <- Task<ISVGSVGElement> view-source:35337
            //32ms enter contentImage view-source:35337
            //Application Cache Progress event (2 of 3) http://192.168.1.200:16552/view-source 192.168.1.200/:1
            //Application Cache Progress event (3 of 3)  192.168.1.200/:1
            //Application Cache Cached event 192.168.1.200/:1
            //133ms ContinueWhenAll_yield { scheduler = [object Object] } view-source:35337
            //134ms { clientWidth = 679, clientHeight = 249 } view-source:35337
            //170ms yield contentImage view-source:35337
            //61247ms enter contentImage view-source:35337
            //61248ms yield contentImage view-source:35337

            page.body.css.before.contentImage = new Foo().AsNode();
            page.body.css.before.style.position = IStyle.PositionEnum.absolute;
            page.body.css.before.style.bottom = "0";

            var s = new ISVGSVGElement
            {

            };

            var f = new ISVGForeignObject().AttachTo(s);

            var fdiv = new IHTMLDiv().AttachTo(f);

            fdiv.style.fontFamily = IStyle.FontFamilyEnum.Verdana;

            // we need to serialize styles now
            // svg wont have any default html css styles at all
            fdiv.style.fontSize = "12px";

            var div = new Foo();

            var hidden = new IHTMLDiv { }.AttachTo(Native.document.documentElement);
            hidden.style.position = [email protected];
            hidden.style.visibility = IStyle.VisibilityEnum.hidden;
            //hidden.style.display = IStyle.DisplayEnum.none;

            div.PageContainer.style.display = IStyle.DisplayEnum.inline_block;
            div.AttachTo(hidden);

            new IHTMLButton { "do " + new { div.PageContainer.clientWidth, div.PageContainer.clientHeight } }.AttachToDocument().WhenClicked(
               async button =>
               {

                   //div.querySelectorAll("img").WithEach(
                   div.ImageElements().WithEach(
                       q =>
                       {
                           q.src = q.toDataURL();

                       }
                   );

                   button.Orphanize();
                   s.setAttribute("width", div.PageContainer.clientWidth + 0);
                   s.setAttribute("height", div.PageContainer.clientHeight + 0);
                   div.AttachTo(fdiv);

                   // Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
                   IHTMLImage i = s;
                   //Task<IHTMLCanvas> ic = s;

                   //var c = await ic;


                   //var ii = i.toDataURL();

                   page.body.css.after.contentImage = i;
                   page.body.css.after.style.position = IStyle.PositionEnum.absolute;
                   page.body.css.after.style.right = "0";

                   Console.WriteLine("cursor");
                   // cursor no longer appears?
                   Native.document.documentElement.style.cursorImage = i;
                   //Native.css.style.cursorImage = s;
                   Console.WriteLine("icon");
                   Native.document.icon = i;
               }
           );

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:92,代码来源:Application.cs


注:本文中的System.Foo.AttachTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。