Microsoft.VisualStudio.Utilities Namespace

Classes

AbstractUIThreadOperationContext

Abstract base implementation of the IUIThreadOperationContext interface.

Accelerator

Utility methods for dealing with keyboard accelerators.

AppliesToProjectAttribute

Adds AppliesTo metadata to a MEF export to indicate where this export should be applied.

ArrayBuilder<T>
BaseDefinitionAttribute

Represents a base definition of the current definition.

BitRotator

Provides helper methods for rotating bits right or left.

CommandIdAttribute

A metadata attribute identifying a Visual Studio command by its GUID and ID.

ContentTypeAttribute

Declares an association between an extension part and a particular content type.

ContentTypeDefinition

Defines a content type.

ControlDpiAwarenessException
CustomStringComparers
DefaultOrderings

Static class defining some default placeholders for the ordering attributes.

DisplayNameAttribute

Provides a display name for an editor component part.

DpiAwareness

A static helper class that contains APIs for performing various DPI scaling and context switching operations.

DynamicVisibilityAttribute

A MEF attribute indicating an attributed object supports dynamic visibility.

ExportImplementationAttribute

Along with ImportImplementationsAttribute enables MEF proxy pattern where a single component export serves as a proxy for the best implementation selected at run time. This pattern allows component consumers to just [Import] it, hiding the complexity of selecting one of implementations.

FeatureChangedEventArgs

Notifies that a specific feature changed state, and provides the new state value.

FeatureDefinition

Defines a feature which may be disabled using IFeatureService and grouped using BaseDefinitionAttribute

FeatureUpdatedEventArgs

Notifies that a specific feature was updated and might have changed its state, without computing the state value.

FileExtensionAttribute

Identifies a file extension.

FileExtensionToContentTypeDefinition

Specifies a mapping between a content type and a file extension.

FileNameAttribute

Identifies a file name.

FileStreamStorage<TKey>

A generic implementation of stream storage in the file system. Stores files in a directory. The files it recognizes and accepts for creation can be all files in the directory or only files with a specific extension.

FontColorCategory

Contains font and color information for an option category

FontColorEntry

Defines a single font & color entry in a theme category, defining the color and font style of the entry

FontColorTheme

Theme entry describing both font and color information.

GZip

Methods for compressing / decompressing a byte array using the GZip algorithm.

ImportImplementationsAttribute

Along with ExportImplementationAttribute enables MEF proxy pattern where a single component export serves as a proxy for the best implementation selected at run time. This pattern allows component consumers to just [Import] it, hiding the complexity of selecting one of implementations.

InvalidDpiException
LivingObjectRecord

Generic way to get diagnostic information about living objects wihtout a specific type T

LivingObjectRecord<T>

Generic way to get diagnostic information about living objects of a specific type T

LocalizedNameAttribute

Represents an attribute which can provide a localized name as metadata for a MEF extension.

MimeTypeAttribute

Declares an association between an extension part and a particular content type.

MonitorDpiAwarenessException
MultipleBaseMetadataAttribute

A base class for attributes that can appear multiple times on a single component part.

NameAttribute

Associates a name with an editor extension part.

ObjectPool<T>

Generic implementation of object pooling pattern with predefined pool size limit. The main purpose is that limited number of frequently used objects can be kept in the pool for further recycling.

Notes:

  1. it is not the goal to keep all returned objects. Pool is not meant for storage. If there is no space in the pool, extra returned objects will be dropped.

  2. it is implied that if object was obtained from a pool, the caller will return it back in a relatively short time. Keeping checked out objects for long durations is ok, but reduces usefulness of pooling. Just new up your own.

Not returning objects to the pool in not detrimental to the pool's work, but is a bad practice. Rationale: If there is no intent for reusing the object, do not use pool - just use "new".

OnDisposeActionDisposable

A utility class that provides an implementation of IDisposable that executes a client-supplied action upon disposal.

OptionUserModifiableAttribute

A MEF attribute determining if an option is user modifiable.

OptionUserVisibleAttribute

A MEF attribute determining if an option is visible to the user.

OrderAttribute

Orders multiple instances of an extension part.

Orderer

Performs a topological sort of orderable extension parts.

PooledDictionary<K,V>
PooledHashSet<T>
PooledStopwatch
PooledStringBuilder

The usage is: var inst = PooledStringBuilder.GetInstance(); var sb = inst.builder; ... Do Stuff... ... sb.ToString() ... inst.Free();

PredefinedEditorFeatureNames

