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
'Déclaration
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
- classStyleSet
Type: Microsoft.VisualStudio.Modeling.Diagrams.StyleSet
The class style set for the shape.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.