Esempio n. 1
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 }));
        }
Esempio n. 2
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[] { }));
        }
Esempio n. 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 }));
        }
Esempio n. 4
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[] { }));
        }
Esempio n. 5
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 }));
        }
Esempio n. 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 }));
        }
Esempio n. 7
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 }));
        }
Esempio n. 8
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[] { }));
        }
Esempio n. 9
0
        /// <summary>
        /// Wraps the 'Boolean Contains(T)' on the 'System.Collections.ObjectModel.ReadOnlyCollection`1' type.
        /// </summary>
        /// <param name="value">The value of the 'value' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public virtual bool Contains(T value)
        {
#if !WINDOWS_PHONE
            return(WrapperUtilities.InvokeMethodAndCast <bool>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "Boolean Contains(T)"), new object[] { value }));
#else
            return(WrapperUtilities.InvokeMethodAndCast <bool>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "System.Boolean Contains(T)"), new object[] { value }));
#endif
        }
Esempio n. 10
0
        /// <summary>
        /// Wraps the 'Int32 IndexOf(T)' on the 'System.Collections.ObjectModel.ReadOnlyCollection`1' type.
        /// </summary>
        /// <param name="value">The value of the 'value' parameter.</param>
        /// <returns>The value returned by the underlying method.</returns>
        public virtual int IndexOf(T value)
        {
#if !WINDOWS_PHONE
            return(WrapperUtilities.InvokeMethodAndCast <int>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "Int32 IndexOf(T)"), new object[] { value }));
#else
            return(WrapperUtilities.InvokeMethodAndCast <int>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "System.Int32 IndexOf(T)"), new object[] { value }));
#endif
        }
Esempio n. 11
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 }));
        }
Esempio n. 12
0
 /// <summary>
 /// Wraps the 'System.IAsyncResult BeginExecute(System.AsyncCallback, System.Object)' on the 'Microsoft.OData.Client.DataServiceQuery`1' type.
 /// </summary>
 /// <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 new virtual System.IAsyncResult BeginExecute(System.AsyncCallback callback, WrappedObject state)
 {
     return(WrapperUtilities.InvokeMethodAndCast <System.IAsyncResult>(this, AstoriaWrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "System.IAsyncResult BeginExecute(System.AsyncCallback, System.Object)"), new object[] { callback, state }));
 }
Esempio n. 13
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>)));
        }
Esempio n. 14
0
 /// <summary>
 /// Wraps the 'System.String ToString()' on the 'Microsoft.OData.Client.DataServiceQuery`1' type.
 /// </summary>
 /// <returns>The value returned by the underlying method.</returns>
 public new virtual string ToString()
 {
     return(WrapperUtilities.InvokeMethodAndCast <string>(this, AstoriaWrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "System.String ToString()"), new object[] { }));
 }
Esempio n. 15
0
 /// <summary>
 /// Wraps the 'Int32 IndexOf(T)' on the 'System.Collections.Generic.IList`1' type.
 /// </summary>
 /// <param name="item">The value of the 'item' parameter.</param>
 /// <returns>The value returned by the underlying method.</returns>
 public virtual int IndexOf(T item)
 {
     return(WrapperUtilities.InvokeMethodAndCast <int>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "Int32 IndexOf(T)"), new object[] { item }));
 }
Esempio n. 16
0
 /// <summary>
 /// Wraps the 'Boolean Contains(T)' on the 'System.Collections.ObjectModel.ReadOnlyCollection`1' type.
 /// </summary>
 /// <param name="value">The value of the 'value' parameter.</param>
 /// <returns>The value returned by the underlying method.</returns>
 public virtual bool Contains(T value)
 {
     return(WrapperUtilities.InvokeMethodAndCast <bool>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "Boolean Contains(T)"), new object[] { value }));
 }
Esempio n. 17
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()
 {
     return(WrapperUtilities.InvokeMethodAndCast <bool>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "Boolean MoveNext()"), new object[] { }));
 }
Esempio n. 18
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)));
        }
Esempio n. 19
0
 /// <summary>
 /// Wraps the 'Boolean Remove(T)' on the 'System.Collections.Generic.ICollection`1' type.
 /// </summary>
 /// <param name="item">The value of the 'item' parameter.</param>
 /// <returns>The value returned by the underlying method.</returns>
 public virtual bool Remove(T item)
 {
     return(WrapperUtilities.InvokeMethodAndCast <bool>(this, WrapperUtilities.GetMethodInfo(WrappedObjectType, MethodInfoCache, "Boolean Remove(T)"), new object[] { item }));
 }