Beispiel #1
0
        /// <summary>
        /// Wraps the 'System.Collections.IEnumerator GetEnumerator()' on the 'System.Linq.IQueryable' type.
        /// </summary>
        /// <returns>The value returned by the underlying method.</returns>
        public virtual System.Collections.IEnumerator GetEnumerator()
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Collections.IEnumerable", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "System.Collections.IEnumerator GetEnumerator()");

            return((System.Collections.IEnumerator)ProxyFactory.CreateProxyIfPossible(this.Scope, WrapperUtilities.InvokeMethodAndCast <System.Collections.IEnumerator>(this, methodInfo, new object[] { }), typeof(System.Collections.IEnumerator)));
        }
Beispiel #2
0
        /// <summary>
        /// Wraps the 'System.Linq.IQueryable`1[TElement] CreateQuery[TElement](System.Linq.Expressions.Expression)' on the 'System.Linq.IQueryProvider' type.
        /// </summary>
        /// <typeparam name="TElement">The wrapper type for the 'TElement' generic parameter.</typeparam>
        /// <param name="expression">The value of the 'expression' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public virtual System.Linq.IQueryable <TElement> CreateQuery <TElement>(System.Linq.Expressions.Expression expression)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Linq.IQueryProvider", "System.Core", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "System.Linq.IQueryable`1[TElement] CreateQuery[TElement](System.Linq.Expressions.Expression)");

            return((System.Linq.IQueryable <TElement>)ProxyFactory.CreateProxyIfPossible(this.Scope, WrapperUtilities.InvokeMethodAndCast <System.Linq.IQueryable <TElement> >(this, methodInfo, new object[] { expression }, new Type[] { typeof(TElement) }), typeof(System.Linq.IQueryable <TElement>)));
        }
Beispiel #3
0
        /// <summary>
        /// Wraps the 'System.Object Execute(System.Linq.Expressions.Expression)' on the 'System.Linq.IQueryProvider' type.
        /// </summary>
        /// <param name="expression">The value of the 'expression' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public virtual object Execute(System.Linq.Expressions.Expression expression)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Linq.IQueryProvider", "System.Core", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "System.Object Execute(System.Linq.Expressions.Expression)");

            return(WrapperUtilities.InvokeMethodAndCast <object>(this, methodInfo, new object[] { expression }));
        }
Beispiel #4
0
        /// <summary>
        /// Wraps the 'Void Write(Byte[], Int32, Int32)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="buffer">The value of the 'buffer' parameter.</param>
        /// <param name="offset">The value of the 'offset' parameter.</param>
        /// <param name="count">The value of the 'count' parameter.</param>
        public override void Write(byte[] buffer, int offset, int count)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Void Write(Byte[], Int32, Int32)");

            WrapperUtilities.InvokeMethodWithoutResult(this, methodInfo, new object[] { buffer, offset, count });
        }
Beispiel #5
0
        /// <summary>
        /// Wraps the 'Void WriteByte(Byte)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="value">The value of the 'value' parameter.</param>
        public override void WriteByte(byte value)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Void WriteByte(Byte)");

            WrapperUtilities.InvokeMethodWithoutResult(this, methodInfo, new object[] { value });
        }
Beispiel #6
0
        /// <summary>
        /// Wraps the 'Int64 Seek(Int64, System.IO.SeekOrigin)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="offset">The value of the 'offset' parameter.</param>
        /// <param name="origin">The value of the 'origin' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public override long Seek(long offset, System.IO.SeekOrigin origin)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Int64 Seek(Int64, System.IO.SeekOrigin)");

            return(WrapperUtilities.InvokeMethodAndCast <long>(this, methodInfo, new object[] { offset, origin }));
        }
Beispiel #7
0
        /// <summary>
        /// Wraps the 'System.String ToString()' on the 'System.IO.Stream' type.
        /// </summary>
        /// <returns>The value returned by the underlying method.</returns>
        public override string ToString()
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Object", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "System.String ToString()");

            return(WrapperUtilities.InvokeMethodAndCast <string>(this, methodInfo, new object[] { }));
        }
Beispiel #8
0
        /// <summary>
        /// Wraps the 'Int32 Read(Byte[], Int32, Int32)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="buffer">The value of the 'buffer' parameter.</param>
        /// <param name="offset">The value of the 'offset' parameter.</param>
        /// <param name="count">The value of the 'count' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public override int Read(byte[] buffer, int offset, int count)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Int32 Read(Byte[], Int32, Int32)");

            return(WrapperUtilities.InvokeMethodAndCast <int>(this, methodInfo, new object[] { buffer, offset, count }));
        }
