string IReadContext.Read(string path) { string endPath; if (path.Contains("/") == false) { endPath = path; } else { endPath = path.Split('/')[path.Split('/').Length - 1]; } IReadContext red = ToEndNode(this.context, path); ReadContextByJson rJson = (ReadContextByJson)red; JObject obj = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(rJson.context); if (obj.GetValue(endPath) == null) { return(""); } else { return(obj.GetValue(endPath).ToString()); } }
public WebHelper(string json) { ReadContext = new ReadWriteContext.ReadContextByJson(json); kv = ReadContext.ToDictionary(); }