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


C# JsonArray.Push方法代码示例

本文整理汇总了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;
 }
开发者ID:miracle091,项目名称:transmission-remote-dotnet,代码行数:18,代码来源:Requests.cs

示例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;
        }
开发者ID:shardick,项目名称:mettiaposto,代码行数:29,代码来源:JSONService.cs

示例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;
        }
开发者ID:GroupXTech,项目名称:Yatse2,代码行数:28,代码来源:JsonArray.cs

示例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;
        }
开发者ID:shardick,项目名称:mettiaposto,代码行数:21,代码来源:JSONService.cs


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