다음을 통해 공유


ShapeElement.InitializeResources Method

Initializes the resources for the shape.

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

Syntax

‘선언
Protected Overridable Sub InitializeResources ( _
    classStyleSet As StyleSet _
)
protected virtual void InitializeResources(
    StyleSet classStyleSet
)
protected:
virtual void InitializeResources(
    StyleSet^ classStyleSet
)
abstract InitializeResources : 
        classStyleSet:StyleSet -> unit 
override InitializeResources : 
        classStyleSet:StyleSet -> unit 
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

Microsoft.VisualStudio.Modeling.Diagrams Namespace