Пример #1
0
 internal bool Read <T>(IXReadOperation reader, XType <T> xType, XAttribute attribute, Func <object, bool> assign, XObjectArgs args) =>
 OnRead(reader, xType, attribute, assign, args);
Пример #2
0
 internal bool Read <T>(IXReadOperation reader, XType <T> xType, XElement element, Func <object, bool> assign, XObjectArgs args) =>
 OnRead(reader, xType, element, assign, args);
Пример #3
0
 /// <summary>
 /// Called when the <see cref="XReader"/> has arrived at an <see cref="XAttribute"/> expecting an object of type
 /// <typeparamref name="T"/>, but before <see cref="XTypeComponent{T}"/>s have attempted deserialization.
 /// </summary>
 /// <param name="reader">An <see cref="IXReadOperation"/> instance that exposes methods for reading XML and
 /// scheduling tasks using the active <see cref="XReader"/>.</param>
 /// <param name="xType">An <see cref="XType{T}"/> reflected from the <see cref="XDomain"/> to which this
 /// <see cref="XReader"/> belongs.</param>
 /// <param name="attribute">The <see cref="XAttribute"/> to be read.</param>
 /// <param name="assign">A delegate to perform on the deserialized <typeparamref name="T"/>. If it returns <c>false</c>,
 /// it will be added to the task queue and repeatedly attempted until it returns <c>true</c>.</param>
 /// <param name="args">Optional arguments to communicate to components how <paramref name="attribute"/> should be
 /// read.</param>
 /// <returns><c>True</c> if the <see cref="XReaderComponent"/> fully deserialized the object and all further
 /// processing of <paramref name="attribute"/> should stop.</returns>
 protected virtual bool OnRead <T>(IXReadOperation reader, XType <T> xType, XAttribute attribute, Func <object, bool> assign,
                                   XObjectArgs args) => false;
Пример #4
0
 /// <summary>
 /// Called when the <see cref="XReader"/> has arrived at an <see cref="XElement"/> expecting an object of type
 /// <typeparamref name="T"/>, but before <see cref="XTypeComponent{T}"/>s have attempted deserialization.
 /// </summary>
 /// <param name="reader">An <see cref="IXReadOperation"/> instance that exposes methods for reading XML and
 /// scheduling tasks using the active <see cref="XReader"/>.</param>
 /// <param name="xType">An <see cref="XType{T}"/> reflected from the <see cref="XDomain"/> to which this
 /// <see cref="XReader"/> belongs.</param>
 /// <param name="element">The <see cref="XElement"/> to be read.</param>
 /// <param name="assign">A delegate to perform on the deserialized <typeparamref name="T"/>. If it returns <c>false</c>,
 /// it will be added to the task queue and repeatedly attempted until it returns <c>true</c>.</param>
 /// <param name="args">Optional arguments to communicate to components how <paramref name="element"/> should be
 /// read.</param>
 /// <returns><c>True</c> if the <see cref="XReaderComponent"/> fully deserialized the object and all further
 /// processing of <paramref name="element"/> should stop.</returns>
 protected virtual bool OnRead <T>(IXReadOperation reader, XType <T> xType, XElement element, Func <object, bool> assign,
                                   XObjectArgs args) => false;
Пример #5
0
 /// <summary>
 /// <c>true</c> if and only if these <see cref="XType{TType}"/>s belong to the same <see cref="XDomain"/>.
 /// </summary>
 /// <param name="other">An <see cref="XType{T}"/> for comparison.</param>
 public bool Equals(XType <T> other) => other?.Domain == Domain;
Пример #6
0
 internal void CreateXTypeLate <T>(XType <T> xType) => ForEachComponent((comp) => comp.CreateXTypeLate(xType));