/// <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 }
/// <summary> /// Initializes static members of the WrappedICollection class. /// </summary> static WrappedICollection() { WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Collections.ICollection", "mscorlib"); }
/// <summary> /// Initializes static members of the WrappedIDisposable class. /// </summary> static WrappedIDisposable() { WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.IDisposable", "mscorlib"); }
/// <summary> /// Initializes static members of the WrappedReadOnlyCollection class. /// </summary> static WrappedReadOnlyCollection() { WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Collections.ObjectModel.ReadOnlyCollection`1", "mscorlib"); }
/// <summary> /// Initializes static members of the WrappedIEnumerable class. /// </summary> static WrappedIEnumerable() { WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Collections.Generic.IEnumerable`1", "mscorlib"); }
/// <summary> /// Initializes static members of the WrappedIQueryProvider class. /// </summary> static WrappedIQueryProvider() { WrappedObjectType = WrapperUtilities.GetTypeFromAssembly("System.Linq.IQueryProvider", "System.Core"); }
/// <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)); }