This document is archived and information here might be outdated.  Recommended version.


IServerContext.GetObject Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Server)  

IServerContext.GetObject Method

Get a reference to an object in the server context's object dictionary by its Name.

[Visual Basic .NET]
Public Function GetObject ( _
    ByVal Name As String _
) As Object
[C#]
public object GetObject (
    string Name
);
[C++]
HRESULT GetObject(
  BSTR Name
);
[C++]

Parameters Name [in]
Name is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

A context contains a dictionary that you can use as a convenient place to store objects that you create within the context. Note that this dictionary is itself valid only as long as you hold on to the server context and is emptied when you release the context. You can use this dictionary to share objects created within a context between different parts of your application that have access to the context.

SetObject adds objects to the dictionary, and GetObject  retrieves them. An object that is set in the context will be available until it is removed (by calling Remove or RemoveAll), or until the context is released.

See Also

IServerContext Interface