hingos

I am using the default markup serialization classes to serialize my workflow. My workflows contain only custom activities (I am working with an XML-based Domain-Specific Language), and I would like to withhold the "Name" attribute from the serialized content.

What I am getting at this time is:

< xml version="1.0" encoding="utf-8" >
<ns0:Sequence x:Name="sequence1" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="http://schemas.com/myActivities">
<ns0:ReadLine x:Name="r1" />
</ns0:Sequence>

What I would like to have is:

< xml version="1.0" encoding="utf-8" >
<ns0:Sequence xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="http://schemas.com/myActivities">
<ns0:ReadLine />
</ns0:Sequence>

I know I can suppress serialization of a property that I have declared in my custom activity by using the DesignerSerializationVisibility attribute. How can I do this for the Name property, which my activities inherit from the Activity type

Appreciate any ideas...



Re: Windows Workflow Foundation Suppressing the "Name" attribute when serializing workflow

Jon Flanders

Considering this and your namespace problem - I'd suggest perhaps running your XAML through an XSLT after its been serialized. This is one of the benefits of XAML as a data format really.




Re: Windows Workflow Foundation Suppressing the "Name" attribute when serializing workflow

Tom Lake - MSFT

This is not possible and if you could do it you would remove the ability to use correlation and activity binding. Correlation needs the name of the activity owning its scope and binding needs the name of the owner of the property / variable.




Re: Windows Workflow Foundation Suppressing the "Name" attribute when serializing workflow

hingos

Jon, thanks for your suggestion.

Tom, thanks for confirming.