index > Visual Studio Team System - Domain-Specific Language Tools > Reflecting domain property value on shape colour, outline etc..

Reflecting domain property value on shape colour, outline etc..


Hello,

I need connectors and shape to refect property values.

Therefore, I registered connector and shape observers to reflect property changes on relationships and domain elements. I am using OnAssociatedPropertyChanged event handlers.

This works fine when I change a property value. The problem is to present the right aspect of shapes and connectors when the model is re-loaded in memory.

In that case, the events are fired for the connectors but not for the shape. So when the model is loaded, the connectors are presented correctly but the shapes are not.

Any idea?

Thanks

Alain

Alain DePreter

Hi Alain,

I would like to make the problem clear -- do you observe property changes with codes like this?

public partial class MyShape
{
...
protected override void InitializeInstanceResources()
{
base.InitializeInstanceResources();
MyShape.AssociateValueWith(this.Store, MyElementReferencesTargets.ColorDomainPropertyId);
}

protected override void OnAssociatedPropertyChanged(Microsoft.VisualStudio.Modeling.Diagrams.PropertyChangedEventArgs e)
{
if ("Color".Equals(e.PropertyName))
{
// Update the shape's color with e.NewValue...
}

base.OnAssociatedPropertyChanged(e);

}
}

Regards,
Steven




DSL Tools - SDE Intern
Steven Tung

Hello Steven,

Alain DePreter
reply 3

You can use google to search for other answers

 

More Articles

Can I make two DSL models interact ?
Custom Command improvements
Welcome to the Domain-Specific Language (DSL) Tools Forum
guidLogicalView
Extending right-click menu for DSL class
Orchestration Features
Controlling and detecting what elements are droppable on the diag...
Defining custom multiplicities
Is there any DSL Specifications?
Nested Concept and Nested Diagram
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Right mouse click on model results in a …
Domain model designer toolbox items disa…
Why must the ShapeField's value be assoc…
How to control order of transformation s…
How to categorize properties?
Adding/Removing elements in domain model
Migrating to May CTP: MissingManifestRes…
Accessing the domain model using code
VS SDK March 2006 CTP
DSL Tools November CTP now available
March CTP DSL uninstall / VS (RC) issue
Odd results experimenting with shapes an…
connectors between elements of a compart…
Experimental UI - show and hide shapes a…
some question In DSL Tools

Hot Articles

Walkthrough-1 problem
Deployment - I can't find the template
DSL & Automation
How to add Text template and make availa…
Next CTP
Setup & life cycle
Unable to Replace Old Files by New ones
Prevent rules from firing during model d…
circular dependency and custom properties
Using Pictures
Slip in schedule
DSL Tools available for Beta2??
What is the best way to present 3 value …
Error creating DSL setup project (empty …
Nested Shapes

Recommend Articles

how can i get a Service into T4 textempl…
"DSL DM -> DD" for November…
November DSL Toolkit Release: where are …
Where can i get more documents of DLS To…
Custom TargetEndStyle
How can i force the placement of a port …
Reference relationships without graphica…
Extending a DSL post-deployment
Properties on Relationship
How to make a Domain Relationship visibl…
Announcing: SharpLudus, a software facto…
How to update PropertyGrid after changin…
No items in the toolbox
Finding the associated presentation elem…
Package Load Failure Again