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


C# App.AsNode方法代码示例

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


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

示例1: Application


//.........这里部分代码省略.........
                                                                {
                                                                    Console.WriteLine("appwindow contentWindow onload");


                                                                    //new IHTMLButton("dynamic").AttachTo(
                                                                    //    appwindow.contentWindow.document.body
                                                                    //);


                                                                };

                                                            //Uncaught TypeError: Cannot read property 'contentWindow' of undefined 


                                                            appwindow.onClosed.addListener(
                                                                new Action(
                                                                    delegate
                                                                    {
                                                                        notify("Ok!", "You can still click on the button on your android. Click here to see diagnostics.",
                                                                            spawn

                                                                        );

                                                                    }
                                                                )
                                                            );


                                                        }
                                                    )
                                                );
                                            };


                                        notify("Ready!", "You can already click on the button on your android. Click here to see diagnostics.",
                                            spawn

                                        );

                                    }
                                )
                            );
                            return;
                        }

                    Console.WriteLine("Application renew body:");
                    Console.WriteLine(Native.Document.documentElement.AsXElement());

                    // if we are in a window lets add layout
                    // Error	6	Cannot create an instance of the abstract class or interface 'AndroidToChromeNotificationExperiment.HTML.Pages.IApp'	X:\jsc.svn\examples\javascript\android\AndroidToChromeNotificationExperiment\AndroidToChromeNotificationExperiment\Application.cs	514	28	AndroidToChromeNotificationExperiment

                    page = new App();

                    page.AsNode().With(
                        n =>
                        {
                            Console.WriteLine("Application renew body " + new { childNodes = n.childNodes.Length });
                            Console.WriteLine("Application renew body " + new { childNodes = n.attributes.Length });

                            n.childNodes.WithEach(k => k.AttachToDocument());
                            n.attributes.WithEach(k => Native.Document.body.setAttribute(k.name, k.value));
                        }
                    );

                    // we are running in chrome! 
                    page.NotifyChromeViaLANBroadcast.disabled = true;

                    Console.WriteLine("Application renew body done:");
                    Console.WriteLine(Native.Document.documentElement.AsXElement());

                    page.ChromeNotification.disabled = false;
                    page.ChromeNotification.onclick +=
                        delegate
                        {
                            notify("Primary Title", "Primary message to display", delegate
                            {
                                Native.window.open("http://example.com", "_blank");


                            });

                        };



                }
            #endregion



            page.NotifyChromeViaLANBroadcast.onclick +=
                delegate
                {
                    // Send data from JavaScript to the server tier
                    service.NotifyChromeViaLANBroadcast(
                        @"A string from JavaScript.",
                        value => value.ToDocumentTitle()
                    );
                };
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs


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