예제 #1
0
        /// <summary>
        /// Gets the type for a given name of the type.
        /// </summary>
        /// <param name="typeName">Name of the type.</param>
        /// <param name="assemblyName">Name of the assembly.</param>
        /// <returns>Requested type.</returns>
        public static Type GetTypeFromAssembly(string typeName, string assemblyName)
        {
#if WINDOWS_PHONE
            Assembly assemblyWithTypes = null;
            if (String.Equals(assemblyName, "Microsoft.OData.Client", StringComparison.OrdinalIgnoreCase))
            {
                assemblyWithTypes = typeof(DataServiceContext).GetAssembly();
            }

            Type type = assemblyWithTypes.GetType(typeName, false);
            if (type == null)
            {
                type = WrapperUtilities.GetTypeFromAssembly(typeName, assemblyName);
            }

            return(type);
#else
#if WIN8
            Assembly assemblyWithTypes = null;
            if (String.Equals(assemblyName, "Microsoft.OData.Client", StringComparison.OrdinalIgnoreCase))
            {
                assemblyWithTypes = typeof(DataServiceContext).GetAssembly();
            }

            Type type = assemblyWithTypes.GetType(typeName, false);
            if (type == null)
            {
                type = WrapperUtilities.GetTypeFromAssembly(typeName, assemblyName);
            }

            return(type);
#else
            return(WrapperUtilities.GetTypeFromAssembly(typeName, assemblyName));
#endif
#endif
        }
예제 #2
0
 /// <summary>
 /// Initializes static members of the WrappedICollection class.
 /// </summary>
 static WrappedICollection()
 {
     WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Collections.ICollection", "mscorlib");
 }
예제 #3
0
 /// <summary>
 /// Initializes static members of the WrappedIDisposable class.
 /// </summary>
 static WrappedIDisposable()
 {
     WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.IDisposable", "mscorlib");
 }
예제 #4
0
 /// <summary>
 /// Initializes static members of the WrappedReadOnlyCollection class.
 /// </summary>
 static WrappedReadOnlyCollection()
 {
     WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Collections.ObjectModel.ReadOnlyCollection`1", "mscorlib");
 }
예제 #5
0
 /// <summary>
 /// Initializes static members of the WrappedIEnumerable class.
 /// </summary>
 static WrappedIEnumerable()
 {
     WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Collections.Generic.IEnumerable`1", "mscorlib");
 }
예제 #6
0
 /// <summary>
 /// Initializes static members of the WrappedIQueryProvider class.
 /// </summary>
 static WrappedIQueryProvider()
 {
     WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Linq.IQueryProvider", "System.Core");
 }
예제 #7
0
 /// <summary>
 /// Gets the type for a given name of the type.
 /// </summary>
 /// <param name="typeName">Name of the type.</param>
 /// <param name="assemblyName">Name of the assembly.</param>
 /// <returns>Requested type.</returns>
 public static Type GetTypeFromAssembly(string typeName, string assemblyName)
 {
     return(WrapperUtilities.GetTypeFromAssembly(typeName, assemblyName));
 }