private string TrySerializeNonGenericType(Type type) { using (_resourceLocker.ReadLocker) { if (_resourceLocker.Resources.BuildinHandler != null) { string serializedType = _resourceLocker.Resources.BuildinHandler.SerializeType(type); if (serializedType != null) { return(serializedType); } } } var providerEntries = new List <ProviderEntry>(_resourceLocker.Resources.ProviderNameList); foreach (ProviderEntry entry in providerEntries) { string serializedType = TypeManagerTypeHandlerPluginFacade.SerializedType(entry.ProviderName, type); if (serializedType != null) { return(serializedType); } } return(null); }
/// <summary> /// This method return true if there is type with the fullname <para>typeFullname</para> anywhere in the system. /// </summary> /// <param name="typeFullname">Full name: namespace+name. X.Y.Z where X.Y is the namespace and Z is the type.</param> /// <returns></returns> public bool HasTypeWithName(string typeFullname) { using (_resourceLocker.ReadLocker) { if (_resourceLocker.Resources.BuildinHandler != null) { return(_resourceLocker.Resources.BuildinHandler.HasTypeWithName(typeFullname)); } } var providerEntries = _resourceLocker.Resources.ProviderNameList; return(providerEntries.Any(entry => TypeManagerTypeHandlerPluginFacade.HasTypeWithName(entry.ProviderName, typeFullname))); }
private Type GetNonGenericType(string fullName) { using (_resourceLocker.ReadLocker) { if (_resourceLocker.Resources.BuildinHandler != null) { return(_resourceLocker.Resources.BuildinHandler.GetType(fullName)); } } fullName = TypeManager.FixLegasyTypeName(fullName); // This should be the first thing tried, otherwise "old" types are found in Composite.Generated.dll instead of a possible new compiled version of the type /MRJ if (!fullName.Contains(",")) { Type compositeType = typeof(Composite.Data.IData).Assembly.GetType(fullName, false); if (compositeType != null) { return(compositeType); } } List <ProviderEntry> providerEntries = new List <ProviderEntry>(_resourceLocker.Resources.ProviderNameList); foreach (ProviderEntry entry in providerEntries) { Type type = TypeManagerTypeHandlerPluginFacade.GetType(entry.ProviderName, fullName); if (type != null) { return(type); } } return(null); }