WindowsShellService Class
A IShellService implementation for the Windows shell.
public class WindowsShellService : DisposableObjectBase, IShellService, IDisposable
- Inheritance:
- object DisposableObjectBase object
- Implements:
- IShellService IDisposable
Constructors
WindowsShellService()
Initializes an instance of the class.
public WindowsShellService()
Properties
AreNamesCaseSensitive
Gets whether IShellObject names (like Name and ParsingName) are case-sensitive.
public virtual bool AreNamesCaseSensitive { get; }
Property Value
- bool:
true
if IShellObject names are case-sensitive; otherwise,false
. The default value isfalse
.
Methods
CompareObjectsUsingProperty(IShellObject, IShellObject, IShellProperty, Dictionary<IShellObject, object>)
Compares two IShellObject instances using the specified IShellProperty.
public virtual int CompareObjectsUsingProperty(IShellObject shellObject1, IShellObject shellObject2, IShellProperty shellProperty, Dictionary<IShellObject, object> shellPropertyValueCache)
Parameter | Type | Description |
---|---|---|
shellObject1 | IShellObject | The first IShellObject. |
shellObject2 | IShellObject | The second IShellObject. |
shellProperty | IShellProperty | The IShellProperty to use for comparison. |
shellPropertyValueCache | Dictionary<IShellObject, object> | The optional cache dictionary to use for improving performance when repeatedly retrieving shell object property values. |
Returns
- int:
A value indicating whether one is less than, equal to or greater than the other.
CreateObjectChildren(IShellObject)
Creates the child IShellObject collection for the specified parent IShellObject.
public virtual IList<IShellObject> CreateObjectChildren(IShellObject parentShellObject)
Parameter | Type | Description |
---|---|---|
parentShellObject | IShellObject | The parent IShellObject to examine. |
Returns
- IList<IShellObject>:
The child IShellObject collection for the specified parent IShellObject.
CreateObjectForParsingName(string)
Creates the IShellObject for the specified full parsing name (commonly the same as the file system path).
public virtual IShellObject CreateObjectForParsingName(string path)
Parameter | Type | Description |
---|---|---|
path | string | The parsing name to examine. |
Returns
- IShellObject:
The IShellObject for the specified full parsing name.
CreateProperties(IList<IShellObject>, ShellPropertyRequestKind)
Creates a collection of IShellProperty objects.
public virtual ShellPropertyCollection CreateProperties(IList<IShellObject> shellObjects, ShellPropertyRequestKind kind)
Parameter | Type | Description |
---|---|---|
shellObjects | IList<IShellObject> | One or more IShellObject objects to examine. |
kind | ShellPropertyRequestKind | The kind of properties to request. |
Returns
- ShellPropertyCollection:
A ShellPropertyCollection that contains the results.
CreateSpecialFolder(SpecialFolderKind)
Creates the IShellObject for the specified special folder kind.
public virtual IShellObject CreateSpecialFolder(SpecialFolderKind kind)
Parameter | Type | Description |
---|---|---|
kind | SpecialFolderKind | A SpecialFolderKind that indicates the special folder kind. |
Returns
- IShellObject:
The IShellObject for the specified special folder kind.
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 |
|
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
.
GetFullPath(IShellObject, string)
Returns the full path of the specified IShellObject.
public virtual string GetFullPath(IShellObject shellObject, string pathSeparator)
Parameter | Type | Description |
---|---|---|
shellObject | IShellObject | The IShellObject to examine. |
pathSeparator | string | The path separator. |
Returns
- string:
The full path of the specified IShellObject.
GetPropertyValue(IShellObject, IShellProperty)
Returns the property value on the specified IShellObject.
public virtual object GetPropertyValue(IShellObject shellObject, IShellProperty shellProperty)
Parameter | Type | Description |
---|---|---|
shellObject | IShellObject | The IShellObject to examine. |
shellProperty | IShellProperty | The IShellProperty whose value should be returned. |
Returns
- object:
The property value on the specified IShellObject.