Using the DIS-part of WSSF - simple question I assume.

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
Nov 25, 2008 at 11:22 AM
Hello, might be that this is not the correct place to place this question, but I don't know elsewhere to put it.

I've been using the vs 2008 SDK for a while now, and just figured out how powerful it is to have use the DIS-part of your tool(the modeling.service assembly).

Anyways, here is my simple question for you DIS-guru's out there ;

When in run-time, I want to specify a specific metamodel. Well thats about it. I can explain a bit better what I'd like to do;

After entered some custom attributes to a given property of some domain class in my dsl. The custom attribute specify that I would like to reference to a metamodel with the name UiO.ARI and all elements of name Expression. This equal to : blablabla.TargetClass(@"UiO.Ari\Expression"), right? When transforming the DSL into code, the following code pop's out in domainclass.cs:

        [System.ComponentModel.Editor(typeof(Microsoft.VisualStudio.Modeling.Integration.Editors.ExportedClassEditor), typeof(System.Drawing.Design.UITypeEditor))]  
        [DslDesign::DisplayNameResource("uio.cvl.ValueSubstitution/refBaseElement.DisplayName"typeof(global::uio.cvl.cvlDomainModel), "uio.cvl.GeneratedCode.DomainModelResx")]  
        [DslDesign::DescriptionResource("uio.cvl.ValueSubstitution/refBaseElement.Description"typeof(global::uio.cvl.cvlDomainModel), "uio.cvl.GeneratedCode.DomainModelResx")]  

So, again this is my question:

If i'm in the run-time of my dsl (that is; generating and editing diagrams based on my metamodel's syntax/semantics), would I have the possibility of actually editing the "blablabla.TargetClass(@"UiO.Ari\Expression") identifier?

For instance; In a given diagram I don't want the model to be UiO.Ari\Expression anymore, I want it to be SomeCompany.SomeModel\SomeClass. Can I change this attribute in run-time?
Anyone tried that, or is it plain impossible at this time (as the code is stored in the domainclass.cs file, and that file is "locked" during a run-time of a dsl)?

Thanks for bothering to read all this,
Vegard Aasen
Dec 16, 2008 at 9:38 AM
Hi there,

Did you try with reflection to change attribute values in run-time ?