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


C# ScriptCoreLib.ToString方法代码示例

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


在下文中一共展示了ScriptCoreLib.ToString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(string e, Action<string> y)
        {
            var x = new NameValueCollection();

            var w = new StringBuilder();

            w.AppendLine("adding foo");

            //x.Add("foo", e);
            x["foo"] = e;



            w.AppendLine("reading foo");

            var foo = x["foo"];

            var message = new
            {
                //w = w.ToString(),
                foo
            };

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

示例2: Application

        // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201405/20140511/roslyn




        /// <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)
        {
            var i = 13;

            var u = new { i };

            // did jsc stack rewriter fix roslyn tostring thingy for jsc?
            WriteLine(u.ToString());
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:18,代码来源:Application.cs

示例3: 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(string e, Action<string> y)
        {
            var x = typeof(string);
            var xx = e.GetType();

            var xxx = ((object)e) is string;

            var message = new { x, xx, xxx };

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

示例4: __connect_baduser

        public void __connect_baduser(string e, Action<string> y)
        {
            Native.API.error_reporting(64);

            var m = new mysqli(
                "localhost",
                "noroot",
                ""
            );

            var message = new { m.connect_errno, m.errno };
            y(message.ToString());
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:13,代码来源:ApplicationWebService.cs

示例5: WebMethod2

        public void WebMethod2(string e, Action<string> y)
        {
            try
            {
                new Table1(MyDataSource).With(
                    Table1 =>
                    {
                        if (!string.IsNullOrEmpty(e))
                        {
                            var Last = -1L;

                            Table1.Last(
                                //value => Last
                                value => Last = value
                            );

                            Table1.Add(
                                // new Tables.Table1.AddQueryParameters
                                new Table1Queries.Insert
                                {
                                    // implicit?
                                    ContentValue = new { Last, e }.ToString()
                                }
                            );
                        }

                        Console.WriteLine("before Enumerate");

                        Table1.Enumerate(
                            // dynamic until we can actually infer what
                            // fields we are getting
                            reader =>
                            {
                                var data = new { reader.ContentKey, reader.ContentValue };

                                // Send it back to the caller.
                                y(data.ToString());
                            }
                        );

                        Console.WriteLine("after Enumerate");

                    }
                );
            }
            catch
            {
                throw;
            }
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:50,代码来源:ApplicationWebService.cs

示例6: __connect_badhost

        // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2012/2012/20121217

        public void __connect_badhost(string e, Action<string> y)
        {
            //            <br />
            //<b>Warning</b>:  mysqli::mysqli(): php_network_getaddresses: getaddrinfo failed: No such host is known.  in <b>B:\inc\SimpleMySQLiConsole.ApplicationWebService.exe\class.SimpleMySQLiConsole.ApplicationWebService.php</b> on line <b>17</b><br />
            //<br />
            //<b>Warning</b>:  mysqli::mysqli(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known.  in <b>B:\inc\SimpleMySQLiConsole.ApplicationWebService.exe\class.SimpleMySQLiConsole.ApplicationWebService.php</b> on line <b>17</b><br />

            // http://php.net/manual/en/function.error-reporting.php
            Native.API.error_reporting(64);

            var m = new mysqli(
                "nolocalhost",
                "noroot",
                ""
            );

            var message = new { m.connect_errno };
            y(message.ToString());
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:21,代码来源:ApplicationWebService.cs

示例7: WebMethod2

        public void WebMethod2(string e, Action<string> y)
        {
            var m = new mysqli(
                "localhost",
                "root",
                ""
            );

            // <document><y><obj>{ server_info = 5.5.25a, server_version = 50525 }</obj></y></document>
            //<b>Warning</b>:  mysqli::mysqli(): (HY000/1049): Unknown database 'datasource1001' in <b>B:\inc\SimpleMySQLiConsole.ApplicationWebService.exe\class.SimpleMySQLiConsole.ApplicationWebService.php</b> on line <b>17</b><br />

            // http://svn2.assembla.com/svn/nooku-framework/trunk/code/libraries/koowa/database/adapter/mysqli.php
            // http://stackoverflow.com/questions/2203110/check-if-a-variable-is-of-type-mysqli-object
            //var __is_mysqli = m is mysqli;

            var message = new { m.server_info, m.server_version, m.stat };

            // Send it back to the caller.
            y(message.ToString());
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:20,代码来源:ApplicationWebService.cs

示例8: __mysqli_query

        public void __mysqli_query(
            string sql,
            Action<string> __y,
            Action<string, string> yield_field,
            Action<XElement> yield_resultset
            )
        {
            __y.ToConsoleOut();

            Action<string> y = x => Console.WriteLine("__mysqli_query" + x);

            Console.WriteLine("hey!");

            var h = new History();


            h.Insert(
                new HistoryQueries.Insert
                {
                    query = sql,
                    context = "__mysqli_query"
                }
            );

            var m = new mysqli(
                "localhost",
                "root",
                ""
            );

            var flag = m.multi_query(sql);

            var sqlindex = 0;

            {
                var message = new
                {
                    sqlindex,
                    m.errno,
                    m.error,
                    m.insert_id,
                };
                y(message.ToString());
            }

            while (flag)
            {

                var rr = m.store_result();

                //Native.Dump(rr);

                (rr as mysqli_result).With(
                    result =>
                    {
                        #region mysqli_result
                        //var f0 = result.fetch_field_direct(0);
                        //var d0 = Native.DumpToString(f0);

                        var message = new
                        {
                            sqlindex,

                            m.errno,
                            m.error,

                            result.field_count,
                            result.num_rows,

                            m.insert_id,

                            //, d0 
                        };
                        y(message.ToString());

                        //Console.WriteLine("before fields");

                        var resultset = new XElement("table");

                        var resultset_th = new XElement("th");

                        resultset.Add(resultset_th);


                        var fields = Enumerable.Range(0, result.field_count).Select(
                            // jsc can we have implicit delegates to natives?
                            x => result.fetch_field_direct(x)
                        ).Select(
                            (f, i) =>
                            {
                                var n = new { f.name, i, f.type };

                                //Console.WriteLine("field: " + n);
                                resultset_th.Add(
                                    new XElement("td",
                                        new XAttribute("title", "type " + f.type),
                                         f.name
                                    )
                                );

//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:ApplicationWebService.cs

示例9: 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(string e, Action<string> y)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2013/201301/20130101

            var x = new __ConsoleToDatabaseWriter(y);

            Native.API.error_reporting(-1);

            Console.WriteLine("before data");


            var m = new mysqli(
               "127.0.0.1",
               "root",
               ""
           );

            #region query
            Action<string> query =
              _sql =>
              {

                  (m.query(_sql) as mysqli_result).With(
                      r =>
                      {
                          r.close();
                      }
                  );

                  if (m.errno != 0)
                  {
                      var message = new { m.errno, m.error, _sql };
                      Console.WriteLine(message.ToString());
                  }

              };
            #endregion


            query("CREATE DATABASE IF NOT EXISTS `datasource1001`");
            query("use `datasource1001`");


            {
                #region create table.sql
                var sql = @"
create table if not exists TheGridTable 
(
    ContentKey INTEGER PRIMARY KEY AUTOINCREMENT
    , ContentValue text not null
    , ContentComment text not null
    , ParentContentKey INTEGER 
    , FOREIGN KEY(ParentContentKey) REFERENCES TheGridTable (ContentKey)
) 
";
                sql = ScriptCoreLib.PHP.Data.SQLiteToMySQLConversion.Convert(sql);
                #endregion

                query(sql);
            }

            {
                var sql = @"
insert into TheGridTable (ContentValue, ContentComment, ParentContentKey) values (
    ? /* text */
    , ?  /* text */
    , ? 
)
";

                (m.prepare(sql) as mysqli_stmt).With(
                    stmt =>
                    {
                        Console.WriteLine("in prepare " + new { sql });

                        string n = null;

                        stmt.bind_param_array("sss",
                              "a ContentValue",
                              "a ContentComment",
                              n
                          );

                        stmt.execute();

                        var id = m.insert_id;

                        Console.WriteLine("new item " + new { id });


                        (m.prepare(sql) as mysqli_stmt).With(
                            cstmt =>
                            {
                                //Console.WriteLine("in prepare " + new { sql });

//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:ApplicationWebService.cs

示例10: Application


//.........这里部分代码省略.........

                          var getNorthEast_lat = map.getBounds().getNorthEast().lat;
                          var getNorthEast_lng = map.getBounds().getNorthEast().lng;


                          var count = (
                            from data in all

                            let lat = (double)LEST97.lest_function_vba.lest_geo(data.x, data.y, 0)
                            let lng = (double)LEST97.lest_function_vba.lest_geo(data.x, data.y, 1)


                            // lng left to right
                            // lng bottom to top

                            where lat <= getNorthEast_lat
                            where lng <= getNorthEast_lng

                            where lat >= getSouthWest_lat
                            where lng >= getSouthWest_lng

                            select data
                          ).Count();

                          return new
                          {
                              getSouthWest_lat,
                              getSouthWest_lng,

                              getNorthEast_lat,
                              getNorthEast_lng,

                              count
                          }.ToString();
                      }
                  }.AttachToDocument();

                  // http://stackoverflow.com/questions/2472957/how-can-i-change-the-color-of-a-google-maps-marker


                  #region Add
                  new IHTMLButton { "Add" }.AttachToDocument().onclick += delegate
                  {
                      var data = new
                      {
                          map.getCenter().lat,
                          map.getCenter().lng,

                          x = LEST97.lest_function_vba.geo_lest(map.getCenter().lat, map.getCenter().lng, 0),
                          y = LEST97.lest_function_vba.geo_lest(map.getCenter().lat, map.getCenter().lng, 1),
                      };

                      new IHTMLPre { "new { x = " + data.x + ", y = " + data.y + " }" }.AttachToDocument();

                      var marker = new google.maps.Marker(
                        new
                        {
                            position = new
                            {
                                lat = LEST97.lest_function_vba.lest_geo(data.x, data.y, 0),
                                lng = LEST97.lest_function_vba.lest_geo(data.x, data.y, 1)
                            },
                            //label = "H",
                            title = data.ToString(),
                            map
                        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:67,代码来源:Application.cs

示例11: createShader

 public static __WebGLShader createShader(this gl gl, ScriptCoreLib.GLSL.VertexShader fragmentShader)
 {
     return gl.createShader(GLES20.GL_VERTEX_SHADER, fragmentShader.ToString());
 }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:4,代码来源:Shader.cs

示例12: 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)
        {

            new IHTMLTable().With(
                table =>
                {
                    var tbody = table.AddBody();

                    var selectedRow_plus_2 = 0;
                    var selectedRow_minus_2 = 0;

                    var selectedRow = 0;
                    var selectedColumn = 0;

                    // Uncaught TypeError: Cannot call method 'agAABmASXzSNfpl_bHJLUOA' of null 
                    //tbody.css.first.child.adjacentSibling["*"].style.backgroundColor = "red";


                    //tbody.css[IHTMLElement.HTMLElementEnum.tr][() => selectedRow][IHTMLElement.HTMLElementEnum.td].style.backgroundColor = "yellow";
                    tbody.css[() => selectedRow][IHTMLElement.HTMLElementEnum.td].style.backgroundColor = "yellow";


                    //tbody.css[() => selectedRow][IHTMLElement.HTMLElementEnum.td].siblings.style.backgroundColor = "green";
                    //tbody.css[() => selectedRow][IHTMLElement.HTMLElementEnum.td].adjacentSibling.style.backgroundColor = "red";

                    //tbody.css[() => selectedRow][">td"].style.backgroundColor = "yellow";
                    tbody.css[IHTMLElement.HTMLElementEnum.tr][IHTMLElement.HTMLElementEnum.td][() => selectedColumn].style.backgroundColor = "yellow";

                    //tbody.css[">tr"][() => selectedColumn].style.backgroundColor = "cyan";


                    // { selectorText = >td, rule = [style-id="0"] > tr:nth-child(1) > td } 
                    //var header = tbody.css[IHTMLElement.HTMLElementEnum.tr][1][IHTMLElement.HTMLElementEnum.td];

                    tbody.css[0][IHTMLElement.HTMLElementEnum.td].style.backgroundColor = "gray";

                    tbody.css[0][0].style.backgroundColor = "red";



                    tbody.css[() => selectedRow][() => selectedColumn].style.backgroundColor = "red";


                    tbody.css.odd.style.backgroundColor = "cyan";

                    var tbody_css_selectedRow_minus_2 = tbody.css[() => selectedRow_minus_2];
                    var tbody_css_selectedRow_plus_2 = tbody.css[() => selectedRow_plus_2];

                    (tbody_css_selectedRow_minus_2 | tbody_css_selectedRow_plus_2)[IHTMLElement.HTMLElementEnum.td].style.backgroundColor = "gray";


                    //tbody.css[1][1].siblings["(:nth-child(8))"].style.backgroundColor = "red";

                    //tbody.css[1][IHTMLElement.HTMLElementEnum.td].style.backgroundColor = "gray";



                    for (int y = 0; y < 22; y++)
                    {
                        var tr = tbody.AddRow();

                        for (int x = 0; x < 22; x++)
                        {
                            var td = tr.AddColumn("?");

                            var p = new { x, y };

                            td.onmousemove +=
                                delegate
                                {
                                    Native.document.title = p.ToString();

                                    selectedRow = p.y;
                                    selectedRow_minus_2 = p.y - 2;
                                    selectedRow_plus_2 = p.y + 2;

                                    selectedColumn = p.x;
                                };
                        }
                    }

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


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