ComVisible

You can specify which members of your classes will be visible to unmanaged (COM) clients using the ComVisible attribute, which resides in the System.Runtime.InteropServices namespace. To specify that a property or method should be visible to COM, set ComVisible to true as follows:

[ComVisible(true)]
public void DoSomething()
{
// Do something...
}

To specify that a property or method should not be visible to COM, set ComVisible to false as follows:

[ComVisible(false)]
public void DoSomething()
{
// Do something...
}

The ComVisible attribute can be applied to a class, structure, enumeration or an entire assembly. It can also be applied to any of the members of a type such as a method, property, field, interface or delegate. You can hide specific members of a type by setting the ComVisible attribute to false on that member. Public managed types in an assembly are visible (ComVisible=true) by default, so you don't have to do anything if you want all of your public managed types to be available to unmanaged consumers. Setting ComVisible to false on on an assembly hides all public types within the assembly. The ComVisible value applied to a specific type overrides the assembly setting, however. Therefore, you can expose only selected types from an assembly by setting the ComVisible attribute to false on the assembly and true on the types you want to expose. Only public types can be made visible. The ComVisible attribute cannot be used to make an internal or protected type visible to an unmanaged client.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.116.20