Class ShellPropertyCollection
- Namespace
- Microsoft.WindowsAPICodePack.Shell.PropertySystem
- Assembly
- Microsoft.WindowsAPICodePack.Shell.dll
Creates a readonly collection of IProperty objects.
public class ShellPropertyCollection : ReadOnlyCollection<IShellProperty>, IList<IShellProperty>, ICollection<IShellProperty>, IList, ICollection, IReadOnlyList<IShellProperty>, IReadOnlyCollection<IShellProperty>, IEnumerable<IShellProperty>, IEnumerable, IDisposable
- Inheritance
-
ShellPropertyCollection
- Implements
- Inherited Members
Constructors
ShellPropertyCollection(ShellObject)
Creates a new Property collection given an IShellItem2 native interface
public ShellPropertyCollection(ShellObject parent)
Parameters
parent
ShellObjectParent ShellObject
ShellPropertyCollection(string)
Creates a new ShellPropertyCollection
object with the specified file or folder path.
public ShellPropertyCollection(string path)
Parameters
path
stringThe path to the file or folder.
Properties
this[PropertyKey]
Gets a property associated with the supplied property key.
public IShellProperty this[PropertyKey key] { get; }
Parameters
key
PropertyKeyThe property key.
Property Value
- IShellProperty
The property associated with the property key, if found.
Exceptions
- IndexOutOfRangeException
Throws IndexOutOfRangeException if no matching property is found.
this[string]
Gets the property associated with the supplied canonical name string. The canonical name property is case-sensitive.
public IShellProperty this[string canonicalName] { get; }
Parameters
canonicalName
stringThe canonical name.
Property Value
- IShellProperty
The property associated with the canonical name, if found.
Exceptions
- IndexOutOfRangeException
Throws IndexOutOfRangeException if no matching property is found.
Methods
Contains(PropertyKey)
public bool Contains(PropertyKey key)
Parameters
key
PropertyKey
Returns
Contains(string)
Checks if a property with the given canonical name is available.
public bool Contains(string canonicalName)
Parameters
canonicalName
stringThe canonical name of the property.
Returns
- bool
True if available, false otherwise.
Dispose()
Release the native objects.
public void Dispose()
Dispose(bool)
Release the native and managed objects
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolIndicates that this is being called from Dispose(), rather than the finalizer.
~ShellPropertyCollection()
Implement the finalizer.
protected ~ShellPropertyCollection()