Beispiel #9
0
        /// <summary>
        /// Wraps the 'Int32 ReadByte()' on the 'System.IO.Stream' type.
        /// </summary>
        /// <returns>The value returned by the underlying method.</returns>
        public override int ReadByte()
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Int32 ReadByte()");

            return(WrapperUtilities.InvokeMethodAndCast <int>(this, methodInfo, new object[] { }));
        }
Beispiel #10
0
        /// <summary>
        /// Wraps the 'Void EndWrite(System.IAsyncResult)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="asyncResult">The value of the 'asyncResult' parameter.</param>
        public override void EndWrite(System.IAsyncResult asyncResult)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Void EndWrite(System.IAsyncResult)");

            WrapperUtilities.InvokeMethodWithoutResult(this, methodInfo, new object[] { asyncResult });
        }
Beispiel #11
0
        /// <summary>
        /// Wraps the 'Boolean Equals(System.Object)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="obj">The value of the 'obj' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public override bool Equals(object obj)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Object", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Boolean Equals(System.Object)");

            return(WrapperUtilities.InvokeMethodAndCast <bool>(this, methodInfo, new object[] { obj }));
        }
Beispiel #12
0
        /// <summary>
        /// Wraps the 'System.IAsyncResult BeginWrite(Byte[], Int32, Int32, System.AsyncCallback, System.Object)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="buffer">The value of the 'buffer' parameter.</param>
        /// <param name="offset">The value of the 'offset' parameter.</param>
        /// <param name="count">The value of the 'count' parameter.</param>
        /// <param name="callback">The value of the 'callback' parameter.</param>
        /// <param name="state">The value of the 'state' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback callback, object state)
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "System.IAsyncResult BeginWrite(Byte[], Int32, Int32, System.AsyncCallback, System.Object)");

            return(WrapperUtilities.InvokeMethodAndCast <System.IAsyncResult>(this, methodInfo, new object[] { buffer, offset, count, callback, state }));
        }
Beispiel #13
0
        /// <summary>
        /// Wraps the 'Void Reset()' on the 'System.Collections.IEnumerator' type.
        /// </summary>
        public virtual void Reset()
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Collections.IEnumerator", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Void Reset()");

            WrapperUtilities.InvokeMethodWithoutResult(this, methodInfo, new object[] { });
        }
Beispiel #14
0
        /// <summary>
        /// Wraps the 'Boolean MoveNext()' on the 'System.Collections.IEnumerator' type.
        /// </summary>
        /// <returns>The value returned by the underlying method.</returns>
        public virtual bool MoveNext()
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.Collections.IEnumerator", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Boolean MoveNext()");

            return(WrapperUtilities.InvokeMethodAndCast <bool>(this, methodInfo, new object[] { }));
        }
Beispiel #15
0
        /// <summary>
        /// Wraps the 'Void Close()' on the 'System.IO.Stream' type.
        /// </summary>
        public override void Close()
        {
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "Void Close()");

            WrapperUtilities.InvokeMethodWithoutResult(this, methodInfo, new object[] { });
            this.Dispose(true);
        }
Beispiel #16
0
        /// <summary>
        /// Wraps the 'Tasks.Task`int WriteAsync(Byte[], Int32, Int32, CancellationToken)' on the 'System.IO.Stream' type.
        /// </summary>
        /// <param name="buffer">The value of the 'buffer' parameter.</param>
        /// <param name="offset">The value of the 'offset' parameter.</param>
        /// <param name="count">The value of the 'count' parameter.</param>
        /// <param name="cancellationToken">The value of the 'cancellationToken' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
        {
            // this method has been added manually - WrapperGenerator will not be able to produce this
            var type       = WrapperUtilities.GetTypeFromCache("System.IO.Stream", "mscorlib", TypeCache);
            var methodInfo = WrapperUtilities.GetMethodInfo(type, MethodInfoCache, "System.Threading.Tasks.Task WriteAsync(Byte[], Int32, Int32, System.Threading.CancellationToken)");

            return(WrapperUtilities.InvokeMethodAndCast <Task>(this, methodInfo, new object[] { buffer, offset, count, cancellationToken }));
        }