Example #1
0
        protected override void ParseResponseGet()
        {
            object JObj = JSONHelper.ParseJSON(JsonOutput);

            Response = JSONHelper.ParseJObject <ResponseMessages>(JObj);

            if (Response.Result == "success")
            {
                List <object> lst = JSONHelper.ParseJArray <object>(Response.Messages);

                MessageCollection = new MessageCollection();
                foreach (dynamic msg in lst)
                {
                    if (msg.type == "stream")
                    {
                        var sm = JSONHelper.ParseJObject <StreamMessage>(msg);
                        MessageCollection.Add(sm);
                    }
                    else if (msg.type == "private")
                    {
                        var pm = JSONHelper.ParseJObject <PrivateMessage>(msg);
                        MessageCollection.Add(pm);
                    }
                }
            }
            else
            {
                throw new FailedCallException(Response);
            }
        }
Example #2
0
        protected override void ParseResponsePost()
        {
            object JObj = JSONHelper.ParseJSON(JsonOutput);

            Response = JSONHelper.ParseJObject <ResponseMessages>(JObj);

            if (Response.Result == "success")
            {
            }
            else
            {
                throw new FailedCallException(Response);
            }
        }