Properties
Archive
Gets a pointer to the archive that owns the Root of the tree this chunk belongs to.
ArchiveLocation
Gets a string representing the URI with which the archive is associated. The location may be a null string.
ChunkCount
Gets the number of child chunks contained in this chunk. The set of all child chunks is referred to as a 'litter'.
Chunks
Gets a pointer to the internal list of child chunks. Do not access this list unless you know what you are doing.
Index
Gets the index of this chunk. The index is set by the owner of this chunk. Indices smaller than zero imply no index has been set. The combination of name+index is always unique among a set of chunks in the same litter.
Items
Gets a pointer to the internal list of items. Do not access this list unless you know what you are doing.
Name
Gets the name of this chunk. The name is set by the owner of this chunk. Names must be at least 1 character long. The combination of name+index is always unique among a set of chunks in a single litter.
Methods
AddComment
#Adds a text comment to this chunk. Comments are serialized only if the output flavour is a human readable format. Comments are never deserialized, they are purely for the benefit of the humans reading the file data.
Parameters:
| comment_text (string) | The content of the comment, text might be altered if it contains invalid characters for a chosen format flavour. |
Exceptions:
| ArgumentNullException | Thrown if the content text is either null or empty. |
AddMessage
Log a new message with the top-level archive. Messages are collected during read/write operations, and can be displayed to the user upon completion using GH_Archive.ShowMessageLog().
Parameters:
| m (string) | Message text. |
| t (GH_Message_Type) | Message type. |
CreateChunk
#Create a new child chunk with the specified name and index qualifier. If another chunk already exists with similar properties, an exception will be thrown.
Exceptions:
| ArgumentException | Thrown if the name+index coordinte is already occupied by another chunk. |
CreateChunk
#Create a new child chunk with the specified name but without an index qualifier. If another chunk already exists with similar properties, an exception will be thrown.
Parameters:
| chunk_name (string) | Name of new child chunk. |
Exceptions:
| ArgumentException | Thrown if the name coordinte is already occupied by another chunk. |
Parameters:
| reader (BinaryReader) | Reader object to be used for deserialization. |
Parameters:
| node (XmlNode) | Node object to be used for deserialization. |
RemoveChunk
#Remove the specified chunk from the litter.
Parameters:
| chunk (GH_IChunk) | Chunk to remove. |
Returns: True is chunk was removed, false if chunk is not part of this litter.
Exceptions:
| ArgumentNullException | Thrown if chunk is a null reference. |
RemoveChunk
#Remove the first chunk with a matching name and index. Only chunks with index qualifiers are considered. Name comparisons are not case-sensitive.
RemoveChunk
#Remove the first chunk with a matching name. Only chunks without index qualifiers are considered. Name comparisons are not case-sensitive.
Parameters:
| chunk_name (string) | Name of chunk to remove. |
Returns: True is chunk was removed, false if no matching chunk could be found.
RemoveItem
#Remove an indexed item from this chunk.
RemoveItem
#Remove an unindexed item from this chunk.
Parameters:
| itemName (string) | Name of item. |
Returns: True on success, false on failure.
SetBoolean
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetBoolean
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (bool) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetBoundingBox
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_BoundingBox) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetBoundingBox
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_BoundingBox) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetByte
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetByte
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (byte) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetByteArray
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetByteArray
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (byte[]) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDate
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDate
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (DateTime) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDecimal
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDecimal
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (decimal) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDouble
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDouble
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (double) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDoubleArray
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDoubleArray
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (double[]) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingBitmap
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingBitmap
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (Bitmap) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingColor
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingColor
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (Color) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingPoint
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (Point) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingPoint
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingPointF
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (PointF) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingPointF
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingRectangle
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (Rectangle) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingRectangle
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingRectangleF
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (RectangleF) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingRectangleF
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (RectangleF) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingSize
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (Size) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingSize
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetDrawingSizeF
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (SizeF) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetDrawingSizeF
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetGuid
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetGuid
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (Guid) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetInt32
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (int) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetInt32
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetInt64
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (long) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetInt64
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetInterval1D
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_Interval1D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetInterval1D
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Interval1D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetInterval2D
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_Interval2D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetInterval2D
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Interval2D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetLine
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetLine
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Line) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetPath
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| absolutePath (string) | Absolute path to store. |
| basePath (string) | Base path. This will be used to also store a relative path. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetPath
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| absolutePath (string) | Absolute path to store. |
| basePath (string) | Base path. This will be used to also store a relative path. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetPlane
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetPlane
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Plane) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetPoint2D
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_Point2D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetPoint2D
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Point2D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetPoint3D
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_Point3D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetPoint3D
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Point3D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetPoint4D
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_Point4D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetPoint4D
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Point4D) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetSingle
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetSingle
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (float) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetString
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (string) | Value of item to add. If a null String is supplied, a zero-length String will be serialized. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetString
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (string) | Value of item to add. If a null String is supplied, a zero-length String will be serialized. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetVersion
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_value (GH_Version) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
SetVersion
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| item_value (GH_Version) | Value of item to add. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetVersion
#Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| item_index (int) | Index of item to add. |
| major (int) | Major component of version structure. |
| minor (int) | Minor component of version structure. |
| revision (int) | Revision component of version structure. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name and index already exists. |
SetVersion
#Add a new data item to this chunk. The name must be unique or an exception will be thrown.
Parameters:
| item_name (string) | Name of item to add. |
| major (int) | Major component of version structure. |
| minor (int) | Minor component of version structure. |
| revision (int) | Revision component of version structure. |
Exceptions:
| InvalidOperationException | Thrown if another item with the same name already exists. |
Parameters:
| writer (BinaryWriter) | Writer object to be used for serialization. |
Parameters:
| writer (XmlWriter) | Writer object to be used for serialization. |