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


C# JsArray.Add方法代码示例

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


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

示例1: 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

示例2: filter

        public override object filter(JsObject obj, JsObject arg)
        {
            JsArray<ngFoodItem> res = new JsArray<ngFoodItem>();

            string category = arg["category"].As<JsString>();
            int day = arg["day"].As<int>();
            JsArray<JsArray<ngFoodItem>> allFoods = obj.As<JsArray<JsArray<ngFoodItem>>>();
            JsArray<ngFoodItem> items = allFoods[day];
            if (null != items) {
                foreach (ngFoodItem item in items) {
                    if ((item.Category == category) && !item.isContainer) {
                        res.Add(item);
                    }
                }
            }
            return res;
        }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:17,代码来源:ngFoodFilter.cs

示例3: 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

示例4: requestGetUsers

        private void requestGetUsers(JsAction complete)
        {
            JsService.Inst.UsersApi.GetUsers(delegate(JsArray<ngUserModel> res) {
                JsArray<ngUserModel> tmp = new JsArray<ngUserModel>();
                foreach (ngUserModel user in res) {
                    if (-1 != user.Email.As<JsString>().indexOf("darwins")) {
                        tmp.Add(user);
                    }
                }
                ngUsers = tmp;

                if (null != complete) {
                    complete();
                }
            });
        }
开发者ID:mgerasika,项目名称:gam-gam,代码行数:16,代码来源:ngMoneyController.cs

示例5: TranslateMicrosoft

 public string TranslateMicrosoft()
 {
     string url = "http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray";
     JsArray src = new JsArray();
     src.Add(new JsAtom(sourceNew));
     string query = "from=%22ja%22&to=%22en%22&appId=%22" + UrlEncode("F84955C82256C25518548EE0C161B0BF87681F2F") + "%22&texts=" + UrlEncode(src.Serialize());
     HttpWebRequest req = CreateHTTPRequest(url + "?" + query);
     string ans = ReadAnswer(req);
     JsObject js = Json.Parse(ans);
     string result = js["0"]["TranslatedText"].ToString();
     return result;
 }
开发者ID:krysanto,项目名称:chiitrans2,代码行数:12,代码来源:Translation.cs

示例6: SaveOptions

        public void SaveOptions(string filename)
        {
            JsObject data = new JsObject();
            JsArray arr = new JsArray();
            for (int i = 0; i < translators.Count; ++i)
            {
                arr.Add(Json.Parse("{\"id\":" + translators[i].id + ", \"inUse\":" + (translators[i].inUse ? "1" : "0") + "}"));
            }
            data["translators"] = arr;

            foreach (KeyValuePair<string, ColorRecord> kvp in colors)
            {
                data["colors"].num[kvp.Key] = kvp.Value.color.ToArgb();
            }

            saveOpt(data, "wordParseMethod");
            saveOpt(data, "JDicServer");
            saveOpt(data, "alwaysOnTop");
            saveOpt(data, "checkDouble");
            saveOpt(data, "checkRepeatingPhrases");
            saveOpt(data, "checkRepeatingPhrasesAdv");
            saveOpt(data, "replaceSuffixes");
            saveOpt(data, "excludeSpeakers");
            saveOpt(data, "excludeSpeakersPattern");
            saveOpt(data, "messageDelay");
            saveOpt(data, "maxSourceLength");
            data.str["font"] = new FontConverter().ConvertToString(font);
            data.str["tooltipFont"] = new FontConverter().ConvertToString(tooltipFont);
            saveOpt(data, "translateToOtherLanguage");
            saveOpt(data, "translateLanguage");
            saveOpt(data, "noUseSecondTranslate");
            saveOpt(data, "useCache");
            saveOpt(data, "displayOriginal");
            saveOpt(data, "displayFixed");
            saveOpt(data, "bottomLayerOpacity");
            saveOpt(data, "displayReadings");
            saveOpt(data, "appendBottom");
            saveOpt(data, "dropShadow");
            saveOpt(data, "usePromt");
            saveOpt(data, "furiganaRomaji");
            saveOpt(data, "maxBlocks");
            saveOpt(data, "largeMargins");
            saveOpt(data, "marginSize");
            saveOpt(data, "hivemindServer");
            saveOpt(data, "toolbarVisible");
            saveOpt(data, "monitorNewThreads");
            saveOpt(data, "includeOkurigana");
            saveOpt(data, "clipboardMonitoring");
            saveOpt(data, "clipboardMonitoringJapanese");

            File.WriteAllText(filename, data.Serialize());
        }
开发者ID:krysanto,项目名称:chiitrans2,代码行数:52,代码来源:Options.cs


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