示例#1
0
        List <FbStatus> parseStatus(string jsonStatusResult)
        {
            List <FbStatus> result   = new List <FbStatus>();
            JObject         jobject  = JObject.Parse(jsonStatusResult.ToString());
            JArray          statuses = (JArray)jobject["data"];

            foreach (JObject status in statuses)
            {
                string   fromId = (string)status["from"]["id"];
                string   msg    = (string)status["message"];
                DateTime dt     = DateTime.Parse((string)status["updated_time"]);
                FbStatus s      = new FbStatus()
                {
                    Status = msg, UpdateTime = dt, UserID = fromId
                };
                result.Add(s);
            }

            return(result);
        }
        List<FbStatus> parseStatus(string jsonStatusResult)
        {
            List<FbStatus> result = new List<FbStatus>();
            JObject jobject = JObject.Parse(jsonStatusResult.ToString());
            JArray statuses = (JArray)jobject["data"];
            foreach (JObject status in statuses)
            {
                string fromId = (string)status["from"]["id"];
                string msg = (string)status["message"];
                DateTime dt = DateTime.Parse((string)status["updated_time"]);
                FbStatus s = new FbStatus() { Status = msg, UpdateTime = dt, UserID=fromId };
                result.Add(s);
            }

            return result;
        }
 private static string buildStatusRecord(FbStatus status)
 {
     string statusLine = string.Format("\"{0}\",\"{1}\",\"{2}\"", status.UserID, status.UpdateTime.ToShortDateString(), FixUpDatalinesString(status.Status));
     return statusLine;
 }
        static private string buildStatusRecord(FbStatus status)
        {
            string statusLine = string.Format("\"{0}\",\"{1}\",\"{2}\"", status.UserID, status.UpdateTime.ToShortDateString(), FixUpDatalinesString(status.Status));

            return(statusLine);
        }