C# Type IsImport

Description

Type IsImport gets a value indicating whether the Type has a ComImportAttribute attribute applied, indicating that it was imported from a COM type library.

Syntax

Type.IsImport has the following syntax.


public bool IsImport { get; }

Example


/*from  w  w  w  .  jav a  2  s .c  om*/
using System;
using System.Reflection;
using System.Collections.Generic;

public class Base<T, U> { }

public class Derived<V> : Base<int, V> { }

public class Test
{
    public static void Main()
    {
        Type derivedType = typeof(Derived<>);
        Console.WriteLine(derivedType.IsImport);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version