Table of Contents

Class ShellObject

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

The base class for all Shell objects in Shell Namespace.

public abstract class ShellObject : IDisposable, IEquatable<ShellObject>
Inheritance
ShellObject
Implements
Derived
Inherited Members

Properties

IsFileSystemObject

Gets a value that determines if this ShellObject is a file system object.

public bool IsFileSystemObject { get; }

Property Value

bool

Gets a value that determines if this ShellObject is a link or shortcut.

public bool IsLink { get; }

Property Value

bool

IsPlatformSupported

Indicates whether this feature is supported on the current platform.

public static bool IsPlatformSupported { get; }

Property Value

bool

Name

Gets the normal display for this ShellItem.

public virtual string Name { get; protected set; }

Property Value

string

Parent

Gets the parent ShellObject. Returns null if the object has no parent, i.e. if this object is the Desktop folder.

public ShellObject Parent { get; }

Property Value

ShellObject

ParsingName

Gets the parsing name for this ShellItem.

public virtual string ParsingName { get; protected set; }

Property Value

string

Properties

Gets an object that allows the manipulation of ShellProperties for this shell item.

public ShellProperties Properties { get; }

Property Value

ShellProperties

Thumbnail

Gets the thumbnail of the ShellObject.

public ShellThumbnail Thumbnail { get; }

Property Value

ShellThumbnail

Methods

Dispose()

Release the native objects.

public void Dispose()

Dispose(bool)

Release the native and managed objects

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Indicates that this is being called from Dispose(), rather than the finalizer.

Equals(ShellObject)

Determines if two ShellObjects are identical.

public bool Equals(ShellObject other)

Parameters

other ShellObject

The ShellObject to comare this one to.

Returns

bool

True if the ShellObjects are equal, false otherwise.

Equals(object)

Returns whether this object is equal to another.

public override bool Equals(object obj)

Parameters

obj object

The object to compare against.

Returns

bool

Equality result.

~ShellObject()

Implement the finalizer.

protected ~ShellObject()

FromParsingName(string)

Creates a ShellObject subclass given a parsing name. For file system items, this method will only accept absolute paths.

public static ShellObject FromParsingName(string parsingName)

Parameters

parsingName string

The parsing name of the object.

Returns

ShellObject

A newly constructed ShellObject object.

GetDisplayName(DisplayNameType)

Returns the display name of the ShellFolder object. DisplayNameType represents one of the values that indicates how the name should look. See DisplayNameType for a list of possible values.

public virtual string GetDisplayName(DisplayNameType displayNameType)

Parameters

displayNameType DisplayNameType

A disaply name type.

Returns

string

A string.

GetHashCode()

Returns the hash code of the object.

public override int GetHashCode()

Returns

int

ToString()

Overrides object.ToString()

public override string ToString()

Returns

string

A string representation of the object.

Update(IBindCtx)

Updates the native shell item that maps to this shell object. This is necessary when the shell item changes after the shell object has been created. Without this method call, the retrieval of properties will return stale data.

public void Update(IBindCtx bindContext)

Parameters

bindContext IBindCtx

Bind context object

Operators

operator ==(ShellObject, ShellObject)

Implements the == (equality) operator.

public static bool operator ==(ShellObject leftShellObject, ShellObject rightShellObject)

Parameters

leftShellObject ShellObject

First object to compare.

rightShellObject ShellObject

Second object to compare.

Returns

bool

True if leftShellObject equals rightShellObject; false otherwise.

operator !=(ShellObject, ShellObject)

Implements the != (inequality) operator.

public static bool operator !=(ShellObject leftShellObject, ShellObject rightShellObject)

Parameters

leftShellObject ShellObject

First object to compare.

rightShellObject ShellObject

Second object to compare.

Returns

bool

True if leftShellObject does not equal leftShellObject; false otherwise.