Example #1
0
 private IEnumerable <object> CreateObjectInstances(Type type, IWqlQuery queryObject,
                                                    IEnumerable <CimInstance> instances)
 {
     return((IEnumerable <object>)Activator.CreateInstance(
                typeof(ObjectReader <>).MakeGenericType(type),
                instances,
                this,
                queryObject,
                null));
 }
Example #2
0
            internal Enumerator(IEnumerable <CimInstance> collection, CimConnection connection, IWqlQuery queryObject,
                                Type outType)
            {
                if (queryObject == null && outType == null)
                {
                    throw new ArgumentException(
                              $"Both {nameof(queryObject)} and {nameof(outType)} cannot be null at the same time.");
                }

                _connection           = connection;
                _collection           = collection.GetEnumerator();
                _queryObject          = queryObject;
                _connectionExpression = Expression.Constant(connection);
                _outType = outType;
            }
Example #3
0
 public ObjectReader(IEnumerable <CimInstance> collection, CimConnection connection, IWqlQuery queryObject,
                     Type outType = null)
 {
     _enumerator = new Enumerator(collection, connection, queryObject, outType);
 }
Example #4
0
 public ObjectReader(IEnumerable collection, DComConnection connection, IWqlQuery queryObject,
                     Type outType = null)
 {
     _enumerator = new Enumerator(collection.Cast <ManagementObject>(), connection, queryObject, outType);
 }