Td.Weixin.Public/Extra/ResultPerPage.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*******************************
 *	Author:	Dong[http://blog.tecd.pw] [mailto:techdong@hotmail.com] 欢迎交流 Q群:289147891
 *	Date:	2013-09-15 12:08:23
 *	Desc:	
 * 
*******************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Jurassic.Library;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Td.Weixin.Public.Extra
{
    public class ResultPerPage
    {
        [JsonProperty(PropertyName = "pageIdx")]
        public int PageIndex { get; set; }

        [JsonProperty(PropertyName = "pageCount")]
        public int PageCount { get; set; }

        [JsonProperty(PropertyName = "pageSize")]
        public int PageSize { get; set; }

        [JsonProperty(PropertyName = "groupsList")]
        public List<WxGroup> GroupsList { get; set; }

        [JsonProperty(PropertyName = "friendsList")]
        public List<WxUser> FriendsList { get; set; }

        [JsonProperty(PropertyName = "currentGroupId")]
        public int CurrentGroupId { get; set; }

        public static ResultPerPage FromObjectInstance(Jurassic.Library.ObjectInstance instance)
        {
            /*为了简单,省去1万地反射...*/
            var ret = new ResultPerPage();
            foreach (var pi in ret.GetType().GetProperties())
            {
                try
                {
                    var value = instance.GetPropertyValue(JsonPropertyName(pi));
                    if (pi.Name == "GroupsList")
                    {
                        var ls = value as ArrayInstance;
                        if (ls != null)
                        {
                            var wxGroups = (from ObjectInstance o in ls.ElementValues select FromObject<WxGroup>(o)).ToList();
                            pi.SetValue(ret, wxGroups, null);
                        }
                    }
                    else if (pi.Name == "FriendsList")
                    {
                        var ls = value as ArrayInstance;
                        if (ls != null)
                        {
后面还有 42 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。