Table of Contents

Class CacheNode

Namespace
ZeroInstall.Store.ViewModel
Assembly
ZeroInstall.Store.dll

Models information about elements in a cache for display in a UI.

public abstract class CacheNode : INamed, IEquatable<CacheNode>
Inheritance
CacheNode
Implements
Derived
Inherited Members

Constructors

CacheNode(string, long)

Models information about elements in a cache for display in a UI.

protected CacheNode(string path, long size)

Parameters

path string

The path of the directory.

size long

The total size of the directory in bytes.

Properties

Name

The full name of the node used for tree hierarchies.

[Browsable(false)]
public abstract string Name { get; set; }

Property Value

string

Path

The path of the directory.

public string Path { get; }

Property Value

string

Size

The total size of the directory in bytes.

[Browsable(false)]
public long Size { get; }

Property Value

long

SizeHuman

The total size of the directory in human-readable form.

public string SizeHuman { get; }

Property Value

string

SuffixCounter

A counter that can be used to prevent naming collisions.

[Browsable(false)]
public int SuffixCounter { get; }

Property Value

int

Remarks

If this value is not zero it is appended to the Name.

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(CacheNode?)

Indicates whether the current object is equal to another object of the same type.

public abstract bool Equals(CacheNode? other)

Parameters

other CacheNode

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Remove(IFeedCache?, IImplementationStore?)

Removes this element from the cache it is stored in.

public abstract void Remove(IFeedCache? feedCache = null, IImplementationStore? implementationStore = null)

Parameters

feedCache IFeedCache
implementationStore IImplementationStore

Exceptions

OperationCanceledException

The user canceled the task.

KeyNotFoundException

No matching element could be found in the cache.

IOException

The element could not be deleted.

UnauthorizedAccessException

Write access to the cache is not permitted.

ToString()

Creates string representation suitable for console output.

public override string ToString()

Returns

string