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


C# ScriptCoreLib.Special方法代码示例

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


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

示例1: WebMethod2

        /// <summary>
        /// This Method is a javascript callable method.
        /// </summary>
        /// <param name="e">A parameter from javascript.</param>
        /// <param name="y">A callback to javascript.</param>
        public void WebMethod2()
        {
            // we would like to have a cursor? can we?

            new Data.PerformanceResourceTimingData2.ApplicationPerformance().Insert(
                new Data.PerformanceResourceTimingData2ApplicationPerformanceRow { Tag = " hi ", connectStart = 1, connectEnd = 2 }
            );

            var loc0 = "loc0";

            // are we able to provide Funcs from the client?
            // do we even have a whitelist of funcs the client can send us?
            Func<string, string> Special = x =>
                x + " not in sql, at selection on server " + new { loc0 };

            var loc1 = new { Special };

            var z = from ss in new Data.PerformanceResourceTimingData2.ApplicationPerformance()

                    orderby ss.Key

                    //let datagroup0 = new { datagroup0Tag = ss.Tag }

                    select new
                    {
                        datagroup0 = new[] { new { a = 0 }, new { a = 1 } },


                        // Error	279	An expression tree may not contain an anonymous method expression	X:\jsc.svn\examples\javascript\LINQ\test\SelectToUpperIntoNewExpression\SelectToUpperIntoNewExpression\ApplicationWebService.cs	47	29	SelectToUpperIntoNewExpression
                        // why not?
                        datagroup3 = new XElement("tag", new XElement("u", ss.Tag), "text element", new XAttribute("style", "color:red;")),

                        //f = new Action(
                        //    delegate
                        //    {
                        //    }
                        //),
                        goo = loc1.Special(ss.Tag),
                        //goo2 = ss.Tag.StaticSpecial(),

                        //tuple0 = Tuple.Create(ss.Tag, ss.connectStart),

                        //dict = new StringDictionary
                        //dict = new Dictionary<string, string>
                        //dict = new data(ss.Tag, "goo2")
                        //{
                        //    ["tag", ss.connectStart] = "complex",

                        //    [ss.Tag] = ss.Tag,
                        //    ["tag"] = "goo",

                        //    $goo = "goo"
                        //},

                        datagroup1 = new { datagroup1Tag = ss.Tag, z = "???", datagroup2 = new { datagroup1Tag = ss.Tag.ToLower() } },
                        datagroup2 = new { datagroup1Tag = ss.Tag.ToUpper(), loc0 },

                        // what about named args and optional args?
                        // Error	284	An expression tree may not contain a call or invocation that uses optional arguments	X:\jsc.svn\examples\javascript\LINQ\test\SelectToUpperIntoNewExpression\SelectToUpperIntoNewExpression\ApplicationWebService.cs	49	38	SelectToUpperIntoNewExpression
                        // why not? roslyn fix it :D
                        // Error	279	An expression tree may not contain a named argument specification	X:\jsc.svn\examples\javascript\LINQ\test\SelectToUpperIntoNewExpression\SelectToUpperIntoNewExpression\ApplicationWebService.cs	52	38	SelectToUpperIntoNewExpression

                        datagroup4 = new data(ss.Tag, "goo2"),

                        // after we moved from member names to index, what does it take to do arrays?
                        datagroup5 = new[] { ss.connectStart, ss.connectEnd },

                        xlower = ss.Tag.ToLower(),
                        x = ss.Tag.ToUpper()
                    };

            // ToDataTable?
            var zzz = z.AsDataTable();
            var zz = z.FirstOrDefault();

            Debugger.Break();
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:82,代码来源:ApplicationWebService.cs


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