# VisioMasterEditingExtensions

Editing helpers for changing the master used by existing Visio shapes.

Class 

`OfficeIMO.Visio`

**Namespace**

`OfficeIMO.Visio`

**Assembly**

`OfficeIMO.Visio`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[VisioMasterEditingExtensions.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L17)

**Modifiers**

static

Editing helpers for changing the master used by existing Visio shapes.

## Inheritance

- object
- VisioMasterEditingExtensions

Filter members 

Show inherited

## Methods

ReplaceMaster 6 overloads

`public static VisioShape ReplaceMaster(VisioPage page, VisioShape shape, string masterNameU, bool resizeToMaster = false)` [#](#method-replacemaster-officeimo-visio-visiopage-officeimo-visio-visioshape-string-boolean)

[VisioMasterEditingExtensions.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L17)

Replaces a shape's master by universal master name while preserving its position, text, style, data, and connectors.

Parameters

**page OfficeIMO.Visio.VisioPage required**

Page that owns the shape.

**shape OfficeIMO.Visio.VisioShape required**

Shape to update.

**masterNameU string required**

Replacement master universal name.

**resizeToMaster bool = false optional**

Whether to resize the shape to the replacement master's default size.

Returns

`VisioShape` The updated shape.

`public static VisioShape ReplaceMaster(VisioPage page, VisioShape shape, VisioMaster master, bool resizeToMaster = false)` [#](#method-replacemaster-officeimo-visio-visiopage-officeimo-visio-visioshape-officeimo-visio-visiomaster-boolean)

[VisioMasterEditingExtensions.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L36)

Replaces a shape's master using an existing master instance.

Parameters

**page OfficeIMO.Visio.VisioPage required**

Page that owns the shape.

**shape OfficeIMO.Visio.VisioShape required**

Shape to update.

**master OfficeIMO.Visio.VisioMaster required**

Replacement master.

**resizeToMaster bool = false optional**

Whether to resize the shape to the replacement master's default size.

Returns

`VisioShape` The updated shape.

`public static VisioShape ReplaceMaster(VisioPage page, VisioShape shape, VisioStencilShape stencil, bool resizeToMaster = false)` [#](#method-replacemaster-officeimo-visio-visiopage-officeimo-visio-visioshape-officeimo-visio-stencils-visiostencilshape-boolean)

[VisioMasterEditingExtensions.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L55)

Replaces a shape's master using an OfficeIMO-native stencil definition.

Parameters

**page OfficeIMO.Visio.VisioPage required**

Page that owns the shape.

**shape OfficeIMO.Visio.VisioShape required**

Shape to update.

**stencil OfficeIMO.Visio.Stencils.VisioStencilShape required**

Replacement stencil definition.

**resizeToMaster bool = false optional**

Whether to resize the shape to the stencil's default size.

Returns

`VisioShape` The updated shape.

`public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, string masterNameU, bool resizeToMaster = false)` [#](#method-replacemaster-officeimo-visio-visioshapeselection-string-boolean)

[VisioMasterEditingExtensions.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L73)

Replaces the master for every shape in a page-backed selection.

Parameters

**selection OfficeIMO.Visio.VisioShapeSelection required**

Selection to update.

**masterNameU string required**

Replacement master universal name.

**resizeToMaster bool = false optional**

Whether to resize each shape to the replacement master's default size.

Returns

`VisioShapeSelection` The updated selection.

`public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, VisioMaster master, bool resizeToMaster = false)` [#](#method-replacemaster-officeimo-visio-visioshapeselection-officeimo-visio-visiomaster-boolean)

[VisioMasterEditingExtensions.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L89)

Replaces the master for every shape in a page-backed selection using an existing master instance.

Parameters

**selection OfficeIMO.Visio.VisioShapeSelection required**

Selection to update.

**master OfficeIMO.Visio.VisioMaster required**

Replacement master.

**resizeToMaster bool = false optional**

Whether to resize each shape to the replacement master's default size.

Returns

`VisioShapeSelection` The updated selection.

`public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, VisioStencilShape stencil, bool resizeToMaster = false)` [#](#method-replacemaster-officeimo-visio-visioshapeselection-officeimo-visio-stencils-visiostencilshape-boolean)

[VisioMasterEditingExtensions.cs:106](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Visio/Editing/VisioMasterEditingExtensions.cs#L106)

Replaces the master for every shape in a page-backed selection using an OfficeIMO-native stencil definition.

Parameters

**selection OfficeIMO.Visio.VisioShapeSelection required**

Selection to update.

**stencil OfficeIMO.Visio.Stencils.VisioStencilShape required**

Replacement stencil definition.

**resizeToMaster bool = false optional**

Whether to resize each shape to the stencil's default size.

Returns

`VisioShapeSelection` The updated selection.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:8DB85A5BA43A6E6830E038163BA8E5BA9CC3F1F68248D3B15F9C775BE3E74F18 -->
