PrivateComponentAttribute Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the PrivateComponentAttribute class.
public:
PrivateComponentAttribute();
public PrivateComponentAttribute ();
Public Sub New ()
Examples
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.");
}
};
// Note: Access checks must be performed at the component level to allow access
// to private components.
[assembly: ApplicationAccessControl(false,
AccessChecksLevel=AccessChecksLevelOption.ApplicationComponent)]
[PrivateComponent]
public class PrivateComponentAttribute_Example : ServicedComponent
{
public void Example()
{
// Display some output.
Console.WriteLine("Private component called successfully.");
}
}
' Note: Access checks must be performed at the component level to allow access
' to private components.
<assembly: ApplicationAccessControl(False, AccessChecksLevel := AccessChecksLevelOption.ApplicationComponent)>
<PrivateComponent()> _
Public Class PrivateComponentAttribute_Example
Inherits ServicedComponent
Public Sub Example()
' Display some output.
MsgBox("Private component called successfully.")
End Sub
End Class
Applies to
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.