Ejemplo n.º 1
0
        /// <summary>
        /// Convert delegate 'EntityItemFilterDelegate' to 'EntityItemFilterDelegate2'
        /// </summary>
        /// <param name="del">Delegate to convert</param>
        /// <returns>A delegate of type 'EntityItemFilterDelegate2'</returns>
        public static EntityItemFilterDelegate2 <T> ConvertToMajorDelegate(EntityItemFilterDelegate <T> del)
        {
            if (del == null)
            {
                return(null);
            }

            return((e, _) => del(e));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns a list of the siblings of this entity according to the selected direction.
 /// </summary>
 /// <typeparam name="T">Type of real entity</typeparam>
 /// <param name="references">References to find siblings</param>
 /// <param name="filter">Action to filter, you can remove what you do not need</param>
 /// <param name="stop">Action to stop the search when it returns TRUE.</param>
 /// <param name="direction">Determines the direction of the search: Right, Left, or Start from the first brother</param>
 /// <param name="positionStart">Determines start position</param>
 /// <param name="positionEnd">Determines end position</param>
 /// <returns>Returns a list of siblings of this entity</returns>
 public static IEnumerable <EntityItem <T> > Siblings <T>(this IEnumerable <EntityItem <T> > references, EntityItemFilterDelegate <T> filter, EntityItemFilterDelegate <T> stop = null, SiblingDirection direction = SiblingDirection.Start, int?positionStart = null, int?positionEnd = null)
 {
     foreach (var reference in references)
     {
         foreach (var item in reference.Siblings(filter, stop, direction, positionStart, positionEnd))
         {
             yield return(item);
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns a list of the siblings of this entity according to the selected direction until stop
 /// </summary>
 /// <typeparam name="T">Type of real entity</typeparam>
 /// <param name="references">References to find siblings</param>
 /// <param name="stop">Action to stop the search when it returns TRUE.</param>
 /// <param name="filter">Action to filter, you can remove what you do not need</param>
 /// <param name="direction">Determines the direction of the search: Right, Left, or Start from the first brother</param>
 /// <returns>Returns a list of siblings of this entity</returns>
 public static IEnumerable <EntityItem <T> > SiblingsUntil <T>(this IEnumerable <EntityItem <T> > references, EntityItemFilterDelegate <T> stop, EntityItemFilterDelegate <T> filter = null, SiblingDirection direction = SiblingDirection.Start)
 {
     foreach (var reference in references)
     {
         foreach (var item in reference.SiblingsUntil(stop, filter, direction))
         {
             yield return(item);
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns descendants of this occurrence of all references simultaneously
 /// </summary>
 /// <typeparam name="T">Type of real entity</typeparam>
 /// <param name="references">References to find descendants</param>
 /// <param name="filter">Action to filter, you can remove what you do not need</param>
 /// <param name="stop">Action to stop the search when it returns TRUE</param>
 /// <param name="depthStart">Determines the initial depth. Example: depthStart = 1 returns the child of the current instance.</param>
 /// <param name="depthEnd">Determines the final depth. Example: depthStart = 1; depthEnd = 2; returns the child and grandchild of the current occurrence.</param>
 /// <returns>Returns a list of descendants</returns>
 public static IEnumerable <EntityItem <T> > Descendants <T>(this IEnumerable <EntityItem <T> > references, EntityItemFilterDelegate <T> filter, EntityItemFilterDelegate <T> stop = null, int?depthStart = null, int?depthEnd = null)
 {
     foreach (var reference in references)
     {
         foreach (var item in reference.Descendants(filter, stop, depthStart, depthEnd))
         {
             yield return(item);
         }
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns descendants of this occurrence of all references simultaneously until stop
 /// </summary>
 /// <typeparam name="T">Type of real entity</typeparam>
 /// <param name="references">References to find descendants</param>
 /// <param name="stop">Action to stop the search when it returns TRUE</param>
 /// <param name="filter">Action to filter, you can remove what you do not need</param>
 /// <returns>Returns a list of descendants</returns>
 public static IEnumerable <EntityItem <T> > DescendantsUntil <T>(this IEnumerable <EntityItem <T> > references, EntityItemFilterDelegate <T> stop, EntityItemFilterDelegate <T> filter = null)
 {
     foreach (var reference in references)
     {
         foreach (var item in reference.DescendantsUntil(stop, filter))
         {
             yield return(item);
         }
     }
 }