Compartilhar via


ClientContext Class

Definition

Provides functionality for accessing client context JSON blob in a structured method.

public class ClientContext : Microsoft.VisualStudio.Extensibility.Helpers.DisposableObject, Microsoft.VisualStudio.Extensibility.IClientContext, Microsoft.VisualStudio.Extensibility.IClientContextPrivate
type ClientContext = class
    inherit DisposableObject
    interface IClientContext
    interface IClientContextPrivate
Public Class ClientContext
Inherits DisposableObject
Implements IClientContext, IClientContextPrivate
Inheritance
ClientContext
Implements

Constructors

ClientContext(IReadOnlyDictionary<String,Object>, VisualStudioExtensibility)

Initializes a new instance of the ClientContext class.

ClientContext(IReadOnlyDictionary<String,String>, VisualStudioExtensibility)

Initializes a new instance of the ClientContext class.

Properties

Extensibility

Gets the extensibility instance that can be used by extension methods extending the client context.

IsDisposed

Gets a value indicating whether the object has been disposed once, protects against double disposal.

(Inherited from DisposableObject)
Item[String]

Gets the value of client context category.

ServiceBrokerClient

Gets the service broker instance that can be used by extension methods extending the client context.

Methods

AsDictionary()

Gets the context as a dictionary instance.

Dispose()

Disposes the current object then suppresses further finalization.

(Inherited from DisposableObject)
Dispose(Boolean)

Standard virtual overload for IDisposable pattern.

(Inherited from DisposableObject)
DisposeManagedResources()

Allows derived classes to provide custom dispose handling for managed resources.

DisposeNativeResources()

Allows derived classes to provide custom dispose handling for native resources.

(Inherited from DisposableObject)

Extension Methods

GetActiveTextViewAsync(IClientContext, CancellationToken)

Gets the active text view on the IDE at the time context was created.

GetSelectedPathAsync(IClientContext, CancellationToken)

Gets the selected item path on the local machine from the current workspace tree.

GetActiveProjectAsync(IClientContext, Func<IAsyncQueryable<IProjectSnapshot>,IAsyncQueryable<IProjectSnapshot>>, CancellationToken)

Gets the active project snapshot with Path and Files information and additional properties added in withModifier callback. This snapshot can be used to update the project starting with AsUpdatable extension method.

GetActiveProjectAsync(IClientContext, CancellationToken)

Gets the active project snapshot with Path information by default. This snapshot can be used to update the project starting with AsUpdatable extension method.

Applies to