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:
System.Object Object

Constructors

RibbonSerializer()

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 System.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 System.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 System.Object

The item to examine.

Returns

System.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

System.Collections.Generic.IEnumerable<KeyValuePair<System.String, System.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

System.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

System.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 System.String

The property name.

value System.String

The property value.

options RibbonSerializerOptions

A RibbonSerializerOptions containing serialization options.

Inherited Members

  • System.Object.ToString()
  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object, System.Object)
  • System.Object.ReferenceEquals(System.Object, System.Object)
  • System.Object.GetHashCode()
  • System.Object.GetType()
  • System.Object.MemberwiseClone()