protected void ReadGameInfoListObject(LitJson.JsonReader reader, object context) { GameInfoListCallbackData data = context as GameInfoListCallbackData; switch (reader.Token) { case LitJson.JsonToken.PropertyName: { string key = reader.Value.ToString(); switch (key) { case "Status": { string val = JsonReadStringPropertyRHS(reader); data.status = (ErrorCode)Enum.Parse(typeof(ErrorCode), val); break; } case "List": { reader.Read(); JsonReadArray(reader, context, this.BeginGameInfoObject, this.ReadGameInfoObject, null); break; } } break; } default: { break; } } }
public void ReaderLitJson() { _stream.Seek(0, SeekOrigin.Begin); var json = new LitJson.JsonReader(_reader); while (json.Read()) { ; } }
protected void UnityIosArchivingStateCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary <string, string> dict = new Dictionary <string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); ArchivingState state = new ArchivingState(); state.CureUrl = dict["CureUrl"]; state.RecordingEnabled = dict["RecordingEnabled"] != "0"; ArchivingStateDoneCallback(status, state); }
protected void UnityIosUserInfoCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary <string, string> dict = new Dictionary <string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); UserInfo info = new UserInfo(); info.Name = dict["Name"]; info.DisplayName = dict["DisplayName"]; UserInfoDoneCallback(status, info); }
protected void UnityIosStreamInfoCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary <string, string> dict = new Dictionary <string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); StreamInfo info = new StreamInfo(); info.Viewers = int.Parse(dict["Viewers"]); info.StreamId = UInt64.Parse(dict["Id"]); StreamInfoDoneCallback(status, info); }
protected void UnityIosRequestAuthTokenCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary <string, string> dict = new Dictionary <string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); AuthToken token = null; if (Error.Succeeded(status)) { token = new AuthToken(); token.Data = dict["Token"]; } RequestAuthTokenDoneCallback(status, token); }
static int _m_Read(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); LitJson.JsonReader gen_to_be_invoked = (LitJson.JsonReader)translator.FastGetCSObj(L, 1); { var gen_ret = gen_to_be_invoked.Read( ); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
protected void UnityIosLoginCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary <string, string> dict = new Dictionary <string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); ChannelInfo info = null; if (Error.Succeeded(status)) { info = new ChannelInfo(); info.Name = dict["Name"]; info.DisplayName = dict["DisplayName"]; info.ChannelUrl = dict["ChannelUrl"]; } LoginCallback(status, info); }
private List<xFerParamater> getParametersPassed(string inputVal) { List<xFerParamater> _params = new List<xFerParamater>(); if (inputVal.Length > 0) { string paramtext = inputVal; try { LitJson.JsonReader reader = new LitJson.JsonReader(paramtext); string name = string.Empty; object val = new object(); while (reader.Read()) { if (name != string.Empty) { val = reader.Value; _params.Add(new xFerParamater(name, val.ToString())); name = string.Empty; } else { if (reader.Token.ToString() == "PropertyName") { name = reader.Value.ToString(); } } } } catch (Exception ex) { Console.WriteLine("query parameters failed."); } } return _params; }
protected void UnityIosUserInfoCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary<string, string> dict = new Dictionary<string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); UserInfo info = new UserInfo(); info.Name = dict["Name"]; info.DisplayName = dict["DisplayName"]; UserInfoDoneCallback(status, info); }
protected void UnityIosStreamInfoCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary<string, string> dict = new Dictionary<string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); StreamInfo info = new StreamInfo(); info.Viewers = int.Parse(dict["Viewers"]); info.StreamId = UInt64.Parse(dict["Id"]); StreamInfoDoneCallback(status, info); }
protected void UnityIosRequestAuthTokenCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary<string, string> dict = new Dictionary<string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); AuthToken token = null; if (Error.Succeeded(status)) { token = new AuthToken(); token.Data = dict["Token"]; } RequestAuthTokenDoneCallback(status, token); }
protected void UnityIosLoginCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary<string, string> dict = new Dictionary<string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); ChannelInfo info = null; if (Error.Succeeded(status)) { info = new ChannelInfo(); info.Name = dict["Name"]; info.DisplayName = dict["DisplayName"]; info.ChannelUrl = dict["ChannelUrl"]; } LoginCallback(status, info); }
protected void UnityIosArchivingStateCallback(string message) { LitJson.JsonReader reader = new LitJson.JsonReader(message); Dictionary<string, string> dict = new Dictionary<string, string>(); reader.Read(); JsonReadFlatObjectIntoDictionary(reader, dict); ErrorCode status = (ErrorCode)Enum.Parse(typeof(ErrorCode), dict["Status"]); ArchivingState state = new ArchivingState(); state.CureUrl = dict["CureUrl"]; state.RecordingEnabled = dict["RecordingEnabled"] != "0"; ArchivingStateDoneCallback(status, state); }