In This Article

ShellObjectWrapper Class

Provides an abstract base class that wraps another IShellObject implementation, allowing for easy customization.

public abstract class ShellObjectWrapper : ShellObjectBase, IShellObject, IDisposable
Inheritance:
object DisposableObjectBase ShellObjectBase object
Implements:
IShellObject IDisposable

Constructors

ShellObjectWrapper(IShellService, IShellObject)

Initializes an instance of the class.

protected ShellObjectWrapper(IShellService shellService, IShellObject wrappedShellObject)
Parameter Type Description
shellService IShellService

The IShellService used to return this shell object's children.

wrappedShellObject IShellObject

The IShellObject to be wrapped by this class.

Properties

AreChildrenLoaded

Indicates whether the Children collection is loaded.

public override bool AreChildrenLoaded { get; }

Property Value

bool:

true if the Children collection is loaded; otherwise, false.

Remarks

Since the Children collection is lazy-loaded when called, this property returns whether it has been loaded without triggering a load.

CanCreateChildFolder

Indicates whether the shell object can create a child folder.

public override bool CanCreateChildFolder { get; }

Property Value

bool:

true if the shell object can create a child folder; otherwise, false.

Remarks

Only shell folders can create child folders.

CanHaveChildFolders

Indicates whether the shell object may have child folders.

public override bool CanHaveChildFolders { get; }

Property Value

bool:

true if the shell object may have child folders; otherwise, false.

Remarks

Some shell objects can immediately return that they don't have any child folders, whereas others might require a query to determine if there are any.

CanRename

Indicates whether the shell object may be renamed.

public override bool CanRename { get; }

Property Value

bool:

true if the shell object may be renamed; otherwise, false.

Children

The collection of child shell objects.

public override IList<IShellObject> Children { get; }

Property Value

IList<IShellObject>

EditingName

The full user-friendly editing name of the shell object, if available.

public override string? EditingName { get; }

Property Value

string

Remarks

This value is usually the same as FileSystemPath, except that it can also return a special value to identify special shell objects.

ExtraLargeIcon

The extra-large icon.

public override ImageSource? ExtraLargeIcon { get; set; }

Property Value

ImageSource

ExtraLargeIconOverlay

The extra-large icon overlay.

public override ImageSource? ExtraLargeIconOverlay { get; set; }

Property Value

ImageSource

FileSystemPath

The file system path of the shell object, if available.

public override string? FileSystemPath { get; }

Property Value

string

IsFolder

Indicates whether the shell object is a folder, which is anything that can contain other shell objects.

public override bool IsFolder { get; }

Property Value

bool:

true if the shell object is a folder, which is anything that can contain other shell objects; otherwise, false.

Indicates whether the shell object is a link, meaning a shortcut to another shell object.

public override bool IsLink { get; }

Property Value

bool:

true if the shell object is a link, meaning a shortcut to another shell object; otherwise, false.

IsRemovable

Indicates whether the shell object is on removable media or is a removable device.

public override bool IsRemovable { get; }

Property Value

bool:

true if the shell object is on removable media or is a removable device; otherwise, false.

IsVirtual

Indicates whether the shell object is not part of the file system (files, directories, or root directories).

public override bool IsVirtual { get; }

Property Value

bool:

true if the shell object is not part of the file system (files, directories, or root directories); otherwise, false.

IsWatching

Indicates whether the shell object's tree hierarchy is currently watching for change notifications.

public override bool IsWatching { get; }

Property Value

bool:

true if the shell object's tree hierarchy is currently watching for change notifications; otherwise, false.

Kind

A ShellObjectKind that specifies the kind of this shell object.

public override ShellObjectKind Kind { get; }

Property Value

ShellObjectKind

LargeIcon

The large icon.

public override ImageSource? LargeIcon { get; set; }

Property Value

ImageSource

LargeIconOverlay

The large icon overlay.

public override ImageSource? LargeIconOverlay { get; set; }

Property Value

ImageSource

MediumIcon

The medium icon.

public override ImageSource? MediumIcon { get; set; }

Property Value

ImageSource

MediumIconOverlay

The medium icon overlay.

public override ImageSource? MediumIconOverlay { get; set; }

Property Value

ImageSource

Name

The name of the shell object.

public override string? Name { get; set; }

Property Value

string

ParsingName

The full parsing name of the shell object, if available.

public override string? ParsingName { get; }

Property Value

string

Remarks

This value is usually the same as FileSystemPath, except that it can also return a special syntax to identify special shell objects.

RelativeParsingName

The parent-relative parsing name of the shell object, if available.

public override string? RelativeParsingName { get; }

Property Value

string

Remarks

This value is usually the same as Name, except that it can also return a special syntax to identify special shell objects.

SmallIcon

The small icon.

public override ImageSource? SmallIcon { get; set; }

Property Value

ImageSource

SmallIconOverlay

The small icon overlay.

public override ImageSource? SmallIconOverlay { get; set; }

Property Value

ImageSource

SortOrder

A numeric sort order for sorting the shell object within other shell objects.

public override int SortOrder { get; set; }

Property Value

int:

A numeric sort order for sorting the shell object within other shell objects. The default value is 0.

SpecialFolderKind

A SpecialFolderKind that specifies kind of special folder represented by this shell object, if applicable.

public override SpecialFolderKind SpecialFolderKind { get; }

Property Value

SpecialFolderKind

ToolTip

The tool-tip object that is displayed for this shell object in the user interface (UI).

public override object? ToolTip { get; set; }

Property Value

object

WrappedShellObject

The IShellObject that is wrapped by this class.

public IShellObject WrappedShellObject { get; }

Property Value

IShellObject

Methods

CreateChildFolder(string)

Creates a child folder with the specified name.

public override bool CreateChildFolder(string name)
Parameter Type Description
name string

The name of the child folder.

Returns

bool:

true if the child folder was created; otherwise, false.

Remarks

Only shell folders can create child folders.

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected override void Dispose(bool disposing)
Parameter Type Description
disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the public Dispose() method and the Finalize method. Dispose invokes this method with the disposing parameter set to true. Finalize invokes this method with disposing set to false.

RefreshChildren()

Refreshes the Children collection.

public override void RefreshChildren()

StartWatching()

Starts watching the shell object's tree hierarchy for change notifications.

public override bool StartWatching()

Returns

bool:

true if the shell object is watching its tree hierarchy; otherwise, false.

Remarks

The default implementation of this method does nothing, and returns false.

StopWatching()

Stops watching the shell object's tree hierarchy for change notifications.

public override void StopWatching()

Remarks

The default implementation of this method does nothing.

Inherited Members

Extension Methods