FileSystemStructureLink
Namespace: TagBites.IO
Assembly: TagBites.IO.dll
Provides the base class for both TagBites.IO.DirectoryLink and TagBites.IO.FileLink objects.
public abstract class FileSystemStructureLink : TagBites.IO.IFileSystemLink
Constructors
FileSystemStructureLink(FileSystem, string)
Initializes a new instance of the TagBites.IO.FileSystemStructureLink class for a specified file system and full name.
protected void FileSystemStructureLink(FileSystem fileSystem, string fullName)
Result Type: void
Parameters
Type | Name | |
---|---|---|
FileSystem | fileSystem | The file system to which the the created object belongs. |
string | fullName | The full path of the directory or file. |
FileSystemStructureLink(FileSystem, IFileSystemStructureLinkInfo)
Initializes a new instance of the TagBites.IO.FileSystemStructureLink class for a specified file system using the specified information.
protected void FileSystemStructureLink(FileSystem fileSystem, IFileSystemStructureLinkInfo info)
Result Type: void
Parameters
Type | Name | |
---|---|---|
FileSystem | fileSystem | The file system with which the created object will be associated. |
IFileSystemStructureLinkInfo | info | The information about a file/directory. |
Properties
CanRead
Gets a value indicating whether the file/directory can be read.
public bool CanRead { get; }
Result Type: bool
CanWrite
Gets a value indicating whether the file/directory can be written.
public bool CanWrite { get; }
Result Type: bool
CreationTime
Gets the creation time of the file/directory. <returns>The creation time of the file/directory.</returns>
public DateTime? CreationTime { get; }
Result Type: DateTime?<DateTime>
Exists
Gets a value indicating whether the file/directory exists.
public bool Exists { get; }
Result Type: bool
ExistsAsDifferentResource
Gets a value indicating whether the current link exists is different file system link. <returns><see langword="true" /> if the current link exists is different file system link; otherwise, <see langword="false" />.</returns>
public bool ExistsAsDifferentResource { get; }
Result Type: bool
FileSystem
public FileSystem FileSystem { get; }
Result Type: FileSystem
FullName
Gets the full path of the file/directory. <returns>A System.String containing the full path of the file/directory.</returns>
public string FullName { get; }
Result Type: string
Info
Gets information about file/directory. <returns>A TagBites.IO.IFileSystemStructureLinkInfo object representing information about a file/directory.</returns>
public IFileSystemStructureLinkInfo Info { get; }
Result Type: IFileSystemStructureLinkInfo
IsHidden
Gets a value indicating whether the file/directory is hidden. <returns></returns>
public bool IsHidden { get; }
Result Type: bool
IsReadOnly
Gets a value indicating whether the file/directory is read only. <returns><see langword="true" /> if the file/directory is read only; otherwise, <see langword="false" />.</returns>
public bool IsReadOnly { get; }
Result Type: bool
ModifyTime
Gets the time when the current file/directory was last modified.
public DateTime? ModifyTime { get; }
Result Type: DateTime?<DateTime>
Name
For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the <see langword="Name" /> property gets the name of the directory.
public string Name { get; }
Result Type: string
Parent
Gets a link to a directory being parent of file/directory associated with current link. <returns>A TagBites.IO.DirectoryLink object representing a directory being parent of file/directory associated with current link.</returns>
public DirectoryLink Parent { get; }
Result Type: DirectoryLink
ParentFullName
Gets a full name of a directory being parent of file/directory associated with current link. <returns>A System.String representing a full name of a directory being parent of file/directory associated with current link.</returns>
public string ParentFullName { get; }
Result Type: string
Type
public FileSystemLinkType Type { get; }
Result Type: FileSystemLinkType
Methods
CreateWatcher()
Creates a watcher for file/directory associated with link.
public IFileSystemLinkWatcher CreateWatcher()
Result Type: IFileSystemLinkWatcher
Delete()
Deletes the file/directory.
public void Delete()
Result Type: void
DeleteAsync()
Asynchronously deletes the file/directory.
public Task DeleteAsync()
Result Type: Task
DemandReadAccess()
Demands a read access to the file/directory.
public void DemandReadAccess()
Result Type: void
DemandWriteAccess()
Demands a read access to the file/directory.
public void DemandWriteAccess()
Result Type: void
Equals(object)
public bool Equals(object obj)
Result Type: bool
Parameters
Type | Name | |
---|---|---|
object | obj |
GetHashCode()
public int GetHashCode()
Result Type: int
GetInfo()
Gets the information about the file/directory.
protected IFileSystemStructureLinkInfo GetInfo()
Result Type: IFileSystemStructureLinkInfo
GetRelativeNameTo(DirectoryLink)
Retrieves a relative name of directory associated with specified link.
public string GetRelativeNameTo(DirectoryLink parent)
Result Type: string
Parameters
Type | Name | |
---|---|---|
DirectoryLink | parent | The link to the directory |
IsParentOf(FileSystemStructureLink)
Gets a value indicating whether the current instance is parent of the``.
public bool IsParentOf(FileSystemStructureLink link)
Result Type: bool
Parameters
Type | Name | |
---|---|---|
FileSystemStructureLink | link | The other link to a file/directory. |
op_Equality(FileSystemStructureLink, FileSystemStructureLink)
Determines whether the specified TagBites.IO.FileSystemStructureLink instances are considered equal.
public bool op_Equality(FileSystemStructureLink left, FileSystemStructureLink right)
Result Type: bool
Parameters
Type | Name | |
---|---|---|
FileSystemStructureLink | left | The first object to compare. |
FileSystemStructureLink | right | The second object to compare. |
op_Inequality(FileSystemStructureLink, FileSystemStructureLink)
Determines whether the specified TagBites.IO.FileSystemStructureLink instances are considered different.
public bool op_Inequality(FileSystemStructureLink left, FileSystemStructureLink right)
Result Type: bool
Parameters
Type | Name | |
---|---|---|
FileSystemStructureLink | left | The first object to compare. |
FileSystemStructureLink | right | The second object to compare. |
Refresh()
Refreshes the state of the file/directory.
public void Refresh()
Result Type: void
ToString()
public string ToString()
Result Type: string
UpdateMetadata(IFileSystemLinkMetadata)
Updates a metadata information about the file/directory.
public void UpdateMetadata(IFileSystemLinkMetadata metadata)
Result Type: void
Parameters
Type | Name | |
---|---|---|
IFileSystemLinkMetadata | metadata | The metadata of the directory or file. |
UpdateMetadataAsync(IFileSystemLinkMetadata)
Asynchronously updates a metadata information about the file/directory.
public Task UpdateMetadataAsync(IFileSystemLinkMetadata metadata)
Result Type: Task
Parameters
Type | Name | |
---|---|---|
IFileSystemLinkMetadata | metadata | The metadata of the directory or file. |