ShellObjectViewModel Class
Represents a view-model wrapper for an IShellObject.
public class ShellObjectViewModel : ObservableObjectBase, INotifyPropertyChanged
- Inheritance:
- System.Object ObservableObjectBase Object
Constructors
ShellObjectViewModel(IShellObject)
Initializes a new instance of the ShellObjectViewModel class.
public ShellObjectViewModel(IShellObject shellObject)
Parameter | Type | Description |
---|---|---|
shellObject | IShellObject | The IShellObject model wrapped by this view model. |
Properties
CanCreateChildFolder
Gets whether the shell object can create a child folder.
public bool CanCreateChildFolder { get; }
Property Value
- System.Boolean:
true
if the shell object can create a child folder; otherwise,false
.
Remarks
Only shell folders can create child folders.
CanHaveChildFolders
Gets whether the shell object may have child folders.
public bool CanHaveChildFolders { get; }
Property Value
- System.Boolean:
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
Gets whether the shell object may be renamed.
public bool CanRename { get; }
Property Value
- System.Boolean:
true
if the shell object may be renamed; otherwise,false
.
CanUseThumbnails
Gets or sets whether thumbnail images can be used in place of icons when available.
public bool CanUseThumbnails { get; set; }
Property Value
- System.Boolean:
true
if thumbnail images can be used in place of icons when available; otherwise,false
. The default value isfalse
.
Children
Gets the collection of child view-models, which is initialized by an item adapter.
public IList<ShellObjectViewModel> Children { get; }
Property Value
- System.Collections.Generic.IList<ShellObjectViewModel>:
The collection of child view-models, which is initialized by an item adapter.
CreateChildFolderCommand
Gets the System.Windows.Input.ICommand used to add a new child into to an associated collection/parent.
public virtual ICommand CreateChildFolderCommand { get; }
Property Value
- System.Windows.Input.ICommand:
The System.Windows.Input.ICommand used to add a new child into to an associated collection/parent.
EditingName
Gets the full user-friendly editing name of the shell object, if available.
public string EditingName { get; }
Property Value
- System.String:
The full user-friendly editing name of the shell object, if available.
Remarks
This value is usually the same as FileSystemPath, except that it can also return a special value to identify special shell objects.
ExtraLargeIcon
Gets the extra-large icon.
public ImageSource ExtraLargeIcon { get; }
Property Value
- System.Windows.Media.ImageSource:
The extra-large icon.
ExtraLargeIconOverlay
Gets the extra-large icon overlay.
public ImageSource ExtraLargeIconOverlay { get; }
Property Value
- System.Windows.Media.ImageSource:
The extra-large icon overlay.
ExtraLargeThumbnail
Gets the extra-large thumbnail.
public ImageSource ExtraLargeThumbnail { get; }
Property Value
- System.Windows.Media.ImageSource:
The extra-large thumbnail.
FileSystemPath
Gets the file system path of the shell object, if available.
public string FileSystemPath { get; }
Property Value
- System.String:
The file system path of the shell object, if available.
HasExtraLargeThumbnail
Gets whether a ExtraLargeThumbnail is available.
public bool HasExtraLargeThumbnail { get; }
Property Value
- System.Boolean:
true
if a ExtraLargeThumbnail is available; otherwise,false
.
HasLargeThumbnail
Gets whether a LargeThumbnail is available.
public bool HasLargeThumbnail { get; }
Property Value
- System.Boolean:
true
if a LargeThumbnail is available; otherwise,false
.
HasMediumThumbnail
Gets whether a MediumThumbnail is available.
public bool HasMediumThumbnail { get; }
Property Value
- System.Boolean:
true
if a MediumThumbnail is available; otherwise,false
.
IsEditing
Gets or sets whether the node is currently being edited.
public bool IsEditing { get; set; }
Property Value
- System.Boolean:
true
if the node is currently being edited; otherwise,false
.
IsExpanded
Gets or sets whether the node is expanded.
public bool IsExpanded { get; set; }
Property Value
- System.Boolean:
true
if the node is expanded; otherwise,false
.
IsFolder
Gets whether the shell object is a folder, which is anything that can contain other shell objects.
public bool IsFolder { get; }
Property Value
- System.Boolean:
true
if the shell object is a folder, which is anything that can contain other shell objects; otherwise,false
.
IsLink
Gets whether the shell object is a link, meaning a shortcut to another shell object.
public bool IsLink { get; }
Property Value
- System.Boolean:
true
if the shell object is a link, meaning a shortcut to another shell object; otherwise,false
.
IsRemovable
Gets whether the shell object is on removable media or is a removable device.
public bool IsRemovable { get; }
Property Value
- System.Boolean:
true
if the shell object is on removable media or is a removable device; otherwise,false
.
IsSelected
Gets or sets whether the node is selected.
public bool IsSelected { get; set; }
Property Value
- System.Boolean:
true
if the node is selected; otherwise,false
.
IsVirtual
Gets whether the shell object is not part of the file system (files, directories, or root directories).
public bool IsVirtual { get; }
Property Value
- System.Boolean:
true
if the shell object is not part of the file system (files, directories, or root directories); otherwise,false
.
IsWatching
Gets whether the shell object's tree hierarchy is currently watching for change notifications.
public bool IsWatching { get; }
Property Value
- System.Boolean:
true
if the shell object's tree hierarchy is currently watching for change notifications; otherwise,false
.
Kind
Gets a ShellObjectKind that specifies the kind of this shell object.
public ShellObjectKind Kind { get; }
Property Value
- ShellObjectKind:
A ShellObjectKind that specifies the kind of this shell object.
LargeIcon
Gets the large icon.
public ImageSource LargeIcon { get; }
Property Value
- System.Windows.Media.ImageSource:
The large icon.
LargeIconOverlay
Gets the large icon overlay.
public ImageSource LargeIconOverlay { get; }
Property Value
- System.Windows.Media.ImageSource:
The large icon overlay.
LargeThumbnail
Gets the large thumbnail.
public ImageSource LargeThumbnail { get; }
Property Value
- System.Windows.Media.ImageSource:
The large thumbnail.
MediumIcon
Gets the medium icon.
public ImageSource MediumIcon { get; }
Property Value
- System.Windows.Media.ImageSource:
The medium icon.
MediumIconOverlay
Gets the medium icon overlay.
public ImageSource MediumIconOverlay { get; }
Property Value
- System.Windows.Media.ImageSource:
The medium icon overlay.
MediumThumbnail
Gets the medium thumbnail.
public ImageSource MediumThumbnail { get; }
Property Value
- System.Windows.Media.ImageSource:
The medium thumbnail.
Model
Gets the IShellObject model wrapped by this view-model.
public IShellObject Model { get; set; }
Property Value
- IShellObject:
The IShellObject model wrapped by this view-model.
Name
Gets or sets the name of the shell object.
public string Name { get; set; }
Property Value
- System.String:
The name of the shell object.
ParsingName
Gets the full parsing name of the shell object, if available.
public string ParsingName { get; }
Property Value
- System.String:
The full parsing name of the shell object, if available.
Remarks
This value is usually the same as FileSystemPath, except that it can also return a special syntax to identify special shell objects.
RelativeParsingName
Gets the parent-relative parsing name of the shell object, if available.
public string RelativeParsingName { get; }
Property Value
- System.String:
The parent-relative parsing name of the shell object, if available.
Remarks
This value is usually the same as Name, except that it can also return a special syntax to identify special shell objects.
ShellService
Gets the IShellService used to return this shell object's children.
public IShellService ShellService { get; }
Property Value
- IShellService:
The IShellService used to return this shell object's children.
SmallIcon
Gets the small icon.
public ImageSource SmallIcon { get; }
Property Value
- System.Windows.Media.ImageSource:
The small icon.
SmallIconOverlay
Gets the small icon overlay.
public ImageSource SmallIconOverlay { get; }
Property Value
- System.Windows.Media.ImageSource:
The small icon overlay.
SortOrder
Gets a numeric sort order for sorting the shell object within other shell objects.
public int SortOrder { get; }
Property Value
- System.Int32:
A numeric sort order for sorting the shell object within other shell objects. The default value is
0
.
SpecialFolderKind
Gets a SpecialFolderKind that specifies kind of special folder represented by this shell object, if applicable.
public SpecialFolderKind SpecialFolderKind { get; }
Property Value
- SpecialFolderKind:
A SpecialFolderKind that specifies kind of special folder represented by this shell object, if applicable.
Tag
Gets or sets custom data for the node.
public object Tag { get; set; }
Property Value
- System.Object:
The custom data for the node.
ToolTip
Gets the tool-tip object that is displayed for this shell object in the user interface (UI).
public object ToolTip { get; }
Property Value
- System.Object:
The tool-tip object.
Methods
CreateChildFolder(String)
Creates a child folder with the specified name.
public bool CreateChildFolder(string name)
Parameter | Type | Description |
---|---|---|
name | System.String | The name of the child folder. |
Returns
- System.Boolean:
true
if the child folder was created; otherwise,false
.
Remarks
Only shell folders can create child folders.
StartWatching()
Starts watching the shell object's tree hierarchy for change notifications.
public bool StartWatching()
Returns
- System.Boolean:
true
if the shell object is watching its tree hierarchy; otherwise,false
.
StopWatching()
Stops watching the shell object's tree hierarchy for change notifications.
public void StopWatching()
ToString()
Returns a System.String representation of this instance.
public override string ToString()
Returns
- System.String:
A System.String representation of this instance.
Inherited Members
- ObservableObjectBase.NotifyPropertyChanged(String)
- ObservableObjectBase.OnPropertyChanged(PropertyChangedEventArgs)
- ObservableObjectBase.PropertyChanged
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()