Table of Contents

Class ShellProperties

Namespace
Microsoft.WindowsAPICodePack.Shell.PropertySystem
Assembly
Microsoft.WindowsAPICodePack.Shell.dll

Defines a partial class that implements helper methods for retrieving Shell properties using a canonical name, property key, or a strongly-typed property. Also provides access to all the strongly-typed system properties and default properties collections.

public class ShellProperties : IDisposable
Inheritance
ShellProperties
Implements
Inherited Members

Properties

DefaultPropertyCollection

Gets the collection of all the default properties for this item.

public ShellPropertyCollection DefaultPropertyCollection { get; }

Property Value

ShellPropertyCollection

System

Gets all the properties for the system through an accessor.

public ShellProperties.PropertySystem System { get; }

Property Value

ShellProperties.PropertySystem

Methods

Dispose()

Cleans up memory

public void Dispose()

Dispose(bool)

Cleans up memory

protected virtual void Dispose(bool disposed)

Parameters

disposed bool

GetProperty(PropertyKey)

Returns a property available in the default property collection using the given property key.

public IShellProperty GetProperty(PropertyKey key)

Parameters

key PropertyKey

The property key.

Returns

IShellProperty

An IShellProperty.

GetProperty(string)

Returns a property available in the default property collection using the given canonical name.

public IShellProperty GetProperty(string canonicalName)

Parameters

canonicalName string

The canonical name.

Returns

IShellProperty

An IShellProperty.

GetPropertyWriter()

Returns the shell property writer used when writing multiple properties.

public ShellPropertyWriter GetPropertyWriter()

Returns

ShellPropertyWriter

A ShellPropertyWriter.

Remarks

Use the Using pattern with the returned ShellPropertyWriter or manually call the Close method on the writer to commit the changes and dispose the writer

GetProperty<T>(PropertyKey)

Returns a strongly typed property available in the default property collection using the given property key.

public ShellProperty<T> GetProperty<T>(PropertyKey key)

Parameters

key PropertyKey

The property key.

Returns

ShellProperty<T>

A strongly-typed ShellProperty for the given property key.

Type Parameters

T

The type of property to retrieve.

GetProperty<T>(string)

Returns a strongly typed property available in the default property collection using the given canonical name.

public ShellProperty<T> GetProperty<T>(string canonicalName)

Parameters

canonicalName string

The canonical name.

Returns

ShellProperty<T>

A strongly-typed ShellProperty for the given canonical name.

Type Parameters

T

The type of property to retrieve.