Exemple #1
0
        public JKeyValuePair(string key, string value, JItem parent = null) : this(parent)
        {
            Key   = new JString(key);
            Value = new JString(value, this);

            Parent = parent;
        }
        /// <param name="key">Key of the pair to find.</param>
        /// <returns>null if the key was not found.</returns>
        public JKeyValuePair DescendantPair(string key)
        {
            JString str = new JString(key);

            if (Items != null)
            {
                foreach (var item in Items)
                {
                    if (item.HasKeyOrValue())
                    {
                        if (item.ContainsKey(str))
                        {
                            return(item as JKeyValuePair);
                        }
                    }
                }
            }

            return(null);
        }
        public static JString ToJString(this string source)
        {
            JString jString = new JString(source);

            return(jString);
        }