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


C# IApp.With方法代码示例

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


在下文中一共展示了IApp.With方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
        {
            //page.Header.css.hover.adjacentSibling.style.borderTop = "1px solid red";


            page.Header.css.hover.siblings.style.borderRight = "2px solid red";

            //page.Header.css.hover.siblings["*"].nthChild[3].style.borderRight = "3px solid red";

            //page.Header.parentNode.css.first.child.style.borderLeft = "1px solid blue";

            //(page.Header.parentNode.firstChild as IHTMLElement).css.siblings["h1"].style.borderRight = "1px solid blue";




            page.Header.css.style.transition = "color 300ms linear";
            page.Header.css.adjacentSibling.style.transition = "border-left 300ms linear";

            page.With(
                async delegate
                {
                    // using transition 300ms ?
                    while (true)
                    {
                        await page.Header.async.onmouseover;


                        // would jsc be smart enough to infer transitions?

                        page.Header.css.style.color = "red";
                        page.Header.css.adjacentSibling.style.borderLeft = "4px solid red";

                        await page.Header.async.onmouseout;

                        page.Header.css.style.color = "yellow";
                        page.Header.css.adjacentSibling.style.borderLeft = "1px solid yellow";


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

示例2: 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)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2013/201312/20131208-expression

            // script: error JSC1000: No implementation found for this native method, please implement 
            // [static System.Linq.Expressions.Expression.Parameter(System.Type, System.String)]

            //            arg[0] is typeof System.RuntimeFieldHandle
            //script: error JSC1000: No implementation found for this native method, please implement [static System.Reflection.FieldInfo.GetFieldFromHandle(System.RuntimeFieldHandle)]

            // script: error JSC1000: No implementation found for this native method, please implement 
            // [static System.Linq.Expressions.Expression.Equal(System.Linq.Expressions.Expression, System.Linq.Expressions.Expression, System.Boolean, System.Reflection.MethodInfo)]

            // script: error JSC1000: No implementation found for this native method, please implement [static System.Reflection.MethodBase.GetMethodFromHandle(System.RuntimeMethodHandle)]

            // Error	2	'string.operator ==(string, string)': cannot explicitly call operator or accessor	X:\jsc.svn\examples\javascript\Test\TestCSSAttrExpression\TestCSSAttrExpression\Application.cs	60	51	TestCSSAttrExpression
            //Func<string, string, bool> x = string.op_Equality;
            //Func<string, string, bool> x = string.Equals;

            ////            { x = [object Object] } view-source:30351
            //// view-source:30351
            //////{ Method = { MethodToken = _9BoABtNdQz66ZYUODttTfw } } 

            //Console.WriteLine(new { x });
            //Console.WriteLine(new { x.Method });

            test();
            //return;

            //var css = this[f: x => x.title == "findme"];
            //css.style.color = "cyan";

            var findme1_text = "findme";
            var findme1_number = 1;

            // field.const
            var findme1 = findme1_text + findme1_number;

            this[f: x => x.title == findme1].style.color = "red";

            var findme3 = findme1_text + "3";


            IStyleSheet.all[x => x.title == findme3].style.color = "purple";
            IStyleSheet.all[x => x.title == findme3].style.backgroundColor = "yellow";


            this[x => x.title == "findme2"].style.color = "blue";

            //css.style.color = "cyan";
            page.With(
                 async delegate
                 {
                     //css.style.color = "cyan";


                     ////set_style_color(x => x.title == "findme", "red");
                     //set_style_color(x => x.title == "findme1", "green");
                     //set_style_color(x => x.title == "findme2", "blue");


                     this[x => x.title == "findme2"].style.color = "blue";

                     await Task.Delay(200);

                     this[x => x.title == "findme2"].style.backgroundColor = "yellow";


                 }
            );


            page.foo.css[input => input.value == "foo"].style.color = "red";

            //xx.style.color = "red";
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:80,代码来源:Application.cs


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