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
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.