本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
});
}
示例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;
}
示例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());
}