FileStreamStorage<TKey> Class

Definition

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.

generic <typename TKey>
public ref class FileStreamStorage : Microsoft::VisualStudio::PlatformUI::DisposableObject, Microsoft::VisualStudio::Utilities::IStreamStorage<TKey>, Microsoft::VisualStudio::Utilities::IStreamStorageEvents<TKey>, System::Collections::Generic::IEnumerable<TKey>
public class FileStreamStorage<TKey> : Microsoft.VisualStudio.PlatformUI.DisposableObject, Microsoft.VisualStudio.Utilities.IStreamStorage<TKey>, Microsoft.VisualStudio.Utilities.IStreamStorageEvents<TKey>, System.Collections.Generic.IEnumerable<TKey>
type FileStreamStorage<'Key> = class
    inherit DisposableObject
    interface IStreamStorage<'Key>
    interface seq<'Key>
    interface IEnumerable
    interface IStreamStorageEvents<'Key>
Public Class FileStreamStorage(Of TKey)
Inherits DisposableObject
Implements IEnumerable(Of TKey), IStreamStorage(Of TKey), IStreamStorageEvents(Of TKey)

Type Parameters

TKey

The type of the stream key

Inheritance
FileStreamStorage<TKey>
Implements

Constructors

FileStreamStorage<TKey>(IStreamStorageKeyFactory<TKey>, String, String)

Initializes a new instance of FileStreamStorage.

Fields

AllExtensions

Represents all file extensions.

Properties

EnableRaisingEvents

Controls whether events are raised when changes occur in the storage

IsDisposed

Returns whether the object has been disposed once, protects against double disposal

(Inherited from DisposableObject)
Item[TKey]

Open an existing Stream in storage for reading.

StorageFileExtension

Get or set the extension for contained files. If set to AllExtensions, the storage will recognize all files in the storage directory.

StoragePath

Get or set the Directory that will contain the stored files

Methods

Contains(TKey)

Indicates whether storage contains a Stream with the given key.

Create(TKey)

Open a new Stream for writing, adding it to storage.

Delete(TKey)

Delete from storage the Stream identified by the given key.

Dispose()

Disposes the current object then suppresses further finalization.

(Inherited from DisposableObject)
Dispose(Boolean)

Standard virtual overload for IDisposable pattern

(Inherited from DisposableObject)
DisposeManagedResources()
DisposeNativeResources()

Allows derived classes to provide custom dispose handling for native resources

(Inherited from DisposableObject)
GetEnumerator()

Get an enumerator for keys in storage.

GetStreamSize(TKey, Int64, Int64)

Gets the number of bytes actually used by an existing Stream in the storage.

GetTimestamp(TKey, TimestampKind)

Gets the timestamp for an existing Stream in the storage.

Open(TKey, StreamAccess)

Open an existing Stream in storage.

SetTimestamp(TKey, TimestampKind, DateTime)

Sets the timestamp for an existing Stream in the storage.

ThrowIfDisposed()

Throws an ObjectDisposedException if this object has been disposed

(Inherited from DisposableObject)

Events

Disposing

Raised when the event is being disposed, while it is still accessible.

(Inherited from DisposableObject)
StreamChanged

Raised when a stream is changed

StreamCreated

Raised when a stream is created

StreamDeleted

Raised when a stream is deleted

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Get an enumerator for keys in storage.

Extension Methods

EmptyIfNull<T>(IEnumerable<T>)

Applies to