Snippet

References
public sealed class Snippet
A pointer to a GHZ file containing a bunch of components acting as a snippet. The basic descriptive properties (Nomen, Icon) are read lazily from standalone chunks in the archive so the snippet can be drawn in the UI without deserialising the document graph. The document is only opened when a Preview bitmap is requested.

Constructors

Snippet

#
public Snippet(string file)
Create a new snippet. Construction is cheap; archive contents are only read when Nomen, Icon or Preview is accessed.
file (string)

Properties

File

#
public string File { get; }
File path for snippet.

Icon

#
public IIcon Icon { get; }
Gets the icon for this snippet. Loaded lazily from the archive's standalone icon chunk. If no icon chunk is present, the document is deserialised on first access and an icon is derived from its objects (preferring custom-iconned objects, then rightmost components, then rightmost other objects).

Id

#
public Guid Id { get; }
Gets a stable identifier for this snippet, derived from its file path.

Nomen

#
public Nomen Nomen { get; }
Gets the nomen describing this snippet. Loaded lazily from the archive's standalone chunks (NameEntry, InfoEntry, SectionEntry).

Preview

#
public Bitmap Preview { get; }
A preview of the snippet file. Forces a full document deserialisation on first access.

Time

#
public DateTime Time { get; }
Gets the time this file was last changed.