ShapeElement.AssociateValueWith Method (Store, Guid)
Associates the resource for the shape with an in-memory store property that is assigned to 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
'Declaração
Public Shared Sub AssociateValueWith ( _
store As Store, _
domainPropertyId As Guid _
)
public static void AssociateValueWith(
Store store,
Guid domainPropertyId
)
public:
static void AssociateValueWith(
Store^ store,
Guid domainPropertyId
)
static member AssociateValueWith :
store:Store *
domainPropertyId:Guid -> unit
public static function AssociateValueWith(
store : Store,
domainPropertyId : Guid
)
Parameters
- store
Type: Microsoft.VisualStudio.Modeling.Store
The in-memory store.
- domainPropertyId
Type: System.Guid
The GUID for the in-memory store that is stored in the shape.
Remarks
ShapeElement resources can be associated with an IMS property. The associated ShapeElements will automatically update by receiving Invalidate calls when the IMS property value changes. You can change resources in response to the changes by overriding the OnPrePaint method and changing the resources there.
Examples
public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
{
DslDiagrams::ShapeElement shape = (DslDiagrams::ShapeElement)sender;
DslDiagrams::AssociatedPropertyInfo propertyInfo;
propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::Microsoft.Example.ClassDiagrams.Comment.TextDomainPropertyId);
DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "Comment").AssociateValueWith(shape.Store, propertyInfo);
}
.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.