Contains definitions for known FeatureDefinitions and their groupings.

PriorityAttribute

Represents an attribute which assigns an integer priority to a MEF component part.

PropertyCollection

Allows property owners to control the lifetimes of the properties in the collection.

ReaderWriterLockSlimWrapper

Simple wrapper for ReaderWriterLockSlim that provides helpers for entering the various modes of the lock that return disposable objects that will exit the entered mode when disposed.

The wrapped lock can be accessed via the InnerLock property.

ReusableArray<T>

Stores a reusable array. The size of the array returned can either be exactly a requested size or a buffer of at least a requested size depending on the value of the requiresExactSize parameter.

ReusableMemoryStream

Stores a reusable MemoryStream. The MemoryStream will only be stored for reuse if its Capacity does not exceed the maximumStreamCapacity used when constructing the ReusableMemoryStream.

ReusableResourceStore<TResource>

Stores a resource that requires no constructor parameters for instantiation. See ReusableResourceStoreBase for more information.

ReusableResourceStore<TResource,TConstructorParameter>

Stores a resource that requires a single constructor parameter for instantiation. See ReusableResourceStoreBase for more information.

ReusableResourceStoreBase<TResource>

Provides a base class for storing a frequently-used object that can be reused instead of reallocated, such as StringBuilders or small arrays.

ReusableStringBuilder

Represents a reusable StringBuilder. The StringBuilder is cleared after each cleanup to remove content from the previous usage.

SerializationExtensions

Provides a set of extension methods for serialization.

SimpleDynamicMemberAccessor

Allows limited dynamically typed access to instance properties.

SingletonBaseMetadataAttribute

A base class for attributes that can appear only once on a single component part.

StandardContentTypeNames
StreamAccessException

Represents an error that occured when trying to access a Stream in storage.

StreamException

Represents errors that occur when accessing Stream storage.

StreamNotFoundException

Represents the error that occurs when a Stream is not found in storage.

StreamStorageMonitor<TKey>

Monitors the size of an IStreamStorage via its IStreamStorageEvents interface. If the number of streams or the collective size of streams in the storage exceed given target thresholds, streams are deleted from the storage until the number/size of streams falls below the target thresholds.

TracedEvent

Event wrapper that keeps the history of whether the event has fired before.

Tracer

Traces different kinds of events.

TypeConversionAttribute

Marks a class exported with a MEF ExportAttribute as a conversion from one type to another.

UIThreadOperationExecutionOptions

Options that control behavior of IUIThreadOperationExecutor.

VersionedBinaryReader

Specialization of BinaryReader that reads a versioned byte stream.

VersionedBinaryWriter

Specialization of BinaryWriter that writes a versioned byte stream.

VisualDpiAwarenessException
Win32DpiAwarenessException
WindowDpiAwarenessException

Structs

ArrayBuilder<T>.Enumerator

struct enumerator used in foreach.

ColorEntry

Defines a color value to be used in font/color category entries

FontInformation

Contains information regarding font assigned to a category

Int16Size

Represents a size using Int16 values for Width/Height, meaning it occupies 4 bytes instead of the 16 bytes required for System.Windows.Size (which uses doubles for Width/Height).

This is useful in situations where an integral range of [0-32767] for Width/Height is sufficient and the space occupied by the structure is of concern.

OneOrMany<T>.Enumerator

Struct based enumerator. Just enough is implemented to satisfy the foreach pattern.

OneOrMany<T>

A collection of T that is optimized for minimal space in the case of a single element.

ProgressInfo

Represents an update of a progress.

ReusableResourceHolder<TResource>

Holds a reference to a shared resource allocated by a ReusableResourceStoreBase, and releases the resource back to the ReusableResourceStoreBase upon dispose.

Interfaces

IContentType

The content type of an object.

IContentTypeDefinition

Describes a content type that is being introduced using IContentTypeDefinitionSource.

IContentTypeDefinitionSource

Defines an alternate source for content type definitions that should be processed together with content types introduced statically using ContentTypeDefinition. This is intended primarily for legacy VS content types. This is a MEF contract type. There is no associated metadata.

IContentTypeMetadata

Represents MEF metadata view corresponding to the ContentTypeAttributes.

IContentTypeRegistryService

The service that maintains the collection of content types.

IContentTypeRegistryService2
IDecorated

Represents an object that provides a localized description text and an icon.

IFeatureController

Keeps track of requests to disable a feature using IFeatureService. Each IFeatureController may re-enable a feature it disabled, but may not re-enable a feature disabled by another IFeatureController.

