public static ProtoCore.Type GetProtoCoreType(Type type, CLRDLLModule module) { ProtoCore.Type protoCoreType; if (mTypeMaps.TryGetValue(type, out protoCoreType)) { return(protoCoreType); } if (type == typeof(object) || !CLRObjectMarshler.IsMarshaledAsNativeType(type)) { if (type.IsEnum) { protoCoreType = CLRModuleType.GetInstance(type, module, string.Empty).ProtoCoreType; } else { protoCoreType = CLRModuleType.GetInstance(type, null, string.Empty).ProtoCoreType; } } else { protoCoreType = CLRObjectMarshler.GetProtoCoreType(type); } lock (mTypeMaps) { mTypeMaps[type] = protoCoreType; } return(protoCoreType); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public override ProtoCore.Type GetMarshaledType(Type type) { return(CLRObjectMarshler.GetProtoCoreType(type)); }