In This Article

RibbonSerializer Class

Provides logic for saving and loading various portions of a Ribbon's layout, useful for restoring the same state between application sessions.

public class RibbonSerializer
Inheritance:
object object

Constructors

RibbonSerializer()

Initializes an instance of the class.

public RibbonSerializer()

Methods

Deserialize(Ribbon, string)

Deserializes the specified Ribbon layout data.

public void Deserialize(Ribbon ribbon, string xml)
Parameter Type Description
ribbon Ribbon

The Ribbon to update.

xml string

The XML string containing layout data.

Deserialize(Ribbon, string, RibbonSerializerOptions)

Deserializes the specified Ribbon layout data.

public void Deserialize(Ribbon ribbon, string xml, RibbonSerializerOptions options)
Parameter Type Description
ribbon Ribbon

The Ribbon to update.

xml string

The XML string containing layout data.

options RibbonSerializerOptions

A RibbonSerializerOptions containing serialization options.

GetQuickAccessToolBarItemKey(Ribbon, object)

Returns the key for the specified QAT item.

protected virtual string GetQuickAccessToolBarItemKey(Ribbon ribbon, object item)
Parameter Type Description
ribbon Ribbon

The owner Ribbon.

item object

The item to examine.

Returns

string:

The key for the specified QAT item.

GetSerializedRibbonProperties(Ribbon, RibbonSerializerOptions)

Returns the collection of Ribbon properties to serialize.

protected virtual IEnumerable<KeyValuePair<string, string>> GetSerializedRibbonProperties(Ribbon ribbon, RibbonSerializerOptions options)
Parameter Type Description
ribbon Ribbon

The Ribbon to examine.

options RibbonSerializerOptions

A RibbonSerializerOptions containing serialization options.

Returns

IEnumerable<KeyValuePair<string, string>>:

The collection of Ribbon properties to serialize.

Serialize(Ribbon)

Serializes layout data for the specified Ribbon.

public string Serialize(Ribbon ribbon)
Parameter Type Description
ribbon Ribbon

The Ribbon to examine.

Returns

string:

The XML string containing layout data.

Serialize(Ribbon, RibbonSerializerOptions)

Serializes layout data for the specified Ribbon.

public string Serialize(Ribbon ribbon, RibbonSerializerOptions options)
Parameter Type Description
ribbon Ribbon

The Ribbon to examine.

options RibbonSerializerOptions

A RibbonSerializerOptions containing serialization options.

Returns

string:

The XML string containing layout data.

SetSerializedRibbonProperty(Ribbon, string, string, RibbonSerializerOptions)

Sets the value of Ribbon property.

protected virtual void SetSerializedRibbonProperty(Ribbon ribbon, string name, string value, RibbonSerializerOptions options)
Parameter Type Description
ribbon Ribbon

The Ribbon to update.

name string

The property name.

value string

The property value.

options RibbonSerializerOptions

A RibbonSerializerOptions containing serialization options.

Inherited Members