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


C# JsArray类代码示例

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


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


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