PluginRequirements

References
public sealed class PluginRequirements
The complete set of plugins a document relied on when it was saved, stored in the GHZ file so that opening it can establish what is missing before deserialisation quietly discards every object it cannot resolve.

This supersedes the Plugins.txt entry which earlier versions wrote and which nothing ever read.

Constructors

PluginRequirements

#
Deserialisation constructor.
public PluginRequirements(
reader
)

PluginRequirements

#
Wrap a set of requirements.
public PluginRequirements(
requirements
Requirements to wrap.
)

Fields

ArchiveEntry

#
The archive entry under which requirements are stored.
public const string ArchiveEntry = "Requirements.root"

Properties

All

#
Enumerate over every recorded requirement, satisfied or not.
public IEnumerable<PluginRequirement> All { get; }

Count

#
Gets the number of recorded requirements.
public int Count { get; }

Empty

#
Gets an empty set of requirements, which is what a file written before requirements existed amounts to.
public static PluginRequirements Empty { get; }

Missing

#
Gets every requirement which no currently loaded plugin satisfies.
public PluginRequirement[] Missing { get; }

Restorable

#
Gets every missing requirement which the package server could plausibly supply. A missing core plugin is excluded, as that is a damaged installation rather than an absent download.
public PluginRequirement[] Restorable { get; }

Methods

FromDocument

#
Harvest the requirements of a document as it stands now, by asking the plugin server which plugin owns each object in it.
public static PluginRequirements FromDocument(
document,
Document to harvest.
selectedOnly
True to only consider selected objects, which matches the behaviour of a selection export.
)

FromFile

#
Read only the requirements out of a GHZ file, without deserialising the document inside it. This is what makes it affordable to check a file for missing plugins before deciding whether to open it at all.
public static PluginRequirements FromFile(
path
File to inspect.
)
The stored requirements, or an empty set when the file predates them or cannot be read.

Read

#
Read the requirements out of an archive which has already been read.
public static PluginRequirements Read(
archive
Archive to read from.
)
The stored requirements, or an empty set when the archive predates them or the entry cannot be read.

Store

#
Serialisation method.
public void Store(
writer
)

Write

#
Write these requirements into an archive.
public void Write(
archive
Archive to write into.
)