IFeatureCookie

Provides O(1) read only view on the state of the feature in the IFeatureService that created this IFeatureCookie. Also exposes an event that provides notification when the state of the feature changes.

IFeatureDisableToken

Keeps track of the request to disable the feature. To restore the feature,

IFeatureService

Service that keeps track of IFeatureController's requests to disable a feature in given scope. When multiple IFeatureControllers disable a feature and one IFeatureController enables it back, it will not interfere with other disable requests, and feature will ultimately remain disabled.

While this service does have a thread affinity, its implementation does not guarantee thread safety. It is advised to change feature state from UI thread, otherwise simultaneous changes may result in race conditions.

IFeatureServiceFactory

Service that provides IFeatureServices used to track feature availability and to request feature to be disabled. Feature may be tracked by scope, using GetOrCreate(IPropertyOwner) and passing IPropertyOwner e.g. a text view. or throughout the application using GlobalFeatureService.

Features are implemented by exporting FeatureDefinition and grouped using BaseDefinitionAttribute. Grouping allows alike features to be disabling at once. Grouping also relieves IFeatureController from updating its code when new feature of appropriate category is introduced. Standard editor feature names are available in PredefinedEditorFeatureNames.

IFileExtensionRegistryService

The service that manages associations between file extensions and content types.

IFileExtensionRegistryService2

The service that manages associations between file names, extensions, and content types.

IFilePathToContentTypeProvider

MEF export to map full file names to a content type.

IFileToContentTypeService

Service for mapping files to the appropriate IContentType for that file.

IGuardedOperations

Operations that guard calls to extensions code, track performance and log errors.

IGuardedOperations2

Operations that guard calls to extensions code, track performance and log errors.

ILivingObjectDiagnostics<T>

Helper class to check if an object of Type T is considered to be collected or not and to get a quick preview of the object. Implementers of this class are not allowed to have state, otherwise they will cause a leak. Only one static object per type T of the implementation should ever exist.

IMemoryLeakTrackerService
INameAndReplacesMetadata

Represents MEF metadata view corresponding to the NameAttribute and ReplacesAttributes.

INamed

Represents an object that provides a localized display name to be used when it's being represented to the user, for example when blaming for delays.

INamedContentTypeMetadata

Represents MEF metadata view combining IContentTypeMetadata and INameAndReplacesMetadata views.

IOrderable

Associated with an orderable part.

IOrderedStreamStorage<TKey>

Interface to an ordered storage of Streams. Each stream is identified by a key, and is located at a given position (represented as an index) in storage.

IPropertyOwner

Provides ownership of an arbitrary set of properties.

IStreamStorage<TKey>

Interface to a storage of Streams. Each Stream in storage is identified by a key.

IStreamStorageEvents<TKey>

An interface that defines events to notify of changes to streams in an IStreamStorage. If a class that implements can support change notifications, it should also implement IStreamStorageEvents.

IStreamStorageKeyFactory<T>

Interface for an IStreamStorage key object factory that takes as parameter a stream name.

ITelemetryIdProvider<TId>

Represents an object that can provide a unique ID for telemetry purposes. Type of the telemetry ID.

ITracer

Provides an event tracer.

IUIThreadOperationContext

Represents a context of executing potentially long running operation on the UI thread, which enables shared two way cancellability and wait indication.

IUIThreadOperationExecutor

Executes potentially long running operation on the UI thread and provides shared two way cancellability and wait indication.

IUIThreadOperationScope

Represents a single scope of a context of executing potentially long running operation on the UI thread. Scopes allow multiple components running within an operation to share the same context.

IUIThreadOperationTimeoutController

A controller that enables and controls auto-cancellation of an operation execution by IUIThreadOperationExecutor on a timeout.

Enums

ColorEntry.ColorType
DpiAwarenessContext

Identifies the DPI awareness context for a window.

FontColorEntry.LineStyles

Line style options if entry supports line style

StreamAccess

Specifies the type of access.

TimestampKind

Describes the kind of timestamp.

UIThreadOperationStatus

Represents a status of executing a potentially long running operation on the UI thread.

Delegates

VersionedBinaryReader.MultiVersionReadCallback

Delegate that will read the body of the stream. It explicitly handles the case where actualVersion does not equal expectedVersion.

VersionedBinaryReader.ReadCallback

Delegate that will read the body of the stream.

VersionedBinaryWriter.WriteCallback

Delegate that will write the body of the stream.