Example #1
0
 public IEnumerator <T> GetEnumerator()
 {
     if (notifyEnumerable != null)
     {
         return(notifyEnumerable.GetEnumerator());
     }
     return(SL.OrderBy(Source, PredicateCompiled, Comparer).GetEnumerator());
 }
Example #2
0
        public static System.Reflection.MemberInfo[] GetCachedFields(this System.Type type,
                                                                     System.Reflection.BindingFlags flags =
                                                                     System.Reflection.BindingFlags.Instance |
                                                                     System.Reflection.BindingFlags.Public |
                                                                     System.Reflection.BindingFlags.NonPublic)
        {
            if (ReflectionHelper.fieldInfoCache.TryGetValue(type, out var fieldInfos) == false)
            {
                var fieldInfosArr = Enumerable.Cast <System.Reflection.MemberInfo>(Enumerable.Where(type.GetAllFields(flags), f =>
                                                                                                    f.IsPublic == true ||
                                                                                                    Enumerable.Any(f.CustomAttributes, a => a.AttributeType == typeof(ME.ECS.Serializer.SerializeFieldAttribute)) == true));
                fieldInfosArr = Enumerable.Union(fieldInfosArr, Enumerable.Where(type.GetAllProperties(flags), f =>
                                                                                 f.CanRead == true &&
                                                                                 f.CanWrite == true &&
                                                                                 Enumerable.Any(f.CustomAttributes, a => a.AttributeType == typeof(ME.ECS.Serializer.SerializeFieldAttribute))
                                                                                 )
                                                 );

                fieldInfos = Enumerable.ToArray(Enumerable.OrderBy(fieldInfosArr, x => x.Name));
                ReflectionHelper.fieldInfoCache.Add(type, fieldInfos);
            }

            return(fieldInfos);
        }
Example #3
0
 public System.Linq.IOrderedEnumerable <T> CreateOrderedEnumerable <TKey2>(Func <T, TKey2> keySelector, IComparer <TKey2> comparer, bool descending)
 {
     return(SL.OrderBy(Source, PredicateCompiled, Comparer).CreateOrderedEnumerable(keySelector, comparer, descending));
 }
Example #4
0
 public IEnumerator <T> GetEnumerator()
 {
     return(SL.OrderBy(Source, PredicateCompiled, Comparer).GetEnumerator());
 }
Example #5
0
 /// <summary>
 /// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
 /// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
 /// </summary>
 /// <returns>
 /// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements
 /// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>.
 /// in document order
 /// </returns>
 public static IEnumerable <T> InDocumentOrder <T>(this IEnumerable <T> source) where T : XNode
 {
     return(Enumerable.OrderBy(source, n => (XNode)n, XNode.DocumentOrderComparer));
 }