ShapeElement.InitializeResources Method

Initializes the resources for the shape.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)

Syntax

'Declaration
Protected Overridable Sub InitializeResources ( _
    classStyleSet As StyleSet _
)
'Usage
Dim classStyleSet As StyleSet 

Me.InitializeResources(classStyleSet)
protected virtual void InitializeResources(
    StyleSet classStyleSet
)
protected:
virtual void InitializeResources(
    StyleSet^ classStyleSet
)
protected function InitializeResources(
    classStyleSet : StyleSet
)

Parameters

Remarks

This method is called after the class style set has been initialized. You can override this method to add or modify resources for the shape.

This method is called once for the class. It is not called for each instance.

Examples

protected override void InitializeResources(DslDiagrams::StyleSet classStyleSet)
{
base.InitializeResources(classStyleSet);

// Fill brush settings for this shape.
DslDiagrams::BrushSettings backgroundBrush = new DslDiagrams::BrushSettings();
backgroundBrush.Color = global::System.Drawing.Color.FromKnownColor(global::System.Drawing.KnownColor.Blue);
classStyleSet.OverrideBrush(DslDiagrams::DiagramBrushes.DiagramBackground, backgroundBrush);

// Text brush settings for this shape.
DslDiagrams::BrushSettings textBrush = new DslDiagrams::BrushSettings();
textBrush.Color = global::System.Drawing.Color.FromKnownColor(global::System.Drawing.KnownColor.Red);
classStyleSet.OverrideBrush(DslDiagrams::DiagramBrushes.DiagramText, textBrush);

}

.NET Framework Security

See Also

Reference

ShapeElement Class

ShapeElement Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace