Beispiel #1
0
        /*  {
         *    get
         *    {
         *        string tempPath = "";
         *        string[] parts = XPath.Split('/');
         *
         *        string part1 = parts[2];
         *
         *        if (part1.StartsWith(@"*[name()='"))
         *        {
         *            string a = part1.Replace(@"//*[name()='", "");
         *            string b = a.Replace("']", "");
         *            part1 = "//*[local-name()='" + b.Split(':').ElementAt(1) + "']";
         *
         *
         *        }
         *
         *        for (int i = 3; i < parts.Length; i++)
         *        {
         *
         *            string[] currentParts = parts[i].Split(':');
         *            if (currentParts.Length > 1)
         *            {
         *                tempPath += "/" + currentParts[1];
         *            }
         *            else
         *            {
         *                tempPath += "/" + parts[i];
         *            }
         *
         *        }
         *
         *        return part1 + tempPath;
         *    }*/



        #endregion

        #region Constructors
        private JsonExtended(JsonExtended Parent, JToken Node)
        {
            ParentNode = Parent;

            JT = Node;

            BuildThisNode(JT.Children());
        }
Beispiel #2
0
 private void BuildThisNode(JEnumerable <JToken> JTl)
 {
     foreach (JToken XN in JTl)
     {
         JsonExtended childJsonExtended = new JsonExtended(this, XN);
         ChildNodes.Add(childJsonExtended);
     }
 }
Beispiel #3
0
 public JsonExtended(string json)
 {
     JT = JToken.Parse(json);
     ParentNode = null;
     //   XPath = Node.Name;
     JEnumerable<JToken> childList = JT.Children();
     BuildThisNode(childList);
 }
Beispiel #4
0
        public JsonExtended(string json)
        {
            JToken XD = JToken.Parse(json);

            ParentNode = null;
            //   XPath = Node.Name;
            JT = XD;

            BuildThisNode(JT.Children());
        }
Beispiel #5
0
        /*  {
         *    get
         *    {
         *        string tempPath = "";
         *        string[] parts = XPath.Split('/');
         *
         *        string part1 = parts[2];
         *
         *        if (part1.StartsWith(@"*[name()='"))
         *        {
         *            string a = part1.Replace(@"//*[name()='", "");
         *            string b = a.Replace("']", "");
         *            part1 = "//*[local-name()='" + b.Split(':').ElementAt(1) + "']";
         *
         *
         *        }
         *
         *        for (int i = 3; i < parts.Length; i++)
         *        {
         *
         *            string[] currentParts = parts[i].Split(':');
         *            if (currentParts.Length > 1)
         *            {
         *                tempPath += "/" + currentParts[1];
         *            }
         *            else
         *            {
         *                tempPath += "/" + parts[i];
         *            }
         *
         *        }
         *
         *        return part1 + tempPath;
         *    }*/



        #endregion

        #region Constructors
        private JsonExtended(JsonExtended Parent, JToken Node)
        {
            ParentNode = Parent;

            JT = Node;

            JEnumerable <JToken> childList = JT.Children();

            BuildThisNode(childList);
        }