Class JContainer
Represents a token that can contain other tokens.
Inheritance
System.Object
JContainer
Implements
System.ICloneable
System.Dynamic.IDynamicMetaObjectProvider
System.Collections.Generic.IList<
JToken>
System.Collections.Generic.ICollection<
JToken>
System.Collections.Generic.IEnumerable<
JToken>
System.ComponentModel.ITypedList
System.ComponentModel.IBindingList
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.Specialized.INotifyCollectionChanged
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Bayat.Json.Runtime.dll
Syntax
public abstract class JContainer : JToken, IJEnumerable<JToken>, IJsonLineInfo, ICloneable, IDynamicMetaObjectProvider, IList<JToken>, ICollection<JToken>, IEnumerable<JToken>, ITypedList, IBindingList, IList, ICollection, IEnumerable, INotifyCollectionChanged
Constructors
|
Improve this Doc
View Source
JContainer()
Declaration
|
Improve this Doc
View Source
JContainer(JContainer)
Declaration
public JContainer(JContainer other)
Parameters
Fields
|
Improve this Doc
View Source
_addingNew
Declaration
protected AddingNewEventHandler _addingNew
Field Value
Type |
Description |
System.ComponentModel.AddingNewEventHandler |
|
|
Improve this Doc
View Source
_collectionChanged
Declaration
protected NotifyCollectionChangedEventHandler _collectionChanged
Field Value
Type |
Description |
System.Collections.Specialized.NotifyCollectionChangedEventHandler |
|
|
Improve this Doc
View Source
_listChanged
Declaration
protected ListChangedEventHandler _listChanged
Field Value
Type |
Description |
System.ComponentModel.ListChangedEventHandler |
|
Properties
|
Improve this Doc
View Source
ChildrenTokens
Gets the container's children tokens.
Declaration
protected abstract IList<JToken> ChildrenTokens { get; }
Property Value
Type |
Description |
System.Collections.Generic.IList<JToken> |
The container's children tokens.
|
|
Improve this Doc
View Source
Count
Gets the count of child JSON tokens.
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
The count of child JSON tokens
|
|
Improve this Doc
View Source
First
Get the first child token of this token.
Declaration
public override JToken First { get; }
Property Value
Overrides
|
Improve this Doc
View Source
HasValues
Gets a value indicating whether this token has child tokens.
Declaration
public override bool HasValues { get; }
Property Value
Type |
Description |
System.Boolean |
true if this token has child values; otherwise, false .
|
Overrides
|
Improve this Doc
View Source
Last
Get the last child token of this token.
Declaration
public override JToken Last { get; }
Property Value
Overrides
Methods
|
Improve this Doc
View Source
Add(Object)
Adds the specified content as children of this JToken.
Declaration
public virtual void Add(object content)
Parameters
Type |
Name |
Description |
System.Object |
content |
The content to be added.
|
|
Improve this Doc
View Source
AddAndSkipParentCheck(JToken)
Declaration
public void AddAndSkipParentCheck(JToken token)
Parameters
Type |
Name |
Description |
JToken |
token |
|
|
Improve this Doc
View Source
AddFirst(Object)
Adds the specified content as the first children of this JToken.
Declaration
public void AddFirst(object content)
Parameters
Type |
Name |
Description |
System.Object |
content |
The content to be added.
|
|
Improve this Doc
View Source
CheckReentrancy()
Declaration
public void CheckReentrancy()
|
Improve this Doc
View Source
Children()
Returns a collection of the child tokens of this token, in document order.
Declaration
public override JEnumerable<JToken> Children()
Returns
Type |
Description |
JEnumerable<JToken> |
An System.Collections.Generic.IEnumerable<T> of JToken containing the child tokens of this JToken, in document order.
|
Overrides
|
Improve this Doc
View Source
ClearItems()
Declaration
public virtual void ClearItems()
|
Improve this Doc
View Source
ContainsItem(JToken)
Declaration
public virtual bool ContainsItem(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ContentsEqual(JContainer)
Declaration
public bool ContentsEqual(JContainer container)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ContentsHashCode()
Declaration
public int ContentsHashCode()
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CopyItemsTo(Array, Int32)
Declaration
public virtual void CopyItemsTo(Array array, int arrayIndex)
Parameters
Type |
Name |
Description |
System.Array |
array |
|
System.Int32 |
arrayIndex |
|
|
Improve this Doc
View Source
CreateChildrenCollection()
Declaration
protected virtual IList<JToken> CreateChildrenCollection()
Returns
Type |
Description |
System.Collections.Generic.IList<JToken> |
|
|
Improve this Doc
View Source
CreateFromContent(Object)
Declaration
public static JToken CreateFromContent(object content)
Parameters
Type |
Name |
Description |
System.Object |
content |
|
Returns
|
Improve this Doc
View Source
CreateWriter()
Declaration
public JsonWriter CreateWriter()
Returns
|
Improve this Doc
View Source
Descendants()
Returns a collection of the descendant tokens for this token in document order.
Declaration
public IEnumerable<JToken> Descendants()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<JToken> |
An System.Collections.Generic.IEnumerable<T> containing the descendant tokens of the JToken.
|
|
Improve this Doc
View Source
DescendantsAndSelf()
Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order.
Declaration
public IEnumerable<JToken> DescendantsAndSelf()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<JToken> |
An System.Collections.Generic.IEnumerable<T> containing this token, and all the descendant tokens of the JToken.
|
|
Improve this Doc
View Source
EnsureParentToken(JToken, Boolean)
Declaration
public JToken EnsureParentToken(JToken item, bool skipParentCheck)
Parameters
Type |
Name |
Description |
JToken |
item |
|
System.Boolean |
skipParentCheck |
|
Returns
|
Improve this Doc
View Source
GetDescendants(Boolean)
Declaration
public IEnumerable<JToken> GetDescendants(bool self)
Parameters
Type |
Name |
Description |
System.Boolean |
self |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<JToken> |
|
|
Improve this Doc
View Source
GetItem(Int32)
Declaration
public virtual JToken GetItem(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
|
Improve this Doc
View Source
IndexOfItem(JToken)
Declaration
public abstract int IndexOfItem(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
InsertItem(Int32, JToken, Boolean)
Declaration
public virtual void InsertItem(int index, JToken item, bool skipParentCheck)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
JToken |
item |
|
System.Boolean |
skipParentCheck |
|
|
Improve this Doc
View Source
IsMultiContent(Object)
Declaration
public bool IsMultiContent(object content)
Parameters
Type |
Name |
Description |
System.Object |
content |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsTokenUnchanged(JToken, JToken)
Declaration
public static bool IsTokenUnchanged(JToken currentValue, JToken newValue)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Merge(Object)
Merge the specified content into this JToken.
Declaration
public void Merge(object content)
Parameters
Type |
Name |
Description |
System.Object |
content |
The content to be merged.
|
|
Improve this Doc
View Source
Merge(Object, JsonMergeSettings)
Declaration
public void Merge(object content, JsonMergeSettings settings)
Parameters
|
Improve this Doc
View Source
MergeEnumerableContent(JContainer, IEnumerable, JsonMergeSettings)
Declaration
public static void MergeEnumerableContent(JContainer target, IEnumerable content, JsonMergeSettings settings)
Parameters
|
Improve this Doc
View Source
MergeItem(Object, JsonMergeSettings)
Declaration
public abstract void MergeItem(object content, JsonMergeSettings settings)
Parameters
|
Improve this Doc
View Source
OnAddingNew(AddingNewEventArgs)
Declaration
protected virtual void OnAddingNew(AddingNewEventArgs e)
Parameters
Type |
Name |
Description |
System.ComponentModel.AddingNewEventArgs |
e |
The System.ComponentModel.AddingNewEventArgs instance containing the event data.
|
|
Improve this Doc
View Source
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type |
Name |
Description |
System.Collections.Specialized.NotifyCollectionChangedEventArgs |
e |
The System.Collections.Specialized.NotifyCollectionChangedEventArgs instance containing the event data.
|
|
Improve this Doc
View Source
OnListChanged(ListChangedEventArgs)
Declaration
protected virtual void OnListChanged(ListChangedEventArgs e)
Parameters
Type |
Name |
Description |
System.ComponentModel.ListChangedEventArgs |
e |
The System.ComponentModel.ListChangedEventArgs instance containing the event data.
|
|
Improve this Doc
View Source
ReadContentFrom(JsonReader, JsonLoadSettings)
Declaration
public void ReadContentFrom(JsonReader r, JsonLoadSettings settings)
Parameters
|
Improve this Doc
View Source
ReadTokenFrom(JsonReader, JsonLoadSettings)
Declaration
public void ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
Parameters
|
Improve this Doc
View Source
RemoveAll()
Removes the child nodes from this token.
Declaration
|
Improve this Doc
View Source
RemoveItem(JToken)
Declaration
public virtual bool RemoveItem(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
RemoveItemAt(Int32)
Declaration
public virtual void RemoveItemAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
|
Improve this Doc
View Source
ReplaceAll(Object)
Replaces the children nodes of this token with the specified content.
Declaration
public void ReplaceAll(object content)
Parameters
Type |
Name |
Description |
System.Object |
content |
The content.
|
|
Improve this Doc
View Source
ReplaceItem(JToken, JToken)
Declaration
public virtual void ReplaceItem(JToken existing, JToken replacement)
Parameters
|
Improve this Doc
View Source
SetItem(Int32, JToken)
Declaration
public virtual void SetItem(int index, JToken item)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
JToken |
item |
|
|
Improve this Doc
View Source
ValidateToken(JToken, JToken)
Declaration
public virtual void ValidateToken(JToken o, JToken existing)
Parameters
|
Improve this Doc
View Source
Values<T>()
Returns a collection of the child values of this token, in document order.
Declaration
public override IEnumerable<T> Values<T>()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
A System.Collections.Generic.IEnumerable<T> containing the child values of this JToken, in document order.
|
Type Parameters
Name |
Description |
T |
The type to convert the values to.
|
Overrides
Events
|
Improve this Doc
View Source
AddingNew
Occurs before an item is added to the collection.
Declaration
public event AddingNewEventHandler AddingNew
Event Type
Type |
Description |
System.ComponentModel.AddingNewEventHandler |
|
|
Improve this Doc
View Source
CollectionChanged
Occurs when the items list of the collection has changed, or the collection is reset.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
Type |
Description |
System.Collections.Specialized.NotifyCollectionChangedEventHandler |
|
|
Improve this Doc
View Source
ListChanged
Occurs when the list changes or an item in the list changes.
Declaration
public event ListChangedEventHandler ListChanged
Event Type
Type |
Description |
System.ComponentModel.ListChangedEventHandler |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
ICollection<JToken>.Add(JToken)
Declaration
void ICollection<JToken>.Add(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
|
Improve this Doc
View Source
ICollection<JToken>.Clear()
Declaration
void ICollection<JToken>.Clear()
|
Improve this Doc
View Source
ICollection<JToken>.Contains(JToken)
Declaration
bool ICollection<JToken>.Contains(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ICollection<JToken>.CopyTo(JToken[], Int32)
Declaration
void ICollection<JToken>.CopyTo(JToken[] array, int arrayIndex)
Parameters
Type |
Name |
Description |
JToken[] |
array |
|
System.Int32 |
arrayIndex |
|
|
Improve this Doc
View Source
ICollection<JToken>.IsReadOnly
Declaration
bool ICollection<JToken>.IsReadOnly { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ICollection<JToken>.Remove(JToken)
Declaration
bool ICollection<JToken>.Remove(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IList<JToken>.IndexOf(JToken)
Declaration
int IList<JToken>.IndexOf(JToken item)
Parameters
Type |
Name |
Description |
JToken |
item |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IList<JToken>.Insert(Int32, JToken)
Declaration
void IList<JToken>.Insert(int index, JToken item)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
JToken |
item |
|
|
Improve this Doc
View Source
IList<JToken>.Item[Int32]
Declaration
JToken IList<JToken>.this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
|
Improve this Doc
View Source
IList<JToken>.RemoveAt(Int32)
Declaration
void IList<JToken>.RemoveAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
|
Improve this Doc
View Source
ICollection.CopyTo(Array, Int32)
Declaration
void ICollection.CopyTo(Array array, int index)
Parameters
Type |
Name |
Description |
System.Array |
array |
|
System.Int32 |
index |
|
|
Improve this Doc
View Source
ICollection.IsSynchronized
Declaration
bool ICollection.IsSynchronized { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ICollection.SyncRoot
Declaration
object ICollection.SyncRoot { get; }
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
IList.Add(Object)
Declaration
int IList.Add(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IList.Clear()
Declaration
|
Improve this Doc
View Source
IList.Contains(Object)
Declaration
bool IList.Contains(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IList.IndexOf(Object)
Declaration
int IList.IndexOf(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IList.Insert(Int32, Object)
Declaration
void IList.Insert(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
|
Improve this Doc
View Source
IList.IsFixedSize
Declaration
bool IList.IsFixedSize { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IList.IsReadOnly
Declaration
bool IList.IsReadOnly { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IList.Item[Int32]
Declaration
object IList.this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
IList.Remove(Object)
Declaration
void IList.Remove(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
|
Improve this Doc
View Source
IList.RemoveAt(Int32)
Declaration
void IList.RemoveAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
|
Improve this Doc
View Source
IBindingList.AddIndex(PropertyDescriptor)
Declaration
void IBindingList.AddIndex(PropertyDescriptor property)
Parameters
Type |
Name |
Description |
System.ComponentModel.PropertyDescriptor |
property |
|
|
Improve this Doc
View Source
IBindingList.AddNew()
Declaration
object IBindingList.AddNew()
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
IBindingList.AllowEdit
Declaration
bool IBindingList.AllowEdit { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IBindingList.AllowNew
Declaration
bool IBindingList.AllowNew { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IBindingList.AllowRemove
Declaration
bool IBindingList.AllowRemove { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IBindingList.ApplySort(PropertyDescriptor, ListSortDirection)
Declaration
void IBindingList.ApplySort(PropertyDescriptor property, ListSortDirection direction)
Parameters
Type |
Name |
Description |
System.ComponentModel.PropertyDescriptor |
property |
|
System.ComponentModel.ListSortDirection |
direction |
|
|
Improve this Doc
View Source
IBindingList.Find(PropertyDescriptor, Object)
Declaration
int IBindingList.Find(PropertyDescriptor property, object key)
Parameters
Type |
Name |
Description |
System.ComponentModel.PropertyDescriptor |
property |
|
System.Object |
key |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IBindingList.IsSorted
Declaration
bool IBindingList.IsSorted { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IBindingList.RemoveIndex(PropertyDescriptor)
Declaration
void IBindingList.RemoveIndex(PropertyDescriptor property)
Parameters
Type |
Name |
Description |
System.ComponentModel.PropertyDescriptor |
property |
|
|
Improve this Doc
View Source
IBindingList.RemoveSort()
Declaration
void IBindingList.RemoveSort()
|
Improve this Doc
View Source
IBindingList.SortDirection
Declaration
ListSortDirection IBindingList.SortDirection { get; }
Returns
Type |
Description |
System.ComponentModel.ListSortDirection |
|
|
Improve this Doc
View Source
IBindingList.SortProperty
Declaration
PropertyDescriptor IBindingList.SortProperty { get; }
Returns
Type |
Description |
System.ComponentModel.PropertyDescriptor |
|
|
Improve this Doc
View Source
IBindingList.SupportsChangeNotification
Declaration
bool IBindingList.SupportsChangeNotification { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IBindingList.SupportsSearching
Declaration
bool IBindingList.SupportsSearching { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IBindingList.SupportsSorting
Declaration
bool IBindingList.SupportsSorting { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ITypedList.GetItemProperties(PropertyDescriptor[])
Declaration
PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)
Parameters
Type |
Name |
Description |
System.ComponentModel.PropertyDescriptor[] |
listAccessors |
|
Returns
Type |
Description |
System.ComponentModel.PropertyDescriptorCollection |
|
|
Improve this Doc
View Source
ITypedList.GetListName(PropertyDescriptor[])
Declaration
string ITypedList.GetListName(PropertyDescriptor[] listAccessors)
Parameters
Type |
Name |
Description |
System.ComponentModel.PropertyDescriptor[] |
listAccessors |
|
Returns
Type |
Description |
System.String |
|
Implements
System.ICloneable
System.Dynamic.IDynamicMetaObjectProvider
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.ComponentModel.ITypedList
System.ComponentModel.IBindingList
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.Specialized.INotifyCollectionChanged
Extension Methods