Table of Contents

Class FileItem

Namespace
Archiver.App.Core
Assembly
Archiver.App.Core.dll

One top-level path in the pending archive-creation/extraction list, with its size and CRC-32 computed in the background. Disposing it (the row was removed) stops that work.

public sealed class FileItem : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging, IDisposable
Inheritance
FileItem
Implements
Inherited Members

Properties

Crc32

[ObservableProperty]
[ExcludeFromCodeCoverage]
public uint? Crc32 { get; set; }

Property Value

uint?

Crc32Display

[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Crc32Display { get; set; }

Property Value

string

Crc32Ready

Completes when Crc32 and Crc32Display are final (at once for a folder). Never faults: an unreadable file leaves Crc32 null.

public Task Crc32Ready { get; }

Property Value

Task

FileCount

Files in this item: 1 for a file, the folder's file count once TotalsReady completes (0 when it could not be measured).

public int FileCount { get; }

Property Value

int

FullPath

public string FullPath { get; }

Property Value

string

IsFolder

public bool IsFolder { get; }

Property Value

bool

Modified

public DateTime Modified { get; }

Property Value

DateTime

ModifiedDisplay

public string ModifiedDisplay { get; }

Property Value

string

Name

public string Name { get; }

Property Value

string

Size

[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Size { get; set; }

Property Value

string

SizeBytes

[ObservableProperty]
[ExcludeFromCodeCoverage]
public long SizeBytes { get; set; }

Property Value

long

TotalsReady

Completes when SizeBytes and FileCount are final. Never faults: a failed or stopped walk leaves SizeBytes at -1.

public Task TotalsReady { get; }

Property Value

Task

Type

public string Type { get; }

Property Value

string

Methods

Dispose()

Stops the size walk and a CRC-32 read that has not started yet.

public void Dispose()

FormatSize(long)

Formats a byte count as B/KB/MB/GB for display, in the App's language.

public static string FormatSize(long bytes)

Parameters

bytes long

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryCreate(string)

Creates the item, or returns null when path cannot be read.

public static FileItem? TryCreate(string path)

Parameters

path string

Returns

FileItem