Bagikan melalui


GlobalObject Constructor

Initializes a new instance of the GlobalObject class.

Namespace:  Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

'Declaration
Protected Sub New ( _
    objectType As Type, _
    objectName As String _
)
protected GlobalObject(
    Type objectType,
    string objectName
)
protected:
GlobalObject(
    Type^ objectType, 
    String^ objectName
)
new : 
        objectType:Type * 
        objectName:string -> GlobalObject
protected function GlobalObject(
    objectType : Type, 
    objectName : String
)

Parameters

  • objectType
    Type: Type

    The Type of the global object.

  • objectName
    Type: String

    A String containing the name of the global object.

Exceptions

Exception Condition
ArgumentNullException

objectType is nulla null reference (Nothing in Visual Basic).

Remarks

The GlobalObject constructor is not publicly accessible because global objects are usually created using the GetGlobalObjects method of the GlobalObjectService class. With this mechanism, you can track global objects for type changes, additions, and removals.

This constructor sets the Name property to the objectName parameter. This is the name of the object as it is displayed to the user of the design-time environment, and should follow the usual rules for identifiers. This name is filtered through the INameCreationService by the designer to ensure that it conforms to language restrictions.

.NET Framework Security

See Also

Reference

GlobalObject Class

Microsoft.VisualStudio.Shell.Design Namespace

GlobalObjectService

INameCreationService