Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AllocateAndValidateLicense()

object Internal.Runtime.InteropServices.LicenseInteropProxy.AllocateAndValidateLicense ( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type,
string key,
bool isDesignTime )
inline

Definition at line 105 of file LicenseInteropProxy.cs.

106 {
107 object obj;
108 if (isDesignTime)
109 {
110 object[] parameters = new object[1] { type };
111 obj = _createDesignContext.Invoke(null, BindingFlags.DoNotWrapExceptions, null, parameters, null);
112 }
113 else
114 {
115 object[] parameters = new object[2] { type, key };
116 obj = _createRuntimeContext.Invoke(null, BindingFlags.DoNotWrapExceptions, null, parameters, null);
117 }
118 try
119 {
120 object[] parameters = new object[2] { type, obj };
121 return _createWithContext.Invoke(null, BindingFlags.DoNotWrapExceptions, null, parameters, null);
122 }
123 catch (Exception ex) when (ex.GetType() == s_licenseExceptionType)
124 {
125 throw new COMException(ex.Message, -2147221230);
126 }
127 }
virtual string Message
Definition Exception.cs:100
new Type GetType()
Definition Exception.cs:437
object? Invoke(object? obj, object?[]? parameters)

References Internal.Runtime.InteropServices.LicenseInteropProxy._createDesignContext, Internal.Runtime.InteropServices.LicenseInteropProxy._createRuntimeContext, Internal.Runtime.InteropServices.LicenseInteropProxy._createWithContext, System.Exception.GetType(), System.Reflection.MethodBase.Invoke(), System.key, System.Exception.Message, System.obj, Internal.Runtime.InteropServices.LicenseInteropProxy.s_licenseExceptionType, and System.type.

Referenced by Internal.Runtime.InteropServices.ComActivator.LicenseClassFactory.CreateInstanceInner().