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

◆ GenerateProgIdForType()

static ? string System.Runtime.InteropServices.Marshal.GenerateProgIdForType ( Type type)
inlinestatic

Definition at line 1392 of file Marshal.cs.

1393 {
1394 if ((object)type == null)
1395 {
1396 throw new ArgumentNullException("type");
1397 }
1398 if (type.IsImport)
1399 {
1400 throw new ArgumentException(SR.Argument_TypeMustNotBeComImport, "type");
1401 }
1402 if (type.IsGenericType)
1403 {
1404 throw new ArgumentException(SR.Argument_NeedNonGenericType, "type");
1405 }
1406 ProgIdAttribute customAttribute = type.GetCustomAttribute<ProgIdAttribute>();
1407 if (customAttribute != null)
1408 {
1409 return customAttribute.Value ?? string.Empty;
1410 }
1411 return type.FullName;
1412 }

References System.SR.Argument_NeedNonGenericType, System.SR.Argument_TypeMustNotBeComImport, System.Attribute.GetCustomAttribute(), and System.type.