本文整理汇总了C#中Jayrock.Json.JsonArray.Push方法的典型用法代码示例。如果您正苦于以下问题:C# JsonArray.Push方法的具体用法?C# JsonArray.Push怎么用?C# JsonArray.Push使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jayrock.Json.JsonArray
的用法示例。
在下文中一共展示了JsonArray.Push方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Files
private static JsonObject Files(int id, bool includePriorities)
{
JsonObject request = CreateBasicObject(ProtocolConstants.METHOD_TORRENTGET, ResponseTag.UpdateFiles);
JsonObject arguments = GetArgObject(request);
JsonArray ids = new JsonArray();
ids.Push(id);
arguments.Put(ProtocolConstants.KEY_IDS, ids);
JsonArray fields = new JsonArray();
fields.Put(ProtocolConstants.FIELD_FILES);
fields.Put(ProtocolConstants.FIELD_ID);
if (includePriorities)
{
fields.Put(ProtocolConstants.FIELD_PRIORITIES);
fields.Put(ProtocolConstants.FIELD_WANTED);
}
arguments.Put(ProtocolConstants.KEY_FIELDS, fields);
return request;
}
示例2: SearchSignals
public JsonObject SearchSignals(JsonObject searchParams)
{
JsonArray ar = new JsonArray();
JsonObject container = new JsonObject();
int totalRecords = 0;
SignalManager sm = new SignalManager();
List<Signal> ret = (List<Signal>)sm.Search(searchParams["city"].ToString(), searchParams["address"].ToString(), searchParams["zip"].ToString(),
Convert.ToInt32(searchParams["categoryID"]), Convert.ToInt32(searchParams["status"]), Convert.ToInt32(searchParams["start"]), out totalRecords);
SignalsList s = (SignalsList)new UserControl().LoadControl("/Includes/SignalsList.ascx");
s.Populate(ret, totalRecords, 10);
container["html"] = WebUtils.RenderControlToString(s);
for (int i = 0; i < ret.Count; i++)
{
ret[i].Email = string.Empty;
JsonObject obj = new JsonObject();
obj["signal"] = ret[i];
obj["description"] = GetSignalDescription(ret[i]);
ar.Push(obj);
}
container["signals"] = ar;
return container;
}
示例3: Concat
/// <summary>
/// Returns a new array consisting of a combination of two or more
/// arrays.
/// </summary>
public virtual JsonArray Concat(params object[] values)
{
JsonArray newArray = new JsonArray(this);
if (values != null)
{
foreach (object value in values)
{
JsonArray arrayValue = value as JsonArray;
if (arrayValue != null)
{
foreach (object arrayValueValue in arrayValue)
newArray.Push(arrayValueValue);
}
else
{
newArray.Push(value);
}
}
}
return newArray;
}
示例4: GetSignalsNearby
public JsonArray GetSignalsNearby(JsonObject param)
{
CheckRequest(param["ajaxSessionKey"].ToString());
JsonArray ar = new JsonArray();
SignalManager sm = new SignalManager();
List<Signal> ret = sm.SearchNearZip(param["zip"].ToString(), Convert.ToInt32(param["signalID"]));
for (int i = 0; i < ret.Count; i++)
{
ret[i].Email = string.Empty;
JsonObject obj = new JsonObject();
obj["signal"] = ret[i];
obj["description"] = GetSignalDescription(ret[i]);
ar.Push(obj);
}
return ar;
}