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

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

TypeName
FileSystemfileSystemThe file system to which the the created object belongs.
stringfullNameThe full path of the directory or file.

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

TypeName
FileSystemfileSystemThe file system with which the created object will be associated.
IFileSystemStructureLinkInfoinfoThe information about a file/directory.

Properties

Gets a value indicating whether the file/directory can be read.

public bool CanRead { get; }

Result Type: bool

Gets a value indicating whether the file/directory can be written.

public bool CanWrite { get; }

Result Type: bool

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>

Gets a value indicating whether the file/directory exists.

public bool Exists { get; }

Result Type: bool

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

public FileSystem FileSystem { get; }

Result Type: FileSystem

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

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

Gets a value indicating whether the file/directory is hidden. <returns></returns>

public bool IsHidden { get; }

Result Type: bool

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

Gets the time when the current file/directory was last modified.

public DateTime? ModifyTime { get; }

Result Type: DateTime?<DateTime>

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

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

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

public FileSystemLinkType Type { get; }

Result Type: FileSystemLinkType

Methods

Creates a watcher for file/directory associated with link.

public IFileSystemLinkWatcher CreateWatcher()

Result Type: IFileSystemLinkWatcher

Deletes the file/directory.

public void Delete()

Result Type: void

Asynchronously deletes the file/directory.

public Task DeleteAsync()

Result Type: Task

Demands a read access to the file/directory.

public void DemandReadAccess()

Result Type: void

Demands a read access to the file/directory.

public void DemandWriteAccess()

Result Type: void

public bool Equals(object obj)

Result Type: bool

Parameters

TypeName
objectobj
public int GetHashCode()

Result Type: int

Gets the information about the file/directory.

protected IFileSystemStructureLinkInfo GetInfo()

Result Type: IFileSystemStructureLinkInfo

Retrieves a relative name of directory associated with specified link.

public string GetRelativeNameTo(DirectoryLink parent)

Result Type: string

Parameters

TypeName
DirectoryLinkparentThe link to the directory

Gets a value indicating whether the current instance is parent of the``.

public bool IsParentOf(FileSystemStructureLink link)

Result Type: bool

Parameters

TypeName
FileSystemStructureLinklinkThe other link to a file/directory.

Determines whether the specified TagBites.IO.FileSystemStructureLink instances are considered equal.

public bool op_Equality(FileSystemStructureLink left, FileSystemStructureLink right)

Result Type: bool

Parameters

TypeName
FileSystemStructureLinkleftThe first object to compare.
FileSystemStructureLinkrightThe second object to compare.

Determines whether the specified TagBites.IO.FileSystemStructureLink instances are considered different.

public bool op_Inequality(FileSystemStructureLink left, FileSystemStructureLink right)

Result Type: bool

Parameters

TypeName
FileSystemStructureLinkleftThe first object to compare.
FileSystemStructureLinkrightThe second object to compare.

Refreshes the state of the file/directory.

public void Refresh()

Result Type: void

public string ToString()

Result Type: string

Updates a metadata information about the file/directory.

public void UpdateMetadata(IFileSystemLinkMetadata metadata)

Result Type: void

Parameters

TypeName
IFileSystemLinkMetadatametadataThe metadata of the directory or file.

Asynchronously updates a metadata information about the file/directory.

public Task UpdateMetadataAsync(IFileSystemLinkMetadata metadata)

Result Type: Task

Parameters

TypeName
IFileSystemLinkMetadatametadataThe metadata of the directory or file.