Represents a Directory entry. More...
Public Member Functions | |
DirEntry (string name, DateTime modDate, FileDirEntry[] children) | |
Construct a DirEntry instance. | |
Public Member Functions inherited from FileDirEntry | |
FileDirEntry () | |
Default constructor. | |
Properties | |
override long | Length [get] |
Retrieve the size of all children of this directory. The length is calculated on the first call and cached for subsequent calls. | |
override FileDirEntry[] | Children [get] |
Retrieve the children of this node. | |
Properties inherited from FileDirEntry | |
virtual FileDirTypes | FileDirType [get, protected set] |
The type of this entry as represented by a value from the FileDirTypes enumeration. | |
virtual string | Name [get, protected set] |
The name of this entry. | |
virtual long | Length [get, protected set] |
The length in bytes of this entry. Directory entries are the sum of the length of all children. | |
virtual DateTime | WhenModified [get, protected set] |
When this entry was last modified. | |
virtual ? FileDirEntry[] | Children [get] |
The children of this entry. Is null if the entry can never have any children (that is, it isn't a container of other entries). | |
Private Attributes | |
List< FileDirEntry > | _children |
long | _length |
bool | _lengthSet |
Represents a Directory entry.
A directory entry contains 0 or more children, which can be a mix of file and directory entries.
A Directory's size is the sum of all children sizes.
Definition at line 135 of file Composite_FileDirEntry.cs.
|
inline |
Construct a DirEntry instance.
name | Name of the directory |
modDate | modification date time of the entry |
children | Array of children. Must not be null but can be empty. |
ArgumentNullException | The list of children cannot be null but can be empty. |
Definition at line 148 of file Composite_FileDirEntry.cs.
References DirEntry._children, FileDirEntry.FileDirType, FileDirEntry.Name, and FileDirEntry.WhenModified.
|
private |
Definition at line 137 of file Composite_FileDirEntry.cs.
Referenced by DirEntry.Children(), DirEntry.DirEntry(), and DirEntry.Length().
|
private |
Definition at line 138 of file Composite_FileDirEntry.cs.
Referenced by FileDirEntry.Length(), and DirEntry.Length().
|
private |
Definition at line 139 of file Composite_FileDirEntry.cs.
Referenced by DirEntry.Length().
|
get |
Retrieve the children of this node.
This is an override of the base class and uses a collection of children entries stored in the DirEntry class so the base class doesn't need to store it.
Definition at line 192 of file Composite_FileDirEntry.cs.
|
get |
Retrieve the size of all children of this directory. The length is calculated on the first call and cached for subsequent calls.
This is an override of the base class to provide different behavior.
Definition at line 167 of file Composite_FileDirEntry.cs.