Globals (General Extensibility)
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Globals Property (General Extensibility)

Visual Studio .NET 2003

Returns the Globals Object that contains add-in values that may be saved in the solution (.sln) file, the project file, or in the user's profile data.

[Visual Basic .NET]
Public ReadOnly Property Globals() As Globals
[Visual Basic 6]
Property Get Globals() As Globals
HRESULT __stdcall get_Globals(
   /* [out, retval] */ Globals** retVal
Globals Globals {get;}
[JScript .NET]
public function get Globals() : Globals

Return Value

Returns a Globals object.


The add-ins are available when the solution, project file, and so on is loaded.

Solution Globals aren't necessarily add-in created; they can also be created by macros or any other automation client.


Private objSoln As Solution

Public Property prop(ByVal somestuff As String)
      objSoln.Globals.VariableValue("SampleProp") = somestuff
      objSoln.Globals.VariablePersists("SampleProp") = True
   End Get
   Set(ByVal SampleProp)
      If Not objSoln.Globals.VariableExists("SampleProp") Then
         objSoln.Globals.VariableValue("SampleProp") = ""
         objSoln.Globals.VariablePersists("SampleProp") = True
      End If
      SampleProp = objSoln.Globals.VariableValue("SampleProp")
   End Set
End Property

See Also

AddIns Property (Solution Object)

Applies To: DTE Object | Project Object | Solution Object

© 2016 Microsoft