Skip to content

Class WorkshopSource

Namespace: Apogee.Steam
Assembly: Apogee.Steam.dll

The Workshop items Steam installed, as a folder of mod folders for the package finder: each is listed under the id its mod.xml gives (a package's id is the name of its folder), and the files are Steam's own, read-only, where Steam put them. The list is made when the game starts, so an item installed later is found at the next start.

public sealed class WorkshopSource : IFileSource

Inheritance

object ← WorkshopSource

Implements

IFileSource

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

WorkshopSource(IEnumerable<(string ItemId, string Folder)>)

Lists the given item folders (item id and folder, as gives them).

public WorkshopSource(IEnumerable<(string ItemId, string Folder)> items)

Parameters

items IEnumerable<(string ItemId, string Folder)>

Properties

Description

What the source is, for messages: a folder's path, a zip's file name.

public string Description { get; }

Property Value

string

Methods

Kind(string)

public FileKind Kind(string path)

Parameters

path string

Returns

FileKind

List(string, List<(string Name, FileKind Kind)>)

Adds the entries directly inside directory to into: their names and kinds, in any order (a source may list entries).

public void List(string directory, List<(string Name, FileKind Kind)> into)

Parameters

directory string

into List<(string Name, FileKind Kind)>

OpenRead(string)

public Stream OpenRead(string path)

Parameters

path string

Returns

Stream

Exceptions

FileNotFoundException

There is no such file.

PhysicalPath(string)

The path in the real file system, when there is one: for watching a file or handing it to a library that wants a path.

public string? PhysicalPath(string path)

Parameters

path string

Returns

string?

ReadAllBytes(string)

public byte[] ReadAllBytes(string path)

Parameters

path string

Returns

byte[]

Exceptions

FileNotFoundException

There is no such file.