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

◆ GetClassFactoryForType()

static object Internal.Runtime.InteropServices.ComActivator.GetClassFactoryForType ( ComActivationContext cxt)
inlinestatic

Definition at line 154 of file ComActivator.cs.

155 {
157 {
159 }
160 if (cxt.InterfaceId != typeof(IClassFactory).GUID && cxt.InterfaceId != typeof(IClassFactory2).GUID)
161 {
162 throw new NotSupportedException();
163 }
164 if (!Path.IsPathRooted(cxt.AssemblyPath))
165 {
166 throw new ArgumentException(null, "cxt");
167 }
168 Type type = FindClassType(cxt.ClassId, cxt.AssemblyPath, cxt.AssemblyName, cxt.TypeName);
169 if (LicenseInteropProxy.HasLicense(type))
170 {
171 return new LicenseClassFactory(cxt.ClassId, type);
172 }
173 return new BasicClassFactory(cxt.ClassId, type);
174 }
static Type FindClassType(Guid clsid, string assemblyPath, string assemblyName, string typeName)
static bool IsPathRooted([NotNullWhen(true)] string? path)
Definition Path.cs:985
static string NotSupported_COM
Definition SR.cs:2190
Definition SR.cs:7

References Internal.Runtime.InteropServices.ComActivator.FindClassType(), Internal.Runtime.InteropServices.LicenseInteropProxy.HasLicense(), System.Runtime.InteropServices.Marshal.IsBuiltInComSupported, System.IO.Path.IsPathRooted(), System.SR.NotSupported_COM, and System.type.

Referenced by Internal.Runtime.InteropServices.ComActivator.GetClassFactoryForTypeInternal().