• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# JsArray类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中JsArray的典型用法代码示例。如果您正苦于以下问题:C# JsArray类的具体用法?C# JsArray怎么用?C# JsArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JsArray类属于命名空间,在下文中一共展示了JsArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnReady

        static void OnReady()
        {
            var today = new JsDate();
            var birthdays = new JsArray<JsNumber> {
                new JsDate(today.getFullYear(), today.getMonth(), 11).valueOf(),
                new JsDate(today.getFullYear(), today.getMonth() + 1, 6).valueOf(),
                new JsDate(today.getFullYear(), today.getMonth() + 1, 27).valueOf(),
                new JsDate(today.getFullYear(), today.getMonth() - 1, 3).valueOf(),
                new JsDate(today.getFullYear(), today.getMonth() - 2, 22).valueOf()
 
            };
                    new jQuery("#datepicker").kendoDatePicker(new DatePickerConfiguration {
                        value = today,
                        month=  new MonthConfiguration {
                            // template for dates in month view
                            content = "# if ($.inArray(+data.date, [" + birthdays + "]) != -1) { #" +
                                         "<div class='birthday'></div>" +
                                     "# } #" +
                                     "#= data.value #"
                        },
                        footer = "Today - #=kendo.toString(data, 'd') #"
                    });

                    new jQuery("#datepicker").data("kendoDatePicker").As<DatePicker>();
                                    //TODO: .dateView.calendar.element
                                    //.width(300);
                

        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:29,代码来源:Template.cs


示例2: synchronousTranslate

 public override JsArray<Translation> synchronousTranslate(JsString domain, JsArray<JsString> keys)
 {
     if (HtmlContext.window.console != null) {
         HtmlContext.console.log("Requested to translate: " + domain + " " + keys);
     }
     return new JsArray<Translation>();
 }
开发者ID:griffith-computing,项目名称:Randori,代码行数:7,代码来源:NoOpTranslator.cs


示例3: init

        public override void init(angularScope scope, angularHttp http, angularLocation loc, angularFilter filter)
        {
            base.init(scope, http, loc, filter);
            ngItems = new JsArray<JsArray<ngHistoryEntry>>();

            eventManager.inst.subscribe(eventManager.settingsLoaded, delegate(int n) { requestRefreshPropousals(null); });
        }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:7,代码来源:ngPropousalContoller.cs


示例4: foo

        void foo()
        {
            var list = new JsArray<object>();
            list.push(new object[7]);
            list.push(new byte[7]);
            list.push(new short[7]);
            list.push(new ushort[7]);
            list.push(new int[7]);
            list.push(new uint[7]);
            list.push(new float[7]);
            list.push(new double[7]);

            var blubb = new object[] { 7, 8, 9 };

            list.push(new object[] { 7, 8, 9 });
            list.push(new byte[] { 77, 8, 9 });
            list.push(new short[] { 7, 8, 9 });
            list.push(new ushort[] { 7, 8, 9 });
            list.push(new int[] { 7, 8, 9 });
            list.push(new uint[] { 7, 8, 9 });
            list.push(new float[] { 7, 8, 9 });
            list.push(new double[] { 7, 8, 9 });


            list.push(new[] { 7, 8, 9 });
            list.push(new[] { 7.7, 8.8, 9.9 });
            list.push(new[] { 7d, 8d, 9d });

            int[] a = { 0, 2, 4, 6, 8 };

        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:31,代码来源:Class2.cs


示例5: synchronousTranslate

        public override JsArray<Translation> synchronousTranslate(JsString domain, JsArray<JsString> keys)
        {
            if (!fileLoaded) {
                makeSynchronousRequest( url );
            }

            return provideTranslations(domain, keys);
        }
开发者ID:griffith-computing,项目名称:Randori,代码行数:8,代码来源:PropertyFileTranslator.cs


示例6: init

        public override void init(angularScope scope, angularHttp http, angularLocation loc, angularFilter filter)
        {
            base.init(scope, http, loc, filter);
            ngHistoryItems = new JsArray<ngHistoryGroupEntry>();

            eventManager.inst.subscribe(eventManager.settingsLoaded, delegate(int n) { refreshHistory(); });

            eventManager.inst.subscribe(eventManager.orderCompleted, delegate(int n) { refreshHistory(); });
        }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:9,代码来源:ngHistoryController.cs


示例7: OnReady

        static void OnReady()
        {
            var data = new JsArray<DropDownListConfiguration> { 
                        new DropDownListConfiguration {text = "The Shawshank Redemption", value ="1"},
                        new DropDownListConfiguration {text = "The Godfather", value ="2"},
                        new DropDownListConfiguration {text = "The Godfather = Part II", value ="3"},
                        new DropDownListConfiguration {text = "Il buono, il brutto, il cattivo.", value ="4"},
                        new DropDownListConfiguration {text = "Pulp Fiction", value ="5"},
                        new DropDownListConfiguration {text = "12 Angry Men", value ="6"},
                        new DropDownListConfiguration {text = "Schindler's List", value ="7"},
                        new DropDownListConfiguration {text = "One Flew Over the Cuckoo's Nest", value ="8"},
                        new DropDownListConfiguration {text = "Inception", value ="9"},
                        new DropDownListConfiguration {text = "The Dark Knight", value ="10"}
              };

            new jQuery("#products").kendoDropDownList(new DropDownListConfiguration
            {
                dataTextField = "text",
                dataValueField = "value",
                dataSourceObject = data
            })
                          .closest(".k-widget")
                          .attr("id", "products_wrapper");

            var dropdownlist = new jQuery("#products").data("kendoDropDownList").As<DropDownList>();
            JsAction<Event> setValue = e =>
            {
                if (e.type != "keypress" || Kendo.keys.ENTER == e.keyCode)
                    dropdownlist.value(new jQuery("#value").val().As<JsString>());
            },
            setIndex = e =>
            {
                if (e.type != "keypress" || Kendo.keys.ENTER == e.keyCode)
                {
                    var index = int.Parse(new jQuery("#index").val().As<JsString>());
                    dropdownlist.select(index);
                }
            },
            setSearch = e =>
            {
                if (e.type != "keypress" || Kendo.keys.ENTER == e.keyCode)
                    dropdownlist.search(new jQuery("#word").val().As<JsString>());
            };

            new jQuery("#enable").click(() => dropdownlist.enable());
            new jQuery("#disable").click(() =>dropdownlist.enable(false));
            new jQuery("#open").click(() => dropdownlist.open());
            new jQuery("#close").click(() => dropdownlist.close());
            new jQuery("#getValue").click(() => HtmlContext.window.alert(dropdownlist.value()));
            new jQuery("#getText").click(() => HtmlContext.window.alert(dropdownlist.text()));
            new jQuery("#setValue").click(setValue);
            new jQuery("#value").keypress(setValue);
            new jQuery("#select").click(setIndex);
            new jQuery("#index").keypress(setIndex);
            new jQuery("#find").click(setSearch);
            new jQuery("#word").keypress(setSearch);
        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:57,代码来源:Api.cs


示例8: ViewStack

        public ViewStack(ContentLoader contentLoader, ContentParser contentParser, DomWalker domWalker, ViewChangeAnimator viewChangeAnimator)
        {
            this.contentLoader = contentLoader;
            this.contentParser = contentParser;
            this.viewChangeAnimator = viewChangeAnimator;
            this.domWalker = domWalker;

            viewFragmentStack = new JsArray<jQuery>();
        }
开发者ID:RandoriCSharp,项目名称:randori-framework,代码行数:9,代码来源:ViewStack.cs


示例9: getCachedFileList

        public JsArray<JsString> getCachedFileList()
        {
            JsArray<JsString> contentList = new JsArray<JsString>();
            foreach (JsString key in ContentCache.htmlMergedFiles)
            {
                contentList.Add(key);
            }

            return contentList;
        }
开发者ID:griffith-computing,项目名称:Randori,代码行数:10,代码来源:ContentCache.cs


示例10: getAllRandoriSelectorEntries

        public JsArray<JsString> getAllRandoriSelectorEntries()
        {
            var allEntries = new JsArray<JsString>();

            foreach (var cssSelector in hashMap) {
                allEntries.push(cssSelector);
            }

            return allEntries;
        }
开发者ID:griffith-computing,项目名称:Randori,代码行数:10,代码来源:StyleExtensionMap.cs


示例11: refreshHistory

        public void refreshHistory()
        {
            ajaxHlp.inst.SendGet("json",
                HistoryUrl.c_sHistoryPrefix + "/" + ngAppController.inst.ngUserId + "/",
                delegate(object o, JsString s, jqXHR arg3) {
                    ngHistoryItems = o.As<JsArray<ngHistoryGroupEntry>>();

                    _scope.apply();
                }, onRequestFailed);
        }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:10,代码来源:ngHistoryController.cs


示例12: Contains

 public bool Contains(JsArray<string> ngCategories, string p)
 {
     bool res = false;
     foreach (string str in ngCategories) {
         if (str == p) {
             res = true;
             break;
         }
     }
     return res;
 }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:11,代码来源:jsUtils.cs


示例13: Compile_Phase1

        private static void Compile_Phase1()
        {
            foreach (var action in BeforeCompilationFunctions)
                action();
            BeforeCompilationFunctions = new JsArray<JsAction>();
            for (var i = 0; i < JsTypes.length; i++)
            {
                var jsType = JsTypes[i];
                var fullName = jsType.fullname;
                var type = Types[fullName].As<JsType>();
                if (type == null)
                {
                    Types[fullName] = jsType;
                }
                else
                {
                    jsType.isPartial = true;
                    jsType.realType = type;
                }
                if (jsType.derivedTypes == null)
                    jsType.derivedTypes = new JsArray<JsType>();
                if (jsType.interfaces == null)
                    jsType.interfaces = new JsArray<JsType>();
                if (jsType.definition == null)
                    jsType.definition = new JsObject();

                var index = fullName.As<JsString>().lastIndexOf(".");
                if (index == -1)
                {
                    jsType.name = fullName;
                }
                else
                {
                    jsType.name = fullName.As<JsString>().substring(index + 1);
                    jsType.ns = fullName.As<JsString>().substring(0, index);
                }

                if (jsType.Kind == JsTypeKind.Enum)
                {
                    if (jsType.baseTypeName == null)
                        jsType.baseTypeName = "System.Object";
                    if (jsType.definition["ToString"] == null)
                        jsType.definition["ToString"] = new JsFunction("return this._Name;");
                }
                else if (jsType.Kind == JsTypeKind.Struct)
                {
                    if (type.baseTypeName == null)
                        type.baseTypeName = "System.ValueType";
                }

            }
        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:52,代码来源:JsCompiler.cs


示例14: contains

 public bool contains(JsArray<string> prefixes, string prefix)
 {
     bool res = false;
     foreach (string pr in prefixes)
     {
         if (pr == prefix)
         {
             res = true;
             break;
         }
     }
     return res;
 }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:13,代码来源:jsCommonUtils.cs


示例15: OnReady

        static void OnReady()
        {
            var projects = new JsArray<AutocompleteItem>
            {
                new AutocompleteItem
                {
                    value= "jquery",
                    label= "jQuery",
                    desc= "the write less, do more, JavaScript library",
                    icon= "jquery_32x32.png"
                },
                new AutocompleteItem 
                {
                    value= "jquery-ui",
                    label= "jQuery UI",
                    desc= "the official user interface library for jQuery",
                    icon= "jqueryui_32x32.png"
                },
                new AutocompleteItem 
                {
                    value = "sizzlejs",
                    label = "Sizzle JS",
                    desc = "a pure-JavaScript CSS selector engine",
                    icon = "sizzlejs_32x32.png"
                }
            };
            new jQuery("#project").autocomplete(new AutocompleteOptions
            {
                source = projects,
                focus = (e, ui) =>
                    {
                        var ui2 = ui.As<UIWithItem>();
                        new jQuery("#project").val(ui2.item.label);
                        JsContext.JsCode(" new jQuery( '#project' ).val(ui.item.label)");
                        [email protected](false);
                    },
                select = (e, ui) =>
                    {
                        new jQuery("#project").val(ui.As<UIWithItem>().item.label);
                        new jQuery("#project-id").val(ui.As<UIWithItem>().item.value);
                        new jQuery("#project-description").html(ui.As<UIWithItem>().item.As<AutocompleteItem>().desc);
                        new jQuery("#project-icon").attr("src", "images/" + ui.As<UIWithItem>().item.As<AutocompleteItem>().icon);
                        [email protected](false);
                    }
            }).data("autocomplete").As<UIWithItem>()._renderItem = (ul, item) =>

                    new jQuery("<li></li>")
                        .data("item.autocomplete", item)
                        .append("<a>" + item.label + "<br>" + item.desc + "</a>")
                        .appendTo(ul);
        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:51,代码来源:CustomData.cs


示例16: Compile_Phase2

 private static void Compile_Phase2()
 {
     for (var i = 0; i < JsTypes.length; i++)
     {
         var jsType = JsTypes[i];
         Compile_Phase2_TmpType(jsType);
     }
     foreach (var ce in JsTypes)
     {
         if (ce.cctor != null)
             ce.cctor.As<JsAction>()();
     }
     JsTypes = new JsArray<JsType>();
 }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:14,代码来源:JsCompiler.cs


示例17: buildSpinner

 void buildSpinner(SpinnerData sd)
 {
     spinnerData = sd;
     var canvas = document.getElementsByTagName("canvas")[0].As<HTMLCanvasElement>();
     ctx = canvas.getContext("2d").As<CanvasRenderingContext2D>();
     index = 0;
     degrees = spinnerData.degrees;
     degreesList = new JsArray<JsNumber>();
     for (var x = 0; x < degrees; x++)
         degreesList.push(x);
     // reset
     index = 0;
     // so I can kill it later
     canvasTimer = setInterval(draw, 1000 / degrees);
 }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:15,代码来源:Canvas.cs


示例18: SetValue

		//[JsMethod(UseNativeOverloads = true)]
		public void SetValue(object obj, object value, object[] indexes)
		{
			if (_Setter == null)
				throw new Exception("Property " + _Name + " doesn't have a setter");
			if (indexes == null || indexes.Length == 0)
			{
				_Setter.call(obj, value);
			}
			else
			{
				var arr = new JsArray(indexes);
				arr.push(value);
				_Setter.apply(obj, indexes ?? new JsArray().As<object[]>());
			}
		}
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:16,代码来源:PropertyInfo.cs


示例19: synchronousTranslate

        public override JsArray<Translation> synchronousTranslate(JsString domain, JsArray<JsString> keys)
        {
            var domainKeys = translations[domain];
            var response = new JsArray<Translation>();

            if ( domainKeys != null ) {
                for ( var i=0; i<keys.length;i++) {
                    var translation = new Translation();
                    translation.key = keys[i];
                    translation.value = domainKeys[keys[i]];
                    response.push(translation);
                }
            }

            return response;
        }
开发者ID:griffith-computing,项目名称:RandoriSampleSolution,代码行数:16,代码来源:StaticTranslator.cs


示例20: filter

        public override object filter(JsObject obj, JsObject arg)
        {
            JsArray<ngOrderEntry> res = new JsArray<ngOrderEntry>();
            int day = arg["day"].As<int>();
            JsArray<JsArray<ngOrderEntry>> allOrders = obj.As<JsArray<JsArray<ngOrderEntry>>>();
            JsArray<ngOrderEntry> tmp = allOrders[day];
            if (tmp != null && tmp.length > 0) {
                foreach (ngOrderEntry order in tmp) {
                    ngFoodItem foodItem = ngFoodController.inst.findFoodById(order.FoodId);
                    if (null != foodItem && !foodItem.isContainer) {
                        res.Add(order);
                    }
                }
            }

            return res;
        }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:17,代码来源:ngOrderFilter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# JsAstNode类代码示例发布时间:2022-05-24
下一篇:
C# JsAction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap