GH_Layout

References
Represents a complete ribbon layout.

Constructors

GH_Layout

#
Create a new Ribbon layout
public GH_Layout()

GH_Layout

#
Duplicate an existing layout.
public GH_Layout(
GH_Layout
other
Layout to duplicate.
)

Properties

FilePath

#
Gets or sets the file path of the custom layout. Typically the path should only be set during Save operations. The FilePath field is not included in (de)serialization.
public string FilePath { get; set; }

ItemCount

#
Gets the total number of Items defined in this layout.
public int ItemCount { get; }

Items

#
Gets an enumerator for all the items in this layout.
public IEnumerable<GH_LayoutItem> Items { get; }

Name

#
Gets the name of the layout as indicated by the filepath or "unnamed"
public string Name { get; }

PanelCount

#
Gets the total number of Panels defined in this layout.
public int PanelCount { get; }

TabCount

#
Gets the total number of Tabs defined in this layout.
public int TabCount { get; }

Tabs

#
Gets the internal list of ribbon tab names. Eventhough items define tabs, this separate list is required in order to specify the order of tabs.
public List<GH_LayoutTab> Tabs { get; }

Methods

AddItem

#
Add a new item to this layout.
public void AddItem(
category,
Item category. If no category with this name exists yet, it will be created.
subcategory,
Item subcategory. If no subcategory with this name exists yet, it will be created.
item
Item to add.
)

AddItem

#
Add a new item to this layout.
public void AddItem(
category,
Item category. If no category with this name exists yet, it will be created.
subcategory,
Item subcategory. If no subcategory with this name exists yet, it will be created.
id,
ID of item.
exposure
Exposure of item.
)

AddItem

#
Add a new item to this layout.
public void AddItem(
category,
Item category. If no category with this name exists yet, it will be created.
subcategory,
Item subcategory. If no subcategory with this name exists yet, it will be created.
id
ID of item.
)

AddTab

#
Add a new tab to this layout. The tab will receive a default name.
public GH_LayoutTab AddTab()

AddTab

#
Add a new tab to this layout. If a tab with a similar name already exists, nothing is done.
public GH_LayoutTab AddTab(
name
Name of tab.
)

Deserialize

#
Deserialize this layout from a *.ghlayout file. If this function returns False, the state of this object is undefined.
public bool Deserialize(
filepath
File to deserialize from.
)
True on success, false on failure.

FindTab

#
Find the first tab which matches the given name.
public GH_LayoutTab FindTab(
name
Name to search for (not case sensitive)
)
The first tab that matches the name, or null if no matching tab could be found.

Read

#
public bool Read(
reader
)
Read

Serialize

#
Serialize this layout to a *.ghlayout file.
public bool Serialize(
filepath
File to serialize to.
)
True on success, false on failure.

Serialize

#
Serialize this layout as an xml string.
public string Serialize()

StringSort

#
For: RH-83156. Specifically handle leading whitespace for sorting purposes.
public static int StringSort()

Write

#
public bool Write(
writer
)
Write