GH_InstanceDescription

References
Base implementation of IGH_InstanceDescription. Consider deriving from this class rather than implementing IGH_InstanceDescription from scratch.

Constructors

GH_InstanceDescription

#
Create a new blank instance.
public GH_InstanceDescription()

GH_InstanceDescription

#
Duplicate another instance description.
public GH_InstanceDescription(
other
Instance description to duplicate
)

GH_InstanceDescription

#
Create a new instance.
public GH_InstanceDescription(
name,
Name of instance description.
nickName,
Nickname of instance description.
description,
Descirptive text of instance description.
category,
Category of instance description.
subCategory
Subcategory of the instance description.
)

GH_InstanceDescription

#
Create a new instance. This constructor is maintained for legacy purposes, use the constructor overload that includes SubCategories!.
[EditorBrowsable(EditorBrowsableState.Never)] public GH_InstanceDescription(
name,
Name of instance description.
nickName,
Nickname of instance description.
description,
Descirptive text of instance description.
category
Category of instance description. If you supply a name containing a dot, subcategory will be inferred.
)

Properties

Category

#
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
public virtual string Category { get; set; }
Category

Description

#
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
public virtual string Description { get; set; }
Description

HasCategory

#
Gets whether or not the Category field has been set.
public bool HasCategory { get; }
HasCategory

HasSubCategory

#
Gets whether or not the SubCategory field has been set.
public bool HasSubCategory { get; }
HasSubCategory

InstanceDescription

#
Gets a description of the current state of the object. This field is usually the same as the Description() field, but it might be variable when overridden.
public virtual string InstanceDescription { get; }

InstanceGuid

#
Gets the ID of this runtime instance.
public Guid InstanceGuid { get; }
InstanceGuid

Keywords

#
Gets a list of additional keywords that describe the object. Typically this list is empty but you can override this property to aid in object searches.
public virtual IEnumerable<string> Keywords { get; }
Keywords

Name

#
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
public virtual string Name { get; set; }
Name

NickName

#
Gets or sets the nickname of the object. This field can be changed by the user.
public virtual string NickName { get; set; }
NickName

SubCategory

#
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
public virtual string SubCategory { get; set; }
SubCategory

Methods

CopyFrom

#
Copy all fields (except the instance ID) from another instance description.
public void CopyFrom(
other
Object to mimic.
)

NewInstanceGuid

#
Generate a new random instance GUID
public void NewInstanceGuid()
NewInstanceGuid

NewInstanceGuid

#
Set the instance ID to be a specific GUID. This is very dangerous, only use this function if you're 6"4' and your first name is David.
public void NewInstanceGuid(
UUID
)
NewInstanceGuid

Read

#
Default deserialization. Only retrieves Name, NickName, Description and InstanceGuid fields. If you want to retrieve additional fields use ReadFull() instead. However, ReadFull() will only work if the archive was written using WriteFull().
public virtual bool Read(
reader
Object to deserialize with.
)
Always True.
Read

ReadFull

#
GH_InstanceDescription does not by default serialize all fields. Use this function to read all fields from the archive. This method is compatible with the default Write()/Read() operations.
public virtual bool ReadFull(
reader
Writer for deserialization.
)
True on success, false on failure.

Write

#
Default serialization. Only stores Name, NickName, Description and InstanceGuid fields. If you want to store additional fields use WriteFull() instead.
public virtual bool Write(
writer
Object to serialize with.
)
Always True.
Write

WriteFull

#
GH_InstanceDescription does not by default serialize all fields. Use this function to write all fields to the archive. This method is compatible with the default Write()/Read() operations.
public virtual bool WriteFull(
writer
Writer for serialization.
)
True on success, false on failure.