PrivateComponentAttribute Constructor ()

 

Initializes a new instance of the PrivateComponentAttribute class.

Namespace:   System.EnterpriseServices
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

public:
PrivateComponentAttribute()

The following code example creates a new PrivateComponentAttribute.


// Note: Access checks must be performed at the component level to allow access
// to private components.
[assembly: ApplicationAccessControl(false,
AccessChecksLevel=AccessChecksLevelOption::ApplicationComponent)];

[PrivateComponent]
public ref class PrivateComponentAttributeExample : public ServicedComponent
{
public:
    void DisplayMessage()
    {
        // Display some output.
        Console::WriteLine("Private component called successfully.");
    }
};

.NET Framework
Available since 1.1
Return to top
Show: