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

#
public PluginRequirements(IReader reader)
Deserialisation constructor.
reader (IReader)

PluginRequirements

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

Fields

ArchiveEntry

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

Properties

All

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

Count

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

Empty

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

Missing

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

Restorable

#
public PluginRequirement[] Restorable { get; }
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.

Methods

FromDocument

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

FromFile

#
public static PluginRequirements FromFile(string path)
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.
path (string)File to inspect.
The stored requirements, or an empty set when the file predates them or cannot be read.

Read

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

Store

#
public void Store(IWriter writer)
Serialisation method.
writer (IWriter)

Write

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