Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/CodeAnalysisDictionary.xml
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/CodeAnalysisDictionary.xml	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/CodeAnalysisDictionary.xml	(revision 10525)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Dictionary>
+  <Words>
+    <Unrecognized>
+      <!-- Words to be excluded from the existing dictionary -->
+      <!-- <Word>instate</Word> -->
+    </Unrecognized>
+    <Recognized>
+      <!-- Words to augment the existing dictionary -->
+      <!-- If your company or product name is an unusal word, you may want to include it. -->
+      <!-- For compound words, include the individual words (if necessary) -->
+      <!--<Word>HEAL</Word>-->
+      <!--<Word>HeuristicLab</Word>-->
+    </Recognized>
+    <Acronyms>
+      <!-- Company, domain, or project specific acronyms -->
+      <CasingExceptions>
+        <!-- If your company or product name is an acroynm, you may want to include these here -->
+        <!--<Acronym>HEAL</Acronym>-->
+        <!--<Acronym>HeuristicLab</Acronym>-->
+      </CasingExceptions>
+    </Acronyms>
+  </Words>
+</Dictionary>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/Dsl.csproj
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/Dsl.csproj	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/Dsl.csproj	(revision 10525)
@@ -0,0 +1,254 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\DSLTools\Microsoft.DslTools.settings.targets" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.10318</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{946658E8-06B1-4849-B14E-64721327C87F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.SimulationCore</RootNamespace>
+    <AssemblyName>HeuristicLab.SimulationCore.Dsl</AssemblyName>
+    <AssemblyOriginatorKeyFile>..\Key.snk</AssemblyOriginatorKeyFile>
+    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
+    <SignAssembly>true</SignAssembly>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <GacTargetOutput>false</GacTargetOutput>
+    <StartupObject>
+    </StartupObject>
+    <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <!-- Project specific properties to control T4/DSL targets -->
+  <PropertyGroup>
+    <TransformOnBuild>True</TransformOnBuild>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(DslTargetsPath)\Microsoft.DSLTools.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.Modeling.Sdk$(DslToolsVersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.Modeling.Sdk.Diagrams$(DslToolsVersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating$(T4VersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.10.0" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.11.0" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Drawing.Design" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.XML" />
+    <Reference Include="System.Xaml" />
+    <Reference Include="WindowsBase">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.12.0" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="GeneratedCode\SerializationHelper.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>SerializationHelper.cs</LastGenOutput>
+    </None>
+    <Compile Include="GeneratedCode\ConnectionBuilders.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ConnectionBuilders.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\Connectors.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Connectors.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\Diagram.cs">
+      <DependentUpon>Diagram.tt</DependentUpon>
+      <SubType>Code</SubType>
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+    </Compile>
+    <Compile Include="GeneratedCode\DirectiveProcessor.cs">
+      <DependentUpon>DirectiveProcessor.tt</DependentUpon>
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+    </Compile>
+    <Compile Include="GeneratedCode\DomainClasses.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DomainClasses.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\DomainRelationships.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DomainRelationships.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\HelpKeywordHelper.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>HelpKeywordHelper.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\MultiplicityValidation.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>MultiplicityValidation.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\PropertiesGrid.cs">
+      <DependentUpon>PropertiesGrid.tt</DependentUpon>
+      <SubType>Code</SubType>
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+    </Compile>
+    <Compile Include="GeneratedCode\SerializationHelper.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>SerializationHelper.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\Shapes.cs">
+      <DependentUpon>Shapes.tt</DependentUpon>
+      <SubType>Code</SubType>
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+    </Compile>
+    <Compile Include="GeneratedCode\ToolboxHelper.cs">
+      <DependentUpon>ToolboxHelper.tt</DependentUpon>
+      <SubType>Code</SubType>
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+    </Compile>
+    <Compile Include="GlobalSuppressions.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="GeneratedCode\DomainModel.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DomainModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\Serializer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Serializer.tt</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="DslDefinition.dsl.diagram">
+      <DependentUpon>DslDefinition.dsl</DependentUpon>
+    </None>
+    <None Include="GeneratedCode\ConnectionBuilders.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>ConnectionBuilders.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\Diagram.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Diagram.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\DirectiveProcessor.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DirectiveProcessor.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\DomainRelationships.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DomainRelationships.cs</LastGenOutput>
+    </None>
+    <None Include="DslDefinition.dsl" />
+    <None Include="GeneratedCode\Connectors.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Connectors.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\DomainClasses.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DomainClasses.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\DomainModelResx.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DomainModelResx.resx</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\HelpKeywordHelper.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>HelpKeywordHelper.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\MultiplicityValidation.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>MultiplicityValidation.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\PropertiesGrid.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>PropertiesGrid.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\HLSimSchema.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>HLSimSchema.xsd</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\DomainModel.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DomainModel.cs</LastGenOutput>
+    </None>
+    <Content Include="GeneratedCode\HLSimSchema.xsd">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>HLSimSchema.tt</DependentUpon>
+      <SubType>
+      </SubType>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <None Include="GeneratedCode\Serializer.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Serializer.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\Shapes.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Shapes.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\ToolboxHelper.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>ToolboxHelper.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4df5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="GeneratedCode\DomainModelResx.resx">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DomainModelResx.tt</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </ItemGroup>
+  <PropertyGroup>
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDictionary Include="..\CodeAnalysisDictionary.xml">
+      <Link>CodeAnalysisDictionary.xml</Link>
+    </CodeAnalysisDictionary>
+    <Content Include="Resources\ExampleConnectorToolBitmap.bmp" />
+    <Content Include="Resources\ExampleShapeToolBitmap.bmp" />
+    <EmbeddedResource Include="Resources\ConnectorSourceSearch.cur" />
+    <EmbeddedResource Include="Resources\ConnectorTargetSearch.cur" />
+  </ItemGroup>
+</Project>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/DslDefinition.dsl
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/DslDefinition.dsl	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/DslDefinition.dsl	(revision 10525)
@@ -0,0 +1,331 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Dsl xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="e76b5f9b-81a1-45f0-ac20-8a25077fff36" Description="Description for HeuristicLab.SimulationCore.HLSim" Name="HLSim" DisplayName="HLSim" Namespace="HeuristicLab.SimulationCore" ProductName="HeuristicLab" CompanyName="HEAL" PackageGuid="fab8f4d5-e0e8-4756-917b-6979bfd5ce3a" PackageNamespace="HeuristicLab.SimulationCore" xmlns="http://schemas.microsoft.com/VisualStudio/2005/DslTools/DslDefinitionModel">
+  <Classes>
+    <DomainClass Id="bf3fdcd7-a552-4140-a502-130d51fa2a89" Description="The root in which all other elements are embedded. Appears as a diagram." Name="SimulationModel" DisplayName="Simulation Model" Namespace="HeuristicLab.SimulationCore">
+      <Properties>
+        <DomainProperty Id="495a3211-d774-4434-8bd1-7b340049f9e9" Description="Description for HeuristicLab.SimulationCore.SimulationModel.Model Type" Name="ModelType" DisplayName="Model Type">
+          <Type>
+            <ExternalTypeMoniker Name="/System/String" />
+          </Type>
+        </DomainProperty>
+      </Properties>
+      <ElementMergeDirectives>
+        <ElementMergeDirective>
+          <Index>
+            <DomainClassMoniker Name="Activity" />
+          </Index>
+          <LinkCreationPaths>
+            <DomainPath>SimulationModelHasActivities.Activities</DomainPath>
+          </LinkCreationPaths>
+        </ElementMergeDirective>
+        <ElementMergeDirective>
+          <Index>
+            <DomainClassMoniker Name="Action" />
+          </Index>
+          <LinkCreationPaths>
+            <DomainPath>SimulationModelHasActions.Actions</DomainPath>
+          </LinkCreationPaths>
+        </ElementMergeDirective>
+      </ElementMergeDirectives>
+    </DomainClass>
+    <DomainClass Id="168d4729-6156-4a96-87c5-6f8e7dbe5a0f" Description="Description for HeuristicLab.SimulationCore.Activity" Name="Activity" DisplayName="Activity" Namespace="HeuristicLab.SimulationCore">
+      <Properties>
+        <DomainProperty Id="5d66e342-eb3f-43c5-a12d-e752689e360f" Description="Description for HeuristicLab.SimulationCore.Activity.Name" Name="Name" DisplayName="Name" IsElementName="true">
+          <Type>
+            <ExternalTypeMoniker Name="/System/String" />
+          </Type>
+        </DomainProperty>
+      </Properties>
+    </DomainClass>
+    <DomainClass Id="d7ac7ca2-929b-4f0c-b690-e05a92bf28ed" Description="Description for HeuristicLab.SimulationCore.Action" Name="Action" DisplayName="Action" Namespace="HeuristicLab.SimulationCore">
+      <Properties>
+        <DomainProperty Id="3b4b0b0d-cb17-48f2-b0e1-45c23fd2c379" Description="Description for HeuristicLab.SimulationCore.Action.Name" Name="Name" DisplayName="Name" IsElementName="true">
+          <Type>
+            <ExternalTypeMoniker Name="/System/String" />
+          </Type>
+        </DomainProperty>
+      </Properties>
+    </DomainClass>
+  </Classes>
+  <Relationships>
+    <DomainRelationship Id="4a4161d0-95d3-4727-8959-372bd8ba3fc7" Description="Description for HeuristicLab.SimulationCore.SimulationModelHasActivities" Name="SimulationModelHasActivities" DisplayName="Simulation Model Has Activities" Namespace="HeuristicLab.SimulationCore" IsEmbedding="true">
+      <Source>
+        <DomainRole Id="1026f01d-c2bd-47e0-a7f9-01c0551c0e8d" Description="Description for HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModel" Name="SimulationModel" DisplayName="Simulation Model" PropertyName="Activities" PropagatesCopy="PropagatesCopyToLinkAndOppositeRolePlayer" PropertyDisplayName="Activities">
+          <RolePlayer>
+            <DomainClassMoniker Name="SimulationModel" />
+          </RolePlayer>
+        </DomainRole>
+      </Source>
+      <Target>
+        <DomainRole Id="cd685a0e-906c-49b2-bc7b-0bdcc439b69e" Description="Description for HeuristicLab.SimulationCore.SimulationModelHasActivities.Activity" Name="Activity" DisplayName="Activity" PropertyName="SimulationModel" Multiplicity="One" PropagatesDelete="true" PropertyDisplayName="Simulation Model">
+          <RolePlayer>
+            <DomainClassMoniker Name="Activity" />
+          </RolePlayer>
+        </DomainRole>
+      </Target>
+    </DomainRelationship>
+    <DomainRelationship Id="4f6020f0-423c-4469-af3f-09ac8db8d19a" Description="Description for HeuristicLab.SimulationCore.SimulationModelHasActions" Name="SimulationModelHasActions" DisplayName="Simulation Model Has Actions" Namespace="HeuristicLab.SimulationCore" IsEmbedding="true">
+      <Source>
+        <DomainRole Id="5f2e5817-063b-4f23-a996-d490ac05ec40" Description="Description for HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModel" Name="SimulationModel" DisplayName="Simulation Model" PropertyName="Actions" PropagatesCopy="PropagatesCopyToLinkAndOppositeRolePlayer" PropertyDisplayName="Actions">
+          <RolePlayer>
+            <DomainClassMoniker Name="SimulationModel" />
+          </RolePlayer>
+        </DomainRole>
+      </Source>
+      <Target>
+        <DomainRole Id="a7f0817d-4f04-49ef-9592-e2f78432cc4f" Description="Description for HeuristicLab.SimulationCore.SimulationModelHasActions.Action" Name="Action" DisplayName="Action" PropertyName="SimulationModel" Multiplicity="One" PropagatesDelete="true" PropertyDisplayName="Simulation Model">
+          <RolePlayer>
+            <DomainClassMoniker Name="Action" />
+          </RolePlayer>
+        </DomainRole>
+      </Target>
+    </DomainRelationship>
+    <DomainRelationship Id="717952d5-7c93-4315-8e41-453cffe17811" Description="Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers" Name="ActivityReferencesTriggers" DisplayName="Activity References Triggers" Namespace="HeuristicLab.SimulationCore">
+      <Source>
+        <DomainRole Id="7796065f-0003-4aec-bf7a-6d22b99f7c4b" Description="Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Activity" Name="Activity" DisplayName="Activity" PropertyName="Triggers" PropertyDisplayName="Triggers">
+          <RolePlayer>
+            <DomainClassMoniker Name="Activity" />
+          </RolePlayer>
+        </DomainRole>
+      </Source>
+      <Target>
+        <DomainRole Id="93b557c0-5b55-4e27-aa06-6edfbe508585" Description="Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Action" Name="Action" DisplayName="Action" PropertyName="Activities" PropertyDisplayName="Activities">
+          <RolePlayer>
+            <DomainClassMoniker Name="Action" />
+          </RolePlayer>
+        </DomainRole>
+      </Target>
+    </DomainRelationship>
+    <DomainRelationship Id="448eff77-5a72-420f-befa-d599574bb485" Description="Description for HeuristicLab.SimulationCore.ActionReferencesListeners" Name="ActionReferencesListeners" DisplayName="Action References Listeners" Namespace="HeuristicLab.SimulationCore">
+      <Source>
+        <DomainRole Id="0e8492e9-920e-4d6c-b398-53844a0b8294" Description="Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Action" Name="Action" DisplayName="Action" PropertyName="Listeners" PropertyDisplayName="Listeners">
+          <RolePlayer>
+            <DomainClassMoniker Name="Action" />
+          </RolePlayer>
+        </DomainRole>
+      </Source>
+      <Target>
+        <DomainRole Id="ab4b8a78-aa3e-4315-8bfd-e41126a5bc7a" Description="Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Activity" Name="Activity" DisplayName="Activity" PropertyName="Actions" PropertyDisplayName="Actions">
+          <RolePlayer>
+            <DomainClassMoniker Name="Activity" />
+          </RolePlayer>
+        </DomainRole>
+      </Target>
+    </DomainRelationship>
+  </Relationships>
+  <Types>
+    <ExternalType Name="DateTime" Namespace="System" />
+    <ExternalType Name="String" Namespace="System" />
+    <ExternalType Name="Int16" Namespace="System" />
+    <ExternalType Name="Int32" Namespace="System" />
+    <ExternalType Name="Int64" Namespace="System" />
+    <ExternalType Name="UInt16" Namespace="System" />
+    <ExternalType Name="UInt32" Namespace="System" />
+    <ExternalType Name="UInt64" Namespace="System" />
+    <ExternalType Name="SByte" Namespace="System" />
+    <ExternalType Name="Byte" Namespace="System" />
+    <ExternalType Name="Double" Namespace="System" />
+    <ExternalType Name="Single" Namespace="System" />
+    <ExternalType Name="Guid" Namespace="System" />
+    <ExternalType Name="Boolean" Namespace="System" />
+    <ExternalType Name="Char" Namespace="System" />
+  </Types>
+  <Shapes>
+    <GeometryShape Id="9aa624f1-2625-4cc3-b759-7070505f1a8b" Description="Description for HeuristicLab.SimulationCore.ActivityShape" Name="ActivityShape" DisplayName="Activity Shape" Namespace="HeuristicLab.SimulationCore" FixedTooltipText="Activity Shape" FillColor="DarkKhaki" InitialWidth="1.62" InitialHeight="1" Geometry="RoundedRectangle">
+      <ShapeHasDecorators Position="InnerTopLeft" HorizontalOffset="0" VerticalOffset="0">
+        <TextDecorator Name="NameDecorator" DisplayName="Name Decorator" DefaultText="NameDecorator" />
+      </ShapeHasDecorators>
+    </GeometryShape>
+    <GeometryShape Id="25205757-e7e3-4310-b3c8-e4b85c91b152" Description="Description for HeuristicLab.SimulationCore.ActionShape" Name="ActionShape" DisplayName="Action Shape" Namespace="HeuristicLab.SimulationCore" FixedTooltipText="Action Shape" FillColor="IndianRed" InitialWidth="0.75" InitialHeight="0.75" Geometry="Circle">
+      <ShapeHasDecorators Position="InnerTopLeft" HorizontalOffset="0" VerticalOffset="0">
+        <TextDecorator Name="NameDecorator" DisplayName="Name Decorator" DefaultText="NameDecorator" />
+      </ShapeHasDecorators>
+    </GeometryShape>
+  </Shapes>
+  <Connectors>
+    <Connector Id="ff67e59a-021e-472d-8fdc-0298ee26fe8e" Description="Description for HeuristicLab.SimulationCore.Trigger" Name="Trigger" DisplayName="Trigger" Namespace="HeuristicLab.SimulationCore" FixedTooltipText="Trigger" TargetEndStyle="EmptyArrow" />
+    <Connector Id="84ebcd29-fe73-4fa2-8e01-ce82534fb35c" Description="Description for HeuristicLab.SimulationCore.Listener" Name="Listener" DisplayName="Listener" Namespace="HeuristicLab.SimulationCore" FixedTooltipText="Listener" DashStyle="Dot" TargetEndStyle="EmptyArrow" />
+  </Connectors>
+  <XmlSerializationBehavior Name="HLSimSerializationBehavior" Namespace="HeuristicLab.SimulationCore">
+    <ClassData>
+      <XmlClassData TypeName="SimulationModel" MonikerAttributeName="" SerializeId="true" MonikerElementName="simulationModelMoniker" ElementName="simulationModel" MonikerTypeName="SimulationModelMoniker">
+        <DomainClassMoniker Name="SimulationModel" />
+        <ElementData>
+          <XmlRelationshipData UseFullForm="true" RoleElementName="activities">
+            <DomainRelationshipMoniker Name="SimulationModelHasActivities" />
+          </XmlRelationshipData>
+          <XmlRelationshipData UseFullForm="true" RoleElementName="actions">
+            <DomainRelationshipMoniker Name="SimulationModelHasActions" />
+          </XmlRelationshipData>
+          <XmlPropertyData XmlName="modelType">
+            <DomainPropertyMoniker Name="SimulationModel/ModelType" />
+          </XmlPropertyData>
+        </ElementData>
+      </XmlClassData>
+      <XmlClassData TypeName="HLSimDiagram" MonikerAttributeName="" SerializeId="true" MonikerElementName="hLSimDiagramMoniker" ElementName="hLSimDiagram" MonikerTypeName="HLSimDiagramMoniker">
+        <DiagramMoniker Name="HLSimDiagram" />
+      </XmlClassData>
+      <XmlClassData TypeName="Activity" MonikerAttributeName="" SerializeId="true" MonikerElementName="activityMoniker" ElementName="activity" MonikerTypeName="ActivityMoniker">
+        <DomainClassMoniker Name="Activity" />
+        <ElementData>
+          <XmlPropertyData XmlName="name">
+            <DomainPropertyMoniker Name="Activity/Name" />
+          </XmlPropertyData>
+          <XmlRelationshipData UseFullForm="true" RoleElementName="triggers">
+            <DomainRelationshipMoniker Name="ActivityReferencesTriggers" />
+          </XmlRelationshipData>
+        </ElementData>
+      </XmlClassData>
+      <XmlClassData TypeName="Action" MonikerAttributeName="" SerializeId="true" MonikerElementName="actionMoniker" ElementName="action" MonikerTypeName="ActionMoniker">
+        <DomainClassMoniker Name="Action" />
+        <ElementData>
+          <XmlPropertyData XmlName="name">
+            <DomainPropertyMoniker Name="Action/Name" />
+          </XmlPropertyData>
+          <XmlRelationshipData UseFullForm="true" RoleElementName="listeners">
+            <DomainRelationshipMoniker Name="ActionReferencesListeners" />
+          </XmlRelationshipData>
+        </ElementData>
+      </XmlClassData>
+      <XmlClassData TypeName="SimulationModelHasActivities" MonikerAttributeName="" SerializeId="true" MonikerElementName="simulationModelHasActivitiesMoniker" ElementName="simulationModelHasActivities" MonikerTypeName="SimulationModelHasActivitiesMoniker">
+        <DomainRelationshipMoniker Name="SimulationModelHasActivities" />
+      </XmlClassData>
+      <XmlClassData TypeName="SimulationModelHasActions" MonikerAttributeName="" SerializeId="true" MonikerElementName="simulationModelHasActionsMoniker" ElementName="simulationModelHasActions" MonikerTypeName="SimulationModelHasActionsMoniker">
+        <DomainRelationshipMoniker Name="SimulationModelHasActions" />
+      </XmlClassData>
+      <XmlClassData TypeName="ActivityReferencesTriggers" MonikerAttributeName="" SerializeId="true" MonikerElementName="activityReferencesTriggersMoniker" ElementName="activityReferencesTriggers" MonikerTypeName="ActivityReferencesTriggersMoniker">
+        <DomainRelationshipMoniker Name="ActivityReferencesTriggers" />
+      </XmlClassData>
+      <XmlClassData TypeName="ActionReferencesListeners" MonikerAttributeName="" SerializeId="true" MonikerElementName="actionReferencesListenersMoniker" ElementName="actionReferencesListeners" MonikerTypeName="ActionReferencesListenersMoniker">
+        <DomainRelationshipMoniker Name="ActionReferencesListeners" />
+      </XmlClassData>
+      <XmlClassData TypeName="ActivityShape" MonikerAttributeName="" SerializeId="true" MonikerElementName="activityShapeMoniker" ElementName="activityShape" MonikerTypeName="ActivityShapeMoniker">
+        <GeometryShapeMoniker Name="ActivityShape" />
+      </XmlClassData>
+      <XmlClassData TypeName="ActionShape" MonikerAttributeName="" SerializeId="true" MonikerElementName="actionShapeMoniker" ElementName="actionShape" MonikerTypeName="ActionShapeMoniker">
+        <GeometryShapeMoniker Name="ActionShape" />
+      </XmlClassData>
+      <XmlClassData TypeName="Trigger" MonikerAttributeName="" SerializeId="true" MonikerElementName="triggerMoniker" ElementName="trigger" MonikerTypeName="TriggerMoniker">
+        <ConnectorMoniker Name="Trigger" />
+      </XmlClassData>
+      <XmlClassData TypeName="Listener" MonikerAttributeName="" SerializeId="true" MonikerElementName="listenerMoniker" ElementName="listener" MonikerTypeName="ListenerMoniker">
+        <ConnectorMoniker Name="Listener" />
+      </XmlClassData>
+    </ClassData>
+  </XmlSerializationBehavior>
+  <ExplorerBehavior Name="HLSimExplorer" />
+  <ConnectionBuilders>
+    <ConnectionBuilder Name="ActivityReferencesTriggersBuilder">
+      <LinkConnectDirective>
+        <DomainRelationshipMoniker Name="ActivityReferencesTriggers" />
+        <SourceDirectives>
+          <RolePlayerConnectDirective>
+            <AcceptingClass>
+              <DomainClassMoniker Name="Activity" />
+            </AcceptingClass>
+          </RolePlayerConnectDirective>
+        </SourceDirectives>
+        <TargetDirectives>
+          <RolePlayerConnectDirective>
+            <AcceptingClass>
+              <DomainClassMoniker Name="Action" />
+            </AcceptingClass>
+          </RolePlayerConnectDirective>
+        </TargetDirectives>
+      </LinkConnectDirective>
+    </ConnectionBuilder>
+    <ConnectionBuilder Name="ActionReferencesListenersBuilder">
+      <LinkConnectDirective>
+        <DomainRelationshipMoniker Name="ActionReferencesListeners" />
+        <SourceDirectives>
+          <RolePlayerConnectDirective>
+            <AcceptingClass>
+              <DomainClassMoniker Name="Action" />
+            </AcceptingClass>
+          </RolePlayerConnectDirective>
+        </SourceDirectives>
+        <TargetDirectives>
+          <RolePlayerConnectDirective>
+            <AcceptingClass>
+              <DomainClassMoniker Name="Activity" />
+            </AcceptingClass>
+          </RolePlayerConnectDirective>
+        </TargetDirectives>
+      </LinkConnectDirective>
+    </ConnectionBuilder>
+  </ConnectionBuilders>
+  <Diagram Id="cf1c9f0b-eb8e-4d36-9fcc-6cd2455f9cba" Description="Description for HeuristicLab.SimulationCore.HLSimDiagram" Name="HLSimDiagram" DisplayName="Minimal Language Diagram" Namespace="HeuristicLab.SimulationCore">
+    <Class>
+      <DomainClassMoniker Name="SimulationModel" />
+    </Class>
+    <ShapeMaps>
+      <ShapeMap>
+        <DomainClassMoniker Name="Activity" />
+        <ParentElementPath>
+          <DomainPath>SimulationModelHasActivities.SimulationModel/!SimulationModel</DomainPath>
+        </ParentElementPath>
+        <DecoratorMap>
+          <TextDecoratorMoniker Name="ActivityShape/NameDecorator" />
+          <PropertyDisplayed>
+            <PropertyPath>
+              <DomainPropertyMoniker Name="Activity/Name" />
+            </PropertyPath>
+          </PropertyDisplayed>
+        </DecoratorMap>
+        <GeometryShapeMoniker Name="ActivityShape" />
+      </ShapeMap>
+      <ShapeMap>
+        <DomainClassMoniker Name="Action" />
+        <ParentElementPath>
+          <DomainPath>SimulationModelHasActions.SimulationModel/!SimulationModel</DomainPath>
+        </ParentElementPath>
+        <DecoratorMap>
+          <TextDecoratorMoniker Name="ActionShape/NameDecorator" />
+          <PropertyDisplayed>
+            <PropertyPath>
+              <DomainPropertyMoniker Name="Action/Name" />
+            </PropertyPath>
+          </PropertyDisplayed>
+        </DecoratorMap>
+        <GeometryShapeMoniker Name="ActionShape" />
+      </ShapeMap>
+    </ShapeMaps>
+    <ConnectorMaps>
+      <ConnectorMap>
+        <ConnectorMoniker Name="Trigger" />
+        <DomainRelationshipMoniker Name="ActivityReferencesTriggers" />
+      </ConnectorMap>
+      <ConnectorMap>
+        <ConnectorMoniker Name="Listener" />
+        <DomainRelationshipMoniker Name="ActionReferencesListeners" />
+      </ConnectorMap>
+    </ConnectorMaps>
+  </Diagram>
+  <Designer CopyPasteGeneration="CopyPasteOnly" FileExtension="hlsim" EditorGuid="c6d92072-93cd-4652-9e26-052db3ad40ce">
+    <RootClass>
+      <DomainClassMoniker Name="SimulationModel" />
+    </RootClass>
+    <XmlSerializationDefinition CustomPostLoad="false">
+      <XmlSerializationBehaviorMoniker Name="HLSimSerializationBehavior" />
+    </XmlSerializationDefinition>
+    <ToolboxTab TabText="HLSim">
+      <ElementTool Name="Activity" ToolboxIcon="Resources\ExampleShapeToolBitmap.bmp" Caption="Activity" Tooltip="Activity" HelpKeyword="Activity">
+        <DomainClassMoniker Name="Activity" />
+      </ElementTool>
+      <ElementTool Name="Action" ToolboxIcon="Resources\ExampleShapeToolBitmap.bmp" Caption="Action" Tooltip="Action" HelpKeyword="Action">
+        <DomainClassMoniker Name="Action" />
+      </ElementTool>
+      <ConnectionTool Name="Trigger" ToolboxIcon="Resources\ExampleConnectorToolBitmap.bmp" Caption="Trigger" Tooltip="Trigger" HelpKeyword="Trigger">
+        <ConnectionBuilderMoniker Name="HLSim/ActivityReferencesTriggersBuilder" />
+      </ConnectionTool>
+      <ConnectionTool Name="Listener" ToolboxIcon="Resources\ExampleConnectorToolBitmap.bmp" Caption="Listener" Tooltip="Listener" HelpKeyword="Listener">
+        <ConnectionBuilderMoniker Name="HLSim/ActionReferencesListenersBuilder" />
+      </ConnectionTool>
+    </ToolboxTab>
+    <Validation UsesMenu="false" UsesOpen="false" UsesSave="false" UsesLoad="false" />
+    <DiagramMoniker Name="HLSimDiagram" />
+  </Designer>
+  <Explorer ExplorerGuid="8ed281ac-3dd2-4c07-a131-eb7845494b19" Title="HLSim Explorer">
+    <ExplorerBehaviorMoniker Name="HLSim/HLSimExplorer" />
+  </Explorer>
+</Dsl>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/DslDefinition.dsl.diagram
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/DslDefinition.dsl.diagram	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/DslDefinition.dsl.diagram	(revision 10525)
@@ -0,0 +1,263 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<microsoft.VisualStudio.Modeling.DslDesigner.DslDesignerDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 24.928191832005979, 8.5" isCompleteView="false" name="DslDefinition">
+  <DslMoniker Name="/HeuristicLab.SimulationCore/HLSim" />
+  <nestedChildShapes>
+    <microsoft.VisualStudio.Modeling.DslDesigner.DomainModelElements Id="a173bedb-ee4b-4400-b811-a033ba220dfd" absoluteBounds="0, 0, 9.1166666716337215, 8.5">
+      <nestedChildShapes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape Id="c612cc37-4636-4781-8ac6-61931800d82d" isExpanded="false" absoluteBounds="1.6, 1.7416910807291668, 1.35, 0.25">
+          <DomainRelationshipMoniker Name="/HeuristicLab.SimulationCore/SimulationModelHasActivities" />
+          <relativeChildShapes />
+          <nestedChildShapes>
+            <elementListCompartment Id="dcebed48-5092-4bf9-9fb4-d089432fa69c" absoluteBounds="1.6, 1.7416910807291668, 0.125, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape Id="92180b74-e577-4d9e-b491-b6b9554b1e83" isExpanded="false" absoluteBounds="1.6, 3.6733821614583335, 1.35, 0.25">
+          <DomainRelationshipMoniker Name="/HeuristicLab.SimulationCore/SimulationModelHasActions" />
+          <relativeChildShapes />
+          <nestedChildShapes>
+            <elementListCompartment Id="521ffdbe-4b7d-444e-880a-466abdf00764" absoluteBounds="1.6, 3.6733821614583335, 0.125, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShape Id="08c3e3eb-f2a8-4639-9553-6487d5716f27" absoluteBounds="0.5, 0.5, 1.6666666716337204, 0.94169108072916674">
+          <RootNodeMoniker Id="714205fa-5da5-40c3-bb57-00103f8e920d" />
+          <relativeChildShapes>
+            <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPort Id="5e3aba6d-e4c3-4919-b2c7-0e81b8463e72" absoluteBounds="0.74, 1.3916910807291667, 0.1, 0.1" />
+          </relativeChildShapes>
+          <nestedChildShapes>
+            <elementListCompartment Id="ba1b4d82-1745-4055-b896-5f49d397bfc5" absoluteBounds="0.515, 0.9, 1.6366666716337206, 0.44169108072916663" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ClassShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape Id="74923871-0eff-411b-af36-f0e5b18cb6ce" isExpanded="false" absoluteBounds="4.95, 2.9833821614583336, 1.35, 0.25">
+          <DomainRelationshipMoniker Name="/HeuristicLab.SimulationCore/ActivityReferencesTriggers" />
+          <relativeChildShapes />
+          <nestedChildShapes>
+            <elementListCompartment Id="fdb3a9ab-4a94-4b1b-9937-ab458b5caf2d" absoluteBounds="4.95, 2.9833821614583336, 0.125, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShape Id="b88256c0-56c8-4207-a8ee-f2a7b3962d83" absoluteBounds="3.85, 1.7416910807291668, 1.66666667163372, 0.94169108072916674">
+          <SourceRoleNodeMoniker Id="71eec76e-5ae0-461e-aaf3-749e0f6698cf" />
+          <relativeChildShapes>
+            <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPort Id="92f159ce-d604-410a-9a33-7ce89c433f54" absoluteBounds="4.09, 2.6333821614583335, 0.1, 0.1" />
+          </relativeChildShapes>
+          <nestedChildShapes>
+            <elementListCompartment Id="27a2a3ec-e391-42c0-b24d-d7b6eae8537d" absoluteBounds="3.865, 2.1416910807291671, 1.6366666716337206, 0.44169108072916663" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ClassShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShape Id="eea7a5b5-f189-48a7-ba71-ff3b012bd483" isExpanded="false" absoluteBounds="7.2000000000000011, 2.9833821614583336, 1.6666666716337204, 0.39">
+          <SourceRoleNodeMoniker Id="0f2ee6e8-45d0-4326-b56b-fa673c99e80a" />
+          <nestedChildShapes>
+            <elementListCompartment Id="e0fd05fd-e1da-4da8-8481-7ec42d4a3caa" absoluteBounds="7.2000000000000011, 2.9833821614583336, 0.125, 0.44169108072916663" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ClassShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape Id="9890b49a-8be1-4b5f-b861-99c088864329" isExpanded="false" absoluteBounds="4.95, 4.9150732421875, 1.35, 0.25">
+          <DomainRelationshipMoniker Name="/HeuristicLab.SimulationCore/ActionReferencesListeners" />
+          <relativeChildShapes />
+          <nestedChildShapes>
+            <elementListCompartment Id="b9c7e918-a896-4422-8988-60f88f4d6fe2" absoluteBounds="4.95, 4.9150732421875, 0.125, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShape Id="f034e53f-665b-467a-ab7f-10e8ae927fa8" absoluteBounds="3.85, 3.6733821614583335, 1.66666667163372, 0.94169108072916652">
+          <SourceRoleNodeMoniker Id="1ed95f2f-5ddc-4112-a69a-e323bd607951" />
+          <relativeChildShapes>
+            <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPort Id="853167d5-a408-4df7-b3d6-2d0c48145208" absoluteBounds="4.09, 4.5650732421875, 0.1, 0.1" />
+          </relativeChildShapes>
+          <nestedChildShapes>
+            <elementListCompartment Id="18556290-b620-4f79-bcfa-62c7edb21718" absoluteBounds="3.865, 4.0733821614583334, 1.6366666716337206, 0.44169108072916663" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ClassShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShape Id="0897638b-2ad7-45f2-96c9-87e8631a84d7" isExpanded="false" absoluteBounds="7.2000000000000011, 4.9150732421875, 1.6666666716337204, 0.39">
+          <SourceRoleNodeMoniker Id="d9adb7fa-a24f-4556-8ccb-d944bfc3d9db" />
+          <nestedChildShapes>
+            <elementListCompartment Id="c6f7af95-f1bb-467d-b6ec-cf15a2b8a673" absoluteBounds="7.2000000000000011, 4.9150732421875, 0.125, 0.44169108072916663" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ClassShape>
+      </nestedChildShapes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.DomainModelElements>
+    <microsoft.VisualStudio.Modeling.DslDesigner.DiagramElements Id="ba031793-4fd3-47d7-8ccc-4357046c44e9" absoluteBounds="9.1166666716337215, 0, 15.811525160372256, 8.5">
+      <nestedChildShapes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.DiagramShape Id="7e833abe-0374-43ec-bf37-b673b830c662" absoluteBounds="9.6166666716337215, 0.5, 1.6666666716337204, 0.7493896484375">
+          <RootNodeMoniker Id="d260ab68-90f8-4ea4-8f79-31a0bd15386f" />
+          <nestedChildShapes>
+            <elementListCompartment Id="ce3f96d3-7149-4266-b057-e31435ebb11d" absoluteBounds="9.631666671633722, 0.89999999999999991, 1.6366666716337206, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.DiagramShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.GeometryShapeShape Id="f02d1308-f61d-4723-9908-20eca2f4112e" absoluteBounds="9.6166666716337215, 1.4293896484375, 1.6666666716337204, 1.2010807291666665">
+          <RootNodeMoniker Id="230873ac-146e-42a6-8b0a-7310247babd9" />
+          <nestedChildShapes>
+            <elementListCompartment Id="a242a53d-6e56-43d2-a92a-8627fe889f9e" absoluteBounds="9.631666671633722, 1.8293896484375, 1.6366666716337206, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+            <elementListCompartment Id="c37574a5-51aa-413f-9375-8d91d69b8635" absoluteBounds="9.631666671633722, 2.088779296875, 1.6366666716337206, 0.44169108072916663" name="Decorators" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.GeometryShapeShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.GeometryShapeShape Id="a059249c-50b8-4270-a52a-a8567580aaeb" absoluteBounds="9.6166666716337215, 2.8104703776041666, 1.6666666716337204, 1.2010807291666663">
+          <RootNodeMoniker Id="4551406d-03a0-47e6-abbb-3fe40791316a" />
+          <nestedChildShapes>
+            <elementListCompartment Id="a3b12da0-a0b4-44a2-8a8f-4a8fafc4494c" absoluteBounds="9.631666671633722, 3.2104703776041665, 1.6366666716337206, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+            <elementListCompartment Id="594040de-3c1f-4059-9b22-251e0536a1b4" absoluteBounds="9.631666671633722, 3.4698600260416668, 1.6366666716337206, 0.44169108072916663" name="Decorators" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.GeometryShapeShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ConnectorShape Id="59c1b6d1-7b3b-4e29-a9c1-39a216747ad3" absoluteBounds="9.6166666716337215, 4.1915511067708326, 1.6666666716337204, 1.0087792968750002">
+          <RootNodeMoniker Id="d365a99b-fa16-4332-b558-2f8fdcf9b6b4" />
+          <nestedChildShapes>
+            <elementListCompartment Id="c7e91b16-c243-4561-a7e9-83362e60a125" absoluteBounds="9.631666671633722, 4.591551106770833, 1.6366666716337206, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+            <elementListCompartment Id="20771a19-3fa8-4817-92e4-80bea1a604ad" absoluteBounds="9.631666671633722, 4.8509407552083328, 1.6366666716337206, 0.2493896484375" name="Decorators" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ConnectorShape>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ConnectorShape Id="998b37c5-cbab-4cd1-a79d-1eba5745a4a7" absoluteBounds="9.6166666716337215, 5.3803304036458321, 1.6666666716337204, 1.0087792968750002">
+          <RootNodeMoniker Id="e1257067-d436-414c-9186-6629733deb8b" />
+          <nestedChildShapes>
+            <elementListCompartment Id="9dbe060a-af1c-4ee6-a0c7-45ff9f82fd19" absoluteBounds="9.631666671633722, 5.7803304036458325, 1.6366666716337206, 0.2493896484375" name="Properties" titleTextColor="Black" itemTextColor="Black" />
+            <elementListCompartment Id="2bf11c9c-2463-4cd0-9b06-f2715e4d4eb3" absoluteBounds="9.631666671633722, 6.0397200520833323, 1.6366666716337206, 0.2493896484375" name="Decorators" titleTextColor="Black" itemTextColor="Black" />
+          </nestedChildShapes>
+        </microsoft.VisualStudio.Modeling.DslDesigner.ConnectorShape>
+      </nestedChildShapes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.DiagramElements>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(1.6 : 1.91169108072917); (0.79 : 1.91169108072917); (0.79 : 1.49169108072917)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e206851f-31ea-4d49-a443-b8115b3e726e" multiplicitySymbol="0..*" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="c612cc37-4636-4781-8ac6-61931800d82d" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPortMoniker Id="5e3aba6d-e4c3-4919-b2c7-0e81b8463e72" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(2.95 : 1.91169108072917); (3.85 : 1.91169108072917)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e37b3710-5105-4dea-b3dc-08d96f12af2d" multiplicitySymbol="1..1" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="c612cc37-4636-4781-8ac6-61931800d82d" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShapeMoniker Id="b88256c0-56c8-4207-a8ee-f2a7b3962d83" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(1.6 : 3.84338216145833); (0.79 : 3.84338216145833); (0.79 : 1.49169108072917)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e206851f-31ea-4d49-a443-b8115b3e726e" multiplicitySymbol="0..*" treeOrder="1">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="92180b74-e577-4d9e-b491-b6b9554b1e83" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPortMoniker Id="5e3aba6d-e4c3-4919-b2c7-0e81b8463e72" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(2.95 : 3.84338216145833); (3.85 : 3.84338216145833)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e37b3710-5105-4dea-b3dc-08d96f12af2d" multiplicitySymbol="1..1" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="92180b74-e577-4d9e-b491-b6b9554b1e83" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShapeMoniker Id="f034e53f-665b-467a-ab7f-10e8ae927fa8" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(4.95 : 3.15338216145833); (4.14 : 3.15338216145833); (4.14 : 2.73338216145833)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e206851f-31ea-4d49-a443-b8115b3e726e" multiplicitySymbol="0..*" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="74923871-0eff-411b-af36-f0e5b18cb6ce" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPortMoniker Id="92f159ce-d604-410a-9a33-7ce89c433f54" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(6.3 : 3.15338216145833); (7.2 : 3.15338216145833)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e37b3710-5105-4dea-b3dc-08d96f12af2d" multiplicitySymbol="0..*" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="74923871-0eff-411b-af36-f0e5b18cb6ce" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShapeMoniker Id="eea7a5b5-f189-48a7-ba71-ff3b012bd483" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(4.95 : 5.0850732421875); (4.14 : 5.0850732421875); (4.14 : 4.6650732421875)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e206851f-31ea-4d49-a443-b8115b3e726e" multiplicitySymbol="0..*" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="9890b49a-8be1-4b5f-b861-99c088864329" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipPortMoniker Id="853167d5-a408-4df7-b3d6-2d0c48145208" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector edgePoints="[(6.3 : 5.0850732421875); (7.2 : 5.0850732421875)]" fixedFrom="Caller" fixedTo="Caller" TargetRelationshipDomainClassId="e37b3710-5105-4dea-b3dc-08d96f12af2d" multiplicitySymbol="0..*" treeOrder="0">
+      <relativeChildShapes />
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="9890b49a-8be1-4b5f-b861-99c088864329" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShapeMoniker Id="0897638b-2ad7-45f2-96c9-87e8631a84d7" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.RoleConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.MapConnector edgePoints="[(5.51666667163372 : 2.18608072916667); (9.61666667163372 : 2.18608072916667)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="a145acda-53a8-49fe-963a-6040813e7f8b">
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShapeMoniker Id="b88256c0-56c8-4207-a8ee-f2a7b3962d83" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.GeometryShapeShapeMoniker Id="f02d1308-f61d-4723-9908-20eca2f4112e" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.MapConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.MapConnector edgePoints="[(5.51666667163372 : 3.84246663411458); (9.61666667163372 : 3.84246663411458)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="a145acda-53a8-49fe-963a-6040813e7f8b">
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.ClassShapeMoniker Id="f034e53f-665b-467a-ab7f-10e8ae927fa8" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.GeometryShapeShapeMoniker Id="a059249c-50b8-4270-a52a-a8567580aaeb" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.MapConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.MapConnector edgePoints="[(6.3 : 3.23338216145833); (9.61666667163372 : 4.19155110677083)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="f17c6989-7cd3-462b-93c7-9418130502e0">
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="74923871-0eff-411b-af36-f0e5b18cb6ce" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.ConnectorShapeMoniker Id="59c1b6d1-7b3b-4e29-a9c1-39a216747ad3" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.MapConnector>
+    <microsoft.VisualStudio.Modeling.DslDesigner.MapConnector edgePoints="[(6.3 : 5.1650732421875); (9.61666667163372 : 5.38033040364583)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="f17c6989-7cd3-462b-93c7-9418130502e0">
+      <nodes>
+        <microsoft.VisualStudio.Modeling.DslDesigner.RelationshipShapeMoniker Id="9890b49a-8be1-4b5f-b861-99c088864329" />
+        <microsoft.VisualStudio.Modeling.DslDesigner.ConnectorShapeMoniker Id="998b37c5-cbab-4cd1-a79d-1eba5745a4a7" />
+      </nodes>
+    </microsoft.VisualStudio.Modeling.DslDesigner.MapConnector>
+  </nestedChildShapes>
+  <diagramState>
+    <DslDesignerDiagramState>
+      <DomainModelElementTree>
+        <DslDesignerDiagramTree>
+          <Roots>
+            <RootNode Id="714205fa-5da5-40c3-bb57-00103f8e920d">
+              <Class>
+                <DomainClassMoniker Name="/HeuristicLab.SimulationCore/SimulationModel" />
+              </Class>
+            </RootNode>
+          </Roots>
+          <Arcs>
+            <SourceRoleNode Id="71eec76e-5ae0-461e-aaf3-749e0f6698cf">
+              <Role>
+                <DomainRoleMoniker Name="/HeuristicLab.SimulationCore/SimulationModelHasActivities/SimulationModel" />
+              </Role>
+            </SourceRoleNode>
+            <SourceRoleNode Id="1ed95f2f-5ddc-4112-a69a-e323bd607951">
+              <Role>
+                <DomainRoleMoniker Name="/HeuristicLab.SimulationCore/SimulationModelHasActions/SimulationModel" />
+              </Role>
+            </SourceRoleNode>
+            <SourceRoleNode Id="0f2ee6e8-45d0-4326-b56b-fa673c99e80a" IsLeaf="true">
+              <Role>
+                <DomainRoleMoniker Name="/HeuristicLab.SimulationCore/ActivityReferencesTriggers/Activity" />
+              </Role>
+            </SourceRoleNode>
+            <SourceRoleNode Id="d9adb7fa-a24f-4556-8ccb-d944bfc3d9db" IsLeaf="true">
+              <Role>
+                <DomainRoleMoniker Name="/HeuristicLab.SimulationCore/ActionReferencesListeners/Action" />
+              </Role>
+            </SourceRoleNode>
+          </Arcs>
+        </DslDesignerDiagramTree>
+      </DomainModelElementTree>
+      <DiagramElementTree>
+        <DslDesignerDiagramTree>
+          <Roots>
+            <RootNode Id="d260ab68-90f8-4ea4-8f79-31a0bd15386f">
+              <Class>
+                <DiagramMoniker Name="/HeuristicLab.SimulationCore/HLSimDiagram" />
+              </Class>
+            </RootNode>
+            <RootNode Id="230873ac-146e-42a6-8b0a-7310247babd9">
+              <Class>
+                <GeometryShapeMoniker Name="/HeuristicLab.SimulationCore/ActivityShape" />
+              </Class>
+            </RootNode>
+            <RootNode Id="4551406d-03a0-47e6-abbb-3fe40791316a">
+              <Class>
+                <GeometryShapeMoniker Name="/HeuristicLab.SimulationCore/ActionShape" />
+              </Class>
+            </RootNode>
+            <RootNode Id="d365a99b-fa16-4332-b558-2f8fdcf9b6b4">
+              <Class>
+                <ConnectorMoniker Name="/HeuristicLab.SimulationCore/Trigger" />
+              </Class>
+            </RootNode>
+            <RootNode Id="e1257067-d436-414c-9186-6629733deb8b">
+              <Class>
+                <ConnectorMoniker Name="/HeuristicLab.SimulationCore/Listener" />
+              </Class>
+            </RootNode>
+          </Roots>
+        </DslDesignerDiagramTree>
+      </DiagramElementTree>
+    </DslDesignerDiagramState>
+  </diagramState>
+</microsoft.VisualStudio.Modeling.DslDesigner.DslDesignerDiagram>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ConnectionBuilders.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ConnectionBuilders.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ConnectionBuilders.cs	(revision 10525)
@@ -0,0 +1,594 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// ConnectionBuilder class to provide logic for constructing connections between elements.
+	/// </summary>
+	public static partial class ActivityReferencesTriggersBuilder
+	{
+		#region Accept Connection Methods
+		/// <summary>
+		/// Test whether a given model element is acceptable to this ConnectionBuilder as the source of a connection.
+		/// </summary>
+		/// <param name="candidate">The model element to test.</param>
+		/// <returns>Whether the element can be used as the source of a connection.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
+		{
+			if (candidate == null) return false;
+			else if (candidate is global::HeuristicLab.SimulationCore.Activity)
+			{ 
+				return true;
+			}
+			else
+				return false;
+		}
+
+		/// <summary>
+		/// Test whether a given model element is acceptable to this ConnectionBuilder as the target of a connection.
+		/// </summary>
+		/// <param name="candidate">The model element to test.</param>
+		/// <returns>Whether the element can be used as the target of a connection.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
+		{
+			if (candidate == null) return false;
+			else if (candidate is global::HeuristicLab.SimulationCore.Action)
+			{ 
+				return true;
+			}
+			else
+				return false;
+		}
+		
+		/// <summary>
+		/// Test whether a given pair of model elements are acceptable to this ConnectionBuilder as the source and target of a connection
+		/// </summary>
+		/// <param name="candidateSource">The model element to test as a source</param>
+		/// <param name="candidateTarget">The model element to test as a target</param>
+		/// <returns>Whether the elements can be used as the source and target of a connection</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		public static bool CanAcceptSourceAndTarget(DslModeling::ModelElement candidateSource, DslModeling::ModelElement candidateTarget)
+		{
+			// Accepts null, null; source, null; source, target but NOT null, target
+			if (candidateSource == null)
+			{
+				if (candidateTarget != null)
+				{
+					throw new global::System.ArgumentNullException("candidateSource");
+				}
+				else // Both null
+				{
+					return false;
+				}
+			}
+			bool acceptSource = CanAcceptSource(candidateSource);
+			// If the source wasn't accepted then there's no point checking targets.
+			// If there is no target then the source controls the accept.
+			if (!acceptSource || candidateTarget == null)
+			{
+				return acceptSource;
+			}
+			else // Check combinations
+			{
+				if (candidateSource is global::HeuristicLab.SimulationCore.Activity)
+				{
+					if (candidateTarget is global::HeuristicLab.SimulationCore.Action)
+					{
+						global::HeuristicLab.SimulationCore.Activity sourceActivity = (global::HeuristicLab.SimulationCore.Activity)candidateSource;
+						global::HeuristicLab.SimulationCore.Action targetAction = (global::HeuristicLab.SimulationCore.Action)candidateTarget;
+						if(targetAction == null || sourceActivity == null || global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.GetLinks(sourceActivity, targetAction).Count > 0) return false;
+						return true;
+					}
+				}
+				
+			}
+			return false;
+		}
+		#endregion
+
+		#region Connection Methods
+		/// <summary>
+		/// Make a connection between the given pair of source and target elements
+		/// </summary>
+		/// <param name="source">The model element to use as the source of the connection</param>
+		/// <param name="target">The model element to use as the target of the connection</param>
+		/// <returns>A link representing the created connection</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		public static DslModeling::ElementLink Connect(DslModeling::ModelElement source, DslModeling::ModelElement target)
+		{
+			if (source == null)
+			{
+				throw new global::System.ArgumentNullException("source");
+			}
+			if (target == null)
+			{
+				throw new global::System.ArgumentNullException("target");
+			}
+			
+			if (CanAcceptSourceAndTarget(source, target))
+			{
+				if (source is global::HeuristicLab.SimulationCore.Activity)
+				{
+					if (target is global::HeuristicLab.SimulationCore.Action)
+					{
+						global::HeuristicLab.SimulationCore.Activity sourceAccepted = (global::HeuristicLab.SimulationCore.Activity)source;
+						global::HeuristicLab.SimulationCore.Action targetAccepted = (global::HeuristicLab.SimulationCore.Action)target;
+						DslModeling::ElementLink result = new global::HeuristicLab.SimulationCore.ActivityReferencesTriggers(sourceAccepted, targetAccepted);
+						if (DslModeling::DomainClassInfo.HasNameProperty(result))
+						{
+							DslModeling::DomainClassInfo.SetUniqueName(result);
+						}
+						return result;
+					}
+				}
+				
+			}
+			global::System.Diagnostics.Debug.Fail("Having agreed that the connection can be accepted we should never fail to make one.");
+			throw new global::System.InvalidOperationException();
+		}
+		#endregion
+ 	}
+	/// <summary>
+	/// ConnectionBuilder class to provide logic for constructing connections between elements.
+	/// </summary>
+	public static partial class ActionReferencesListenersBuilder
+	{
+		#region Accept Connection Methods
+		/// <summary>
+		/// Test whether a given model element is acceptable to this ConnectionBuilder as the source of a connection.
+		/// </summary>
+		/// <param name="candidate">The model element to test.</param>
+		/// <returns>Whether the element can be used as the source of a connection.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
+		{
+			if (candidate == null) return false;
+			else if (candidate is global::HeuristicLab.SimulationCore.Action)
+			{ 
+				return true;
+			}
+			else
+				return false;
+		}
+
+		/// <summary>
+		/// Test whether a given model element is acceptable to this ConnectionBuilder as the target of a connection.
+		/// </summary>
+		/// <param name="candidate">The model element to test.</param>
+		/// <returns>Whether the element can be used as the target of a connection.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
+		{
+			if (candidate == null) return false;
+			else if (candidate is global::HeuristicLab.SimulationCore.Activity)
+			{ 
+				return true;
+			}
+			else
+				return false;
+		}
+		
+		/// <summary>
+		/// Test whether a given pair of model elements are acceptable to this ConnectionBuilder as the source and target of a connection
+		/// </summary>
+		/// <param name="candidateSource">The model element to test as a source</param>
+		/// <param name="candidateTarget">The model element to test as a target</param>
+		/// <returns>Whether the elements can be used as the source and target of a connection</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		public static bool CanAcceptSourceAndTarget(DslModeling::ModelElement candidateSource, DslModeling::ModelElement candidateTarget)
+		{
+			// Accepts null, null; source, null; source, target but NOT null, target
+			if (candidateSource == null)
+			{
+				if (candidateTarget != null)
+				{
+					throw new global::System.ArgumentNullException("candidateSource");
+				}
+				else // Both null
+				{
+					return false;
+				}
+			}
+			bool acceptSource = CanAcceptSource(candidateSource);
+			// If the source wasn't accepted then there's no point checking targets.
+			// If there is no target then the source controls the accept.
+			if (!acceptSource || candidateTarget == null)
+			{
+				return acceptSource;
+			}
+			else // Check combinations
+			{
+				if (candidateSource is global::HeuristicLab.SimulationCore.Action)
+				{
+					if (candidateTarget is global::HeuristicLab.SimulationCore.Activity)
+					{
+						global::HeuristicLab.SimulationCore.Action sourceAction = (global::HeuristicLab.SimulationCore.Action)candidateSource;
+						global::HeuristicLab.SimulationCore.Activity targetActivity = (global::HeuristicLab.SimulationCore.Activity)candidateTarget;
+						if(targetActivity == null || sourceAction == null || global::HeuristicLab.SimulationCore.ActionReferencesListeners.GetLinks(sourceAction, targetActivity).Count > 0) return false;
+						return true;
+					}
+				}
+				
+			}
+			return false;
+		}
+		#endregion
+
+		#region Connection Methods
+		/// <summary>
+		/// Make a connection between the given pair of source and target elements
+		/// </summary>
+		/// <param name="source">The model element to use as the source of the connection</param>
+		/// <param name="target">The model element to use as the target of the connection</param>
+		/// <returns>A link representing the created connection</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		public static DslModeling::ElementLink Connect(DslModeling::ModelElement source, DslModeling::ModelElement target)
+		{
+			if (source == null)
+			{
+				throw new global::System.ArgumentNullException("source");
+			}
+			if (target == null)
+			{
+				throw new global::System.ArgumentNullException("target");
+			}
+			
+			if (CanAcceptSourceAndTarget(source, target))
+			{
+				if (source is global::HeuristicLab.SimulationCore.Action)
+				{
+					if (target is global::HeuristicLab.SimulationCore.Activity)
+					{
+						global::HeuristicLab.SimulationCore.Action sourceAccepted = (global::HeuristicLab.SimulationCore.Action)source;
+						global::HeuristicLab.SimulationCore.Activity targetAccepted = (global::HeuristicLab.SimulationCore.Activity)target;
+						DslModeling::ElementLink result = new global::HeuristicLab.SimulationCore.ActionReferencesListeners(sourceAccepted, targetAccepted);
+						if (DslModeling::DomainClassInfo.HasNameProperty(result))
+						{
+							DslModeling::DomainClassInfo.SetUniqueName(result);
+						}
+						return result;
+					}
+				}
+				
+			}
+			global::System.Diagnostics.Debug.Fail("Having agreed that the connection can be accepted we should never fail to make one.");
+			throw new global::System.InvalidOperationException();
+		}
+		#endregion
+ 	}
+ 	
+ 	/// <summary>
+	/// Handles interaction between the ConnectionBuilder and the corresponding ConnectionTool.
+	/// </summary>
+	internal partial class TriggerConnectAction : DslDiagrams::ConnectAction
+	{
+		private DslDiagrams::ConnectionType[] connectionTypes;
+		
+		/// <summary>
+		/// Constructs a new TriggerConnectAction for the given Diagram.
+		/// </summary>
+		public TriggerConnectAction(DslDiagrams::Diagram diagram): base(diagram, true) 
+		{
+		}
+		
+		/// <summary>
+		/// Gets the cursor corresponding to the given mouse position.
+		/// </summary>
+		/// <remarks>
+		/// Changes the cursor to Cursors.No before the first mouse click if the source shape is not valid.
+		/// </remarks>
+		public override global::System.Windows.Forms.Cursor GetCursor(global::System.Windows.Forms.Cursor currentCursor, DslDiagrams::DiagramClientView diagramClientView, DslDiagrams::PointD mousePosition)
+		{
+			if (this.MouseDownHitShape == null && currentCursor != global::System.Windows.Forms.Cursors.No)
+			{
+				DslDiagrams::DiagramHitTestInfo hitTestInfo = new DslDiagrams::DiagramHitTestInfo(diagramClientView);
+				this.Diagram.DoHitTest(mousePosition, hitTestInfo);
+				DslDiagrams::ShapeElement shape = hitTestInfo.HitDiagramItem.Shape;
+
+				DslDiagrams::ConnectionType connectionType = GetConnectionTypes(shape, null)[0];
+				string warningString = string.Empty;
+				if (!connectionType.CanCreateConnection(shape, null, ref warningString))
+				{
+					return global::System.Windows.Forms.Cursors.No;
+				}
+			}
+			return base.GetCursor(currentCursor, diagramClientView, mousePosition);
+		}
+		
+		
+		/// <summary>
+		/// Returns the TriggerConnectionType associated with this action.
+		/// </summary>
+		protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
+		{
+			if(this.connectionTypes == null)
+			{
+				this.connectionTypes = new DslDiagrams::ConnectionType[] { new TriggerConnectionType() };
+			}
+			
+			return this.connectionTypes;
+		}
+		
+		private partial class TriggerConnectionTypeBase : DslDiagrams::ConnectionType
+		{
+			/// <summary>
+			/// Constructs a new the TriggerConnectionType with the given ConnectionBuilder.
+			/// </summary>
+			protected TriggerConnectionTypeBase() : base() {}
+			
+			private static DslDiagrams::ShapeElement RemovePassThroughShapes(DslDiagrams::ShapeElement shape)
+			{
+				if (shape is DslDiagrams::Compartment)
+				{
+					return shape.ParentShape;
+				}
+				DslDiagrams::SwimlaneShape swimlane = shape as DslDiagrams::SwimlaneShape;
+				if (swimlane != null && swimlane.ForwardDragDropToParent)
+				{
+					return shape.ParentShape;
+				}
+				return shape;
+			}
+						
+			/// <summary>
+			/// Called by the base ConnectAction class to determine if the given shapes can be connected.
+			/// </summary>
+			/// <remarks>
+			/// This implementation delegates calls to the ConnectionBuilder ActivityReferencesTriggersBuilder.
+			/// </remarks>
+			public override bool CanCreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, ref string connectionWarning)
+			{
+				bool canConnect = true;
+				
+				if(sourceShapeElement == null) throw new global::System.ArgumentNullException("sourceShapeElement");
+				sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
+				DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;
+				if(sourceElement == null) sourceElement = sourceShapeElement;
+				
+				DslModeling::ModelElement targetElement = null;
+				if (targetShapeElement != null)
+				{
+					targetShapeElement = RemovePassThroughShapes(targetShapeElement);
+					targetElement = targetShapeElement.ModelElement;
+					if(targetElement == null) targetElement = targetShapeElement;
+			
+				}
+
+				// base.CanCreateConnection must be called to check whether existing Locks prevent this link from getting created.	
+				canConnect = base.CanCreateConnection(sourceShapeElement, targetShapeElement, ref connectionWarning);
+				if (canConnect)
+				{				
+					if(targetShapeElement == null)
+					{
+						return ActivityReferencesTriggersBuilder.CanAcceptSource(sourceElement);
+					}
+					else
+					{				
+						return ActivityReferencesTriggersBuilder.CanAcceptSourceAndTarget(sourceElement, targetElement);
+					}
+				}
+				else
+				{
+					//return false
+					return canConnect;
+				}
+			}
+						
+			/// <summary>
+			/// Called by the base ConnectAction class to ask whether the given source and target are valid.
+			/// </summary>
+			/// <remarks>
+			/// Always return true here, to give CanCreateConnection a chance to decide.
+			/// </remarks>
+			public override bool IsValidSourceAndTarget(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
+			{
+				return true;
+			}
+			
+			/// <summary>
+			/// Called by the base ConnectAction class to create the underlying relationship.
+			/// </summary>
+			/// <remarks>
+			/// This implementation delegates calls to the ConnectionBuilder ActivityReferencesTriggersBuilder.
+			/// </remarks>
+			public override void CreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, DslDiagrams::PaintFeedbackArgs paintFeedbackArgs)
+			{
+				if(sourceShapeElement == null) throw new global::System.ArgumentNullException("sourceShapeElement");
+				if(targetShapeElement == null) throw new global::System.ArgumentNullException("targetShapeElement");
+				
+				sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
+				targetShapeElement = RemovePassThroughShapes(targetShapeElement);
+				
+				DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;
+				if(sourceElement == null) sourceElement = sourceShapeElement;
+				DslModeling::ModelElement targetElement = targetShapeElement.ModelElement;
+				if(targetElement == null) targetElement = targetShapeElement;
+				ActivityReferencesTriggersBuilder.Connect(sourceElement, targetElement);
+			}
+		}
+		
+		private partial class TriggerConnectionType : TriggerConnectionTypeBase
+		{
+			/// <summary>
+			/// Constructs a new the TriggerConnectionType with the given ConnectionBuilder.
+			/// </summary>
+			public TriggerConnectionType() : base() {}
+		}
+	}
+ 	
+ 	/// <summary>
+	/// Handles interaction between the ConnectionBuilder and the corresponding ConnectionTool.
+	/// </summary>
+	internal partial class ListenerConnectAction : DslDiagrams::ConnectAction
+	{
+		private DslDiagrams::ConnectionType[] connectionTypes;
+		
+		/// <summary>
+		/// Constructs a new ListenerConnectAction for the given Diagram.
+		/// </summary>
+		public ListenerConnectAction(DslDiagrams::Diagram diagram): base(diagram, true) 
+		{
+		}
+		
+		/// <summary>
+		/// Gets the cursor corresponding to the given mouse position.
+		/// </summary>
+		/// <remarks>
+		/// Changes the cursor to Cursors.No before the first mouse click if the source shape is not valid.
+		/// </remarks>
+		public override global::System.Windows.Forms.Cursor GetCursor(global::System.Windows.Forms.Cursor currentCursor, DslDiagrams::DiagramClientView diagramClientView, DslDiagrams::PointD mousePosition)
+		{
+			if (this.MouseDownHitShape == null && currentCursor != global::System.Windows.Forms.Cursors.No)
+			{
+				DslDiagrams::DiagramHitTestInfo hitTestInfo = new DslDiagrams::DiagramHitTestInfo(diagramClientView);
+				this.Diagram.DoHitTest(mousePosition, hitTestInfo);
+				DslDiagrams::ShapeElement shape = hitTestInfo.HitDiagramItem.Shape;
+
+				DslDiagrams::ConnectionType connectionType = GetConnectionTypes(shape, null)[0];
+				string warningString = string.Empty;
+				if (!connectionType.CanCreateConnection(shape, null, ref warningString))
+				{
+					return global::System.Windows.Forms.Cursors.No;
+				}
+			}
+			return base.GetCursor(currentCursor, diagramClientView, mousePosition);
+		}
+		
+		
+		/// <summary>
+		/// Returns the ListenerConnectionType associated with this action.
+		/// </summary>
+		protected override DslDiagrams::ConnectionType[] GetConnectionTypes(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
+		{
+			if(this.connectionTypes == null)
+			{
+				this.connectionTypes = new DslDiagrams::ConnectionType[] { new ListenerConnectionType() };
+			}
+			
+			return this.connectionTypes;
+		}
+		
+		private partial class ListenerConnectionTypeBase : DslDiagrams::ConnectionType
+		{
+			/// <summary>
+			/// Constructs a new the ListenerConnectionType with the given ConnectionBuilder.
+			/// </summary>
+			protected ListenerConnectionTypeBase() : base() {}
+			
+			private static DslDiagrams::ShapeElement RemovePassThroughShapes(DslDiagrams::ShapeElement shape)
+			{
+				if (shape is DslDiagrams::Compartment)
+				{
+					return shape.ParentShape;
+				}
+				DslDiagrams::SwimlaneShape swimlane = shape as DslDiagrams::SwimlaneShape;
+				if (swimlane != null && swimlane.ForwardDragDropToParent)
+				{
+					return shape.ParentShape;
+				}
+				return shape;
+			}
+						
+			/// <summary>
+			/// Called by the base ConnectAction class to determine if the given shapes can be connected.
+			/// </summary>
+			/// <remarks>
+			/// This implementation delegates calls to the ConnectionBuilder ActionReferencesListenersBuilder.
+			/// </remarks>
+			public override bool CanCreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, ref string connectionWarning)
+			{
+				bool canConnect = true;
+				
+				if(sourceShapeElement == null) throw new global::System.ArgumentNullException("sourceShapeElement");
+				sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
+				DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;
+				if(sourceElement == null) sourceElement = sourceShapeElement;
+				
+				DslModeling::ModelElement targetElement = null;
+				if (targetShapeElement != null)
+				{
+					targetShapeElement = RemovePassThroughShapes(targetShapeElement);
+					targetElement = targetShapeElement.ModelElement;
+					if(targetElement == null) targetElement = targetShapeElement;
+			
+				}
+
+				// base.CanCreateConnection must be called to check whether existing Locks prevent this link from getting created.	
+				canConnect = base.CanCreateConnection(sourceShapeElement, targetShapeElement, ref connectionWarning);
+				if (canConnect)
+				{				
+					if(targetShapeElement == null)
+					{
+						return ActionReferencesListenersBuilder.CanAcceptSource(sourceElement);
+					}
+					else
+					{				
+						return ActionReferencesListenersBuilder.CanAcceptSourceAndTarget(sourceElement, targetElement);
+					}
+				}
+				else
+				{
+					//return false
+					return canConnect;
+				}
+			}
+						
+			/// <summary>
+			/// Called by the base ConnectAction class to ask whether the given source and target are valid.
+			/// </summary>
+			/// <remarks>
+			/// Always return true here, to give CanCreateConnection a chance to decide.
+			/// </remarks>
+			public override bool IsValidSourceAndTarget(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement)
+			{
+				return true;
+			}
+			
+			/// <summary>
+			/// Called by the base ConnectAction class to create the underlying relationship.
+			/// </summary>
+			/// <remarks>
+			/// This implementation delegates calls to the ConnectionBuilder ActionReferencesListenersBuilder.
+			/// </remarks>
+			public override void CreateConnection(DslDiagrams::ShapeElement sourceShapeElement, DslDiagrams::ShapeElement targetShapeElement, DslDiagrams::PaintFeedbackArgs paintFeedbackArgs)
+			{
+				if(sourceShapeElement == null) throw new global::System.ArgumentNullException("sourceShapeElement");
+				if(targetShapeElement == null) throw new global::System.ArgumentNullException("targetShapeElement");
+				
+				sourceShapeElement = RemovePassThroughShapes(sourceShapeElement);
+				targetShapeElement = RemovePassThroughShapes(targetShapeElement);
+				
+				DslModeling::ModelElement sourceElement = sourceShapeElement.ModelElement;
+				if(sourceElement == null) sourceElement = sourceShapeElement;
+				DslModeling::ModelElement targetElement = targetShapeElement.ModelElement;
+				if(targetElement == null) targetElement = targetShapeElement;
+				ActionReferencesListenersBuilder.Connect(sourceElement, targetElement);
+			}
+		}
+		
+		private partial class ListenerConnectionType : ListenerConnectionTypeBase
+		{
+			/// <summary>
+			/// Constructs a new the ListenerConnectionType with the given ConnectionBuilder.
+			/// </summary>
+			public ListenerConnectionType() : base() {}
+		}
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ConnectionBuilders.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ConnectionBuilders.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ConnectionBuilders.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\ConnectionBuilder.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Connectors.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Connectors.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Connectors.cs	(revision 10525)
@@ -0,0 +1,279 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass Trigger
+	/// Description for HeuristicLab.SimulationCore.Trigger
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.Trigger.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.Trigger.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainObjectId("ff67e59a-021e-472d-8fdc-0298ee26fe8e")]
+	public partial class Trigger : DslDiagrams::BinaryLinkShape
+	{
+		#region DiagramElement boilerplate
+		private static DslDiagrams::StyleSet classStyleSet;
+		private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
+		private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;
+		
+		/// <summary>
+		/// Per-class style set for this shape.
+		/// </summary>
+		protected override DslDiagrams::StyleSet ClassStyleSet
+		{
+			get
+			{
+				if (classStyleSet == null)
+				{
+					classStyleSet = CreateClassStyleSet();
+				}
+				return classStyleSet;
+			}
+		}
+		
+		/// <summary>
+		/// Per-class ShapeFields for this shape.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
+		{
+			get
+			{
+				if (shapeFields == null)
+				{
+					shapeFields = CreateShapeFields();
+				}
+				return shapeFields;
+			}
+		}
+		
+		/// <summary>
+		/// Event fired when decorator initialization is complete for this shape type.
+		/// </summary>
+		public static event global::System.EventHandler DecoratorsInitialized;
+		
+		/// <summary>
+		/// List containing decorators used by this type.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
+		{
+			get 
+			{
+				if(decorators == null)
+				{
+					decorators = CreateDecorators();
+					
+					// fire this event to allow the diagram to initialize decorator mappings for this shape type.
+					if(DecoratorsInitialized != null)
+					{
+						DecoratorsInitialized(this, global::System.EventArgs.Empty);
+					}
+				}
+				
+				return decorators; 
+			}
+		}
+		
+		/// <summary>
+		/// Finds a decorator associated with Trigger.
+		/// </summary>
+		public static DslDiagrams::Decorator FindTriggerDecorator(string decoratorName)
+		{	
+			if(decorators == null) return null;
+			return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
+		}
+		
+		#endregion
+		
+		#region Connector styles
+		/// <summary>
+		/// Initializes resources associated with this connector instance.
+		/// </summary>
+		protected override void InitializeInstanceResources()
+		{
+			base.InitializeInstanceResources();
+			this.SetDecorators(null, new DslDiagrams::SizeD(0.1,0.1), DslDiagrams::LinkDecorator.DecoratorEmptyArrow, new DslDiagrams::SizeD(0.1,0.1), false);
+		}
+		
+		#endregion
+		
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// Trigger domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xff67e59a, 0x021e, 0x472d, 0x8f, 0xdc, 0x02, 0x98, 0xee, 0x26, 0xfe, 0x8e);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Trigger(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Trigger(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass Listener
+	/// Description for HeuristicLab.SimulationCore.Listener
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.Listener.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.Listener.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainObjectId("84ebcd29-fe73-4fa2-8e01-ce82534fb35c")]
+	public partial class Listener : DslDiagrams::BinaryLinkShape
+	{
+		#region DiagramElement boilerplate
+		private static DslDiagrams::StyleSet classStyleSet;
+		private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
+		private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;
+		
+		/// <summary>
+		/// Per-class style set for this shape.
+		/// </summary>
+		protected override DslDiagrams::StyleSet ClassStyleSet
+		{
+			get
+			{
+				if (classStyleSet == null)
+				{
+					classStyleSet = CreateClassStyleSet();
+				}
+				return classStyleSet;
+			}
+		}
+		
+		/// <summary>
+		/// Per-class ShapeFields for this shape.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
+		{
+			get
+			{
+				if (shapeFields == null)
+				{
+					shapeFields = CreateShapeFields();
+				}
+				return shapeFields;
+			}
+		}
+		
+		/// <summary>
+		/// Event fired when decorator initialization is complete for this shape type.
+		/// </summary>
+		public static event global::System.EventHandler DecoratorsInitialized;
+		
+		/// <summary>
+		/// List containing decorators used by this type.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
+		{
+			get 
+			{
+				if(decorators == null)
+				{
+					decorators = CreateDecorators();
+					
+					// fire this event to allow the diagram to initialize decorator mappings for this shape type.
+					if(DecoratorsInitialized != null)
+					{
+						DecoratorsInitialized(this, global::System.EventArgs.Empty);
+					}
+				}
+				
+				return decorators; 
+			}
+		}
+		
+		/// <summary>
+		/// Finds a decorator associated with Listener.
+		/// </summary>
+		public static DslDiagrams::Decorator FindListenerDecorator(string decoratorName)
+		{	
+			if(decorators == null) return null;
+			return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
+		}
+		
+		#endregion
+		
+		#region Connector styles
+		/// <summary>
+		/// Initializes style set resources for this shape type
+		/// </summary>
+		/// <param name="classStyleSet">The style set for this shape class</param>
+		protected override void InitializeResources(DslDiagrams::StyleSet classStyleSet)
+		{
+			base.InitializeResources(classStyleSet);
+			
+			// Line pen settings for this connector.
+			DslDiagrams::PenSettings linePen = new DslDiagrams::PenSettings();
+			linePen.DashStyle = global::System.Drawing.Drawing2D.DashStyle.Dot;
+			classStyleSet.OverridePen(DslDiagrams::DiagramPens.ConnectionLine, linePen);
+		}
+		
+		/// <summary>
+		/// Initializes resources associated with this connector instance.
+		/// </summary>
+		protected override void InitializeInstanceResources()
+		{
+			base.InitializeInstanceResources();
+			this.SetDecorators(null, new DslDiagrams::SizeD(0.1,0.1), DslDiagrams::LinkDecorator.DecoratorEmptyArrow, new DslDiagrams::SizeD(0.1,0.1), false);
+		}
+		
+		#endregion
+		
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// Listener domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x84ebcd29, 0xfe73, 0x4fa2, 0x8e, 0x01, 0xce, 0x82, 0x53, 0x4f, 0xb3, 0x5c);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Listener(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Listener(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Connectors.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Connectors.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Connectors.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\Connectors.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Diagram.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Diagram.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Diagram.cs	(revision 10525)
@@ -0,0 +1,625 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+[module: global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "HeuristicLab.SimulationCore.HLSimDiagram")]
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass HLSimDiagram
+	/// Description for HeuristicLab.SimulationCore.HLSimDiagram
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.HLSimDiagram.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.HLSimDiagram.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainObjectId("cf1c9f0b-eb8e-4d36-9fcc-6cd2455f9cba")]
+	public partial class HLSimDiagram : DslDiagrams::Diagram
+	{
+		#region Diagram boilerplate
+		private static DslDiagrams::StyleSet classStyleSet;
+		private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
+		/// <summary>
+		/// Per-class style set for this shape.
+		/// </summary>
+		protected override DslDiagrams::StyleSet ClassStyleSet
+		{
+			get
+			{
+				if (classStyleSet == null)
+				{
+					classStyleSet = CreateClassStyleSet();
+				}
+				return classStyleSet;
+			}
+		}
+		
+		/// <summary>
+		/// Per-class ShapeFields for this shape
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
+		{
+			get
+			{
+				if (shapeFields == null)
+				{
+					shapeFields = CreateShapeFields();
+				}
+				return shapeFields;
+			}
+		}
+		#endregion
+		#region Toolbox filters
+		private static global::System.ComponentModel.ToolboxItemFilterAttribute[] toolboxFilters = new global::System.ComponentModel.ToolboxItemFilterAttribute[] {
+					new global::System.ComponentModel.ToolboxItemFilterAttribute(global::HeuristicLab.SimulationCore.HLSimToolboxHelperBase.ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) };
+		
+		/// <summary>
+		/// Toolbox item filter attributes for this diagram.
+		/// </summary>
+		public override global::System.Collections.ICollection TargetToolboxItemFilterAttributes
+		{
+			get
+			{
+				return toolboxFilters;
+			}
+		}
+		#endregion
+		#region Auto-placement
+		/// <summary>
+		/// Indicate that child shapes should added through view fixup should be placed automatically.
+		/// </summary>
+		public override bool ShouldAutoPlaceChildShapes
+		{
+			get
+			{
+				return true;
+			}
+		}
+		#endregion
+		#region Shape mapping
+		/// <summary>
+		/// Called during view fixup to ask the parent whether a shape should be created for the given child element.
+		/// </summary>
+		/// <remarks>
+		/// Always return true, since we assume there is only one diagram per model file for DSL scenarios.
+		/// </remarks>
+		protected override bool ShouldAddShapeForElement(DslModeling::ModelElement element)
+		{
+			return true;
+		}
+		
+		/// <summary>
+		/// Called during view fixup to configure the given child element, after it has been created.
+		/// </summary>
+		/// <remarks>
+		/// Custom code for choosing the shapes attached to either end of a connector is called from here.
+		/// </remarks>
+		protected override void OnChildConfiguring(DslDiagrams::ShapeElement child, bool createdDuringViewFixup)
+		{
+			DslDiagrams::NodeShape sourceShape;
+			DslDiagrams::NodeShape targetShape;
+			DslDiagrams::BinaryLinkShape connector = child as DslDiagrams::BinaryLinkShape;
+			if(connector == null)
+			{
+				base.OnChildConfiguring(child, createdDuringViewFixup);
+				return;
+			}
+			this.GetSourceAndTargetForConnector(connector, out sourceShape, out targetShape);
+			
+			global::System.Diagnostics.Debug.Assert(sourceShape != null && targetShape != null, "Unable to find source and target shapes for connector.");
+			connector.Connect(sourceShape, targetShape);
+		}
+		
+		/// <summary>
+		/// helper method to find the shapes for either end of a connector, including calling the user's custom code
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		internal void GetSourceAndTargetForConnector(DslDiagrams::BinaryLinkShape connector, out DslDiagrams::NodeShape sourceShape, out DslDiagrams::NodeShape targetShape)
+		{
+			sourceShape = null;
+			targetShape = null;
+			
+			if (sourceShape == null || targetShape == null)
+			{
+				DslDiagrams::NodeShape[] endShapes = GetEndShapesForConnector(connector);
+				if(sourceShape == null)
+				{
+					sourceShape = endShapes[0];
+				}
+				if(targetShape == null)
+				{
+					targetShape = endShapes[1];
+				}
+			}
+		}
+		
+		/// <summary>
+		/// Helper method to find shapes for either end of a connector by looking for shapes associated with either end of the relationship mapped to the connector.
+		/// </summary>
+		private DslDiagrams::NodeShape[] GetEndShapesForConnector(DslDiagrams::BinaryLinkShape connector)
+		{
+			DslModeling::ElementLink link = connector.ModelElement as DslModeling::ElementLink;
+			DslDiagrams::NodeShape sourceShape = null, targetShape = null;
+			if (link != null)
+			{
+				global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::ModelElement> linkedElements = link.LinkedElements;
+				if (linkedElements.Count == 2)
+				{
+					DslDiagrams::Diagram currentDiagram = this.Diagram;
+					DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[0]);
+					foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
+					{
+						DslDiagrams::NodeShape shape = presentationElement as DslDiagrams::NodeShape;
+						if (shape != null && shape.Diagram == currentDiagram)
+						{
+							sourceShape = shape;
+							break;
+						}
+					}
+					
+					presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[1]);
+					foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
+					{
+						DslDiagrams::NodeShape shape = presentationElement as DslDiagrams::NodeShape;
+						if (shape != null && shape.Diagram == currentDiagram)
+						{
+							targetShape = shape;
+							break;
+						}
+					}
+		
+				}
+			}
+			
+			return new DslDiagrams::NodeShape[] { sourceShape, targetShape };
+		}
+		
+		/// <summary>
+		/// Creates a new shape for the given model element as part of view fixup
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Generated code.")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]
+		protected override DslDiagrams::ShapeElement CreateChildShape(DslModeling::ModelElement element)
+		{
+			if(element is global::HeuristicLab.SimulationCore.Activity)
+			{
+				global::HeuristicLab.SimulationCore.ActivityShape newShape = new global::HeuristicLab.SimulationCore.ActivityShape(this.Partition);
+				if(newShape != null) newShape.Size = newShape.DefaultSize; // set default shape size
+				return newShape;
+			}
+			if(element is global::HeuristicLab.SimulationCore.Action)
+			{
+				global::HeuristicLab.SimulationCore.ActionShape newShape = new global::HeuristicLab.SimulationCore.ActionShape(this.Partition);
+				if(newShape != null) newShape.Size = newShape.DefaultSize; // set default shape size
+				return newShape;
+			}
+			if(element is global::HeuristicLab.SimulationCore.ActivityReferencesTriggers)
+			{
+				global::HeuristicLab.SimulationCore.Trigger newShape = new global::HeuristicLab.SimulationCore.Trigger(this.Partition);
+				return newShape;
+			}
+			if(element is global::HeuristicLab.SimulationCore.ActionReferencesListeners)
+			{
+				global::HeuristicLab.SimulationCore.Listener newShape = new global::HeuristicLab.SimulationCore.Listener(this.Partition);
+				return newShape;
+			}
+			return base.CreateChildShape(element);
+		}
+		#endregion
+		#region Decorator mapping
+		/// <summary>
+		/// Initialize shape decorator mappings.  This is done here rather than in individual shapes because decorator maps
+		/// are defined per diagram type rather than per shape type.
+		/// </summary>
+		protected override void InitializeShapeFields(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields)
+		{
+			base.InitializeShapeFields(shapeFields);
+			global::HeuristicLab.SimulationCore.ActivityShape.DecoratorsInitialized += ActivityShapeDecoratorMap.OnDecoratorsInitialized;
+			global::HeuristicLab.SimulationCore.ActionShape.DecoratorsInitialized += ActionShapeDecoratorMap.OnDecoratorsInitialized;
+		}
+		
+		/// <summary>
+		/// Class containing decorator path traversal methods for ActivityShape.
+		/// </summary>
+		internal static partial class ActivityShapeDecoratorMap
+		{
+			/// <summary>
+			/// Event handler called when decorator initialization is complete for ActivityShape.  Adds decorator mappings for this shape or connector.
+			/// </summary>
+			public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
+			{
+				DslDiagrams::ShapeElement shape = (DslDiagrams::ShapeElement)sender;
+				DslDiagrams::AssociatedPropertyInfo propertyInfo;
+				
+				propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::HeuristicLab.SimulationCore.Activity.NameDomainPropertyId);
+				DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);
+			}
+		}
+		
+		/// <summary>
+		/// Class containing decorator path traversal methods for ActionShape.
+		/// </summary>
+		internal static partial class ActionShapeDecoratorMap
+		{
+			/// <summary>
+			/// Event handler called when decorator initialization is complete for ActionShape.  Adds decorator mappings for this shape or connector.
+			/// </summary>
+			public static void OnDecoratorsInitialized(object sender, global::System.EventArgs e)
+			{
+				DslDiagrams::ShapeElement shape = (DslDiagrams::ShapeElement)sender;
+				DslDiagrams::AssociatedPropertyInfo propertyInfo;
+				
+				propertyInfo = new DslDiagrams::AssociatedPropertyInfo(global::HeuristicLab.SimulationCore.Action.NameDomainPropertyId);
+				DslDiagrams::ShapeElement.FindDecorator(shape.Decorators, "NameDecorator").AssociateValueWith(shape.Store, propertyInfo);
+			}
+		}
+		
+		#endregion
+		
+		#region Connect actions
+		private bool changingMouseAction;
+		private global::HeuristicLab.SimulationCore.TriggerConnectAction triggerConnectAction;
+		private global::HeuristicLab.SimulationCore.ListenerConnectAction listenerConnectAction;
+		/// <summary>
+		/// Virtual method to provide a filter when to select the mouse action
+		/// </summary>
+		/// <param name="activeView">Currently active view</param>
+		/// <param name="filter">filter string used to filter the toolbox items</param>
+		protected virtual bool SelectedToolboxItemSupportsFilterString(DslDiagrams::DiagramView activeView, string filter)
+		{
+			return activeView.SelectedToolboxItemSupportsFilterString(filter);
+		}
+		/// <summary>
+		/// Override to provide the right mouse action when trying
+		/// to create links on the diagram
+		/// </summary>
+		/// <param name="pointArgs"></param>
+		public override void OnViewMouseEnter(DslDiagrams::DiagramPointEventArgs pointArgs)
+		{
+			if (pointArgs  == null) throw new global::System.ArgumentNullException("pointArgs");
+		
+			DslDiagrams::DiagramView activeView = this.ActiveDiagramView;
+			if(activeView != null)
+			{
+				DslDiagrams::MouseAction action = null;
+				if (SelectedToolboxItemSupportsFilterString(activeView, global::HeuristicLab.SimulationCore.HLSimToolboxHelper.TriggerFilterString))
+				{
+					if (this.triggerConnectAction == null)
+					{
+						this.triggerConnectAction = new global::HeuristicLab.SimulationCore.TriggerConnectAction(this);
+						this.triggerConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
+					}
+					action = this.triggerConnectAction;
+				} 
+				else if (SelectedToolboxItemSupportsFilterString(activeView, global::HeuristicLab.SimulationCore.HLSimToolboxHelper.ListenerFilterString))
+				{
+					if (this.listenerConnectAction == null)
+					{
+						this.listenerConnectAction = new global::HeuristicLab.SimulationCore.ListenerConnectAction(this);
+						this.listenerConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
+					}
+					action = this.listenerConnectAction;
+				} 
+				else
+				{
+					action = null;
+				}
+				
+				if (pointArgs.DiagramClientView.ActiveMouseAction != action)
+				{
+					try
+					{
+						this.changingMouseAction = true;
+						pointArgs.DiagramClientView.ActiveMouseAction = action;
+					}
+					finally
+					{
+						this.changingMouseAction = false;
+					}
+				}
+			}
+		}
+		
+		/// <summary>
+		/// Snap toolbox selection back to regular pointer after using a custom connect action.
+		/// </summary>
+		private void OnConnectActionDeactivated(object sender, DslDiagrams::DiagramEventArgs e)
+		{
+			OnMouseActionDeactivated();
+		}
+		
+		/// <summary>
+		/// Overridable method to manage the mouse deactivation. The default implementation snap stoolbox selection back to regular pointer 
+		/// after using a custom connect action.
+		/// </summary>
+		protected virtual void OnMouseActionDeactivated()
+		{
+			DslDiagrams::DiagramView activeView = this.ActiveDiagramView;
+		
+			if (activeView != null && activeView.Toolbox != null)
+			{
+				// If we're not changing mouse action due to changing toolbox selection change,
+				// reset toolbox selection.
+				if (!this.changingMouseAction)
+				{
+					activeView.Toolbox.SelectedToolboxItemUsed();
+				}
+			}
+		}
+		#endregion
+		
+		/// <summary>
+		/// Dispose of connect actions.
+		/// </summary>
+		protected override void Dispose(bool disposing)
+		{
+			try
+			{
+				if(disposing)
+				{
+					if(this.triggerConnectAction != null)
+					{
+						this.triggerConnectAction.Dispose();
+						this.triggerConnectAction = null;
+					}
+					if(this.listenerConnectAction != null)
+					{
+						this.listenerConnectAction.Dispose();
+						this.listenerConnectAction = null;
+					}
+				}
+			}
+			finally
+			{
+				base.Dispose(disposing);
+			}
+		}
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// HLSimDiagram domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xcf1c9f0b, 0xeb8e, 0x4d36, 0x9f, 0xcc, 0x6c, 0xd2, 0x45, 0x5f, 0x9c, 0xba);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public HLSimDiagram(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public HLSimDiagram(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	
+		/// <summary>
+		/// Double derived implementation for the rule that initiates view fixup when an element that has an associated shape is added to the model.
+		/// This now enables the DSL author to everride the SkipFixUp() method 
+		/// </summary>
+		internal partial class FixUpDiagramBase : DslModeling::AddRule
+		{
+			protected virtual bool SkipFixup(DslModeling::ModelElement childElement)
+			{
+				return childElement.IsDeleted;
+			}
+		}
+	
+		/// <summary>
+		/// Rule that initiates view fixup when an element that has an associated shape is added to the model. 
+		/// </summary>
+		[DslModeling::RuleOn(typeof(global::HeuristicLab.SimulationCore.Activity), FireTime = DslModeling::TimeToFire.TopLevelCommit, Priority = DslDiagrams::DiagramFixupConstants.AddShapeParentExistRulePriority, InitiallyDisabled=true)]
+		[DslModeling::RuleOn(typeof(global::HeuristicLab.SimulationCore.Action), FireTime = DslModeling::TimeToFire.TopLevelCommit, Priority = DslDiagrams::DiagramFixupConstants.AddShapeParentExistRulePriority, InitiallyDisabled=true)]
+		[DslModeling::RuleOn(typeof(global::HeuristicLab.SimulationCore.ActivityReferencesTriggers), FireTime = DslModeling::TimeToFire.TopLevelCommit, Priority = DslDiagrams::DiagramFixupConstants.AddConnectionRulePriority, InitiallyDisabled=true)]
+		[DslModeling::RuleOn(typeof(global::HeuristicLab.SimulationCore.ActionReferencesListeners), FireTime = DslModeling::TimeToFire.TopLevelCommit, Priority = DslDiagrams::DiagramFixupConstants.AddConnectionRulePriority, InitiallyDisabled=true)]
+		internal sealed partial class FixUpDiagram : FixUpDiagramBase
+		{
+			[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+			public override void ElementAdded(DslModeling::ElementAddedEventArgs e)
+			{
+				if(e == null) throw new global::System.ArgumentNullException("e");
+			
+				DslModeling::ModelElement childElement = e.ModelElement;
+				if (this.SkipFixup(childElement))
+					return;
+				DslModeling::ModelElement parentElement;
+				if(childElement is DslModeling::ElementLink)
+				{
+					parentElement = GetParentForRelationship((DslModeling::ElementLink)childElement);
+				} else
+				if(childElement is global::HeuristicLab.SimulationCore.Activity)
+				{
+					parentElement = GetParentForActivity((global::HeuristicLab.SimulationCore.Activity)childElement);
+				} else
+				if(childElement is global::HeuristicLab.SimulationCore.Action)
+				{
+					parentElement = GetParentForAction((global::HeuristicLab.SimulationCore.Action)childElement);
+				} else
+				{
+					parentElement = null;
+				}
+				
+				if(parentElement != null)
+				{
+					DslDiagrams::Diagram.FixUpDiagram(parentElement, childElement);
+				}
+			}
+			public static global::HeuristicLab.SimulationCore.SimulationModel GetParentForActivity( global::HeuristicLab.SimulationCore.Activity root )
+			{
+				// Segments 0 and 1
+				global::HeuristicLab.SimulationCore.SimulationModel result = root.SimulationModel;
+				if ( result == null ) return null;
+				return result;
+			}
+			public static global::HeuristicLab.SimulationCore.SimulationModel GetParentForAction( global::HeuristicLab.SimulationCore.Action root )
+			{
+				// Segments 0 and 1
+				global::HeuristicLab.SimulationCore.SimulationModel result = root.SimulationModel;
+				if ( result == null ) return null;
+				return result;
+			}
+			private static DslModeling::ModelElement GetParentForRelationship(DslModeling::ElementLink elementLink)
+			{
+				global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::ModelElement> linkedElements = elementLink.LinkedElements;
+	
+				if (linkedElements.Count == 2)
+				{
+					DslDiagrams::ShapeElement sourceShape = linkedElements[0] as DslDiagrams::ShapeElement;
+					DslDiagrams::ShapeElement targetShape = linkedElements[1] as DslDiagrams::ShapeElement;
+	
+					if(sourceShape == null)
+					{
+						DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[0]);
+						foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
+						{
+							DslDiagrams::ShapeElement shape = presentationElement as DslDiagrams::ShapeElement;
+							if (shape != null)
+							{
+								sourceShape = shape;
+								break;
+							}
+						}
+					}
+					
+					if(targetShape == null)
+					{
+						DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> presentationElements = DslDiagrams::PresentationViewsSubject.GetPresentation(linkedElements[1]);
+						foreach (DslDiagrams::PresentationElement presentationElement in presentationElements)
+						{
+							DslDiagrams::ShapeElement shape = presentationElement as DslDiagrams::ShapeElement;
+							if (shape != null)
+							{
+								targetShape = shape;
+								break;
+							}
+						}
+					}
+					
+					if(sourceShape == null || targetShape == null)
+					{
+						global::System.Diagnostics.Debug.Fail("Unable to find source and/or target shape for view fixup.");
+						return null;
+					}
+	
+					DslDiagrams::ShapeElement sourceParent = sourceShape.ParentShape;
+					DslDiagrams::ShapeElement targetParent = targetShape.ParentShape;
+	
+					while (sourceParent != targetParent && sourceParent != null)
+					{
+						DslDiagrams::ShapeElement curParent = targetParent;
+						while (sourceParent != curParent && curParent != null)
+						{
+							curParent = curParent.ParentShape;
+						}
+	
+						if(sourceParent == curParent)
+						{
+							break;
+						}
+						else
+						{
+							sourceParent = sourceParent.ParentShape;
+						}
+					}
+	
+					while (sourceParent != null)
+					{
+						// ensure that the parent can parent connectors (i.e., a diagram or a swimlane).
+						if(sourceParent is DslDiagrams::Diagram || sourceParent is DslDiagrams::SwimlaneShape)
+						{
+							break;
+						}
+						else
+						{
+							sourceParent = sourceParent.ParentShape;
+						}
+					}
+	
+					global::System.Diagnostics.Debug.Assert(sourceParent != null && sourceParent.ModelElement != null, "Unable to find common parent for view fixup.");
+					return sourceParent.ModelElement;
+				}
+	
+				return null;
+			}
+		}
+		
+	
+		/// <summary>
+		/// Reroute a connector when the role players of its underlying relationship change
+		/// </summary>
+		[DslModeling::RuleOn(typeof(global::HeuristicLab.SimulationCore.ActivityReferencesTriggers), FireTime = DslModeling::TimeToFire.TopLevelCommit, Priority = DslDiagrams::DiagramFixupConstants.AddConnectionRulePriority, InitiallyDisabled=true)]
+		[DslModeling::RuleOn(typeof(global::HeuristicLab.SimulationCore.ActionReferencesListeners), FireTime = DslModeling::TimeToFire.TopLevelCommit, Priority = DslDiagrams::DiagramFixupConstants.AddConnectionRulePriority, InitiallyDisabled=true)]
+		internal sealed class ConnectorRolePlayerChanged : DslModeling::RolePlayerChangeRule
+		{
+			/// <summary>
+			/// Reroute a connector when the role players of its underlying relationship change
+			/// </summary>
+			public override void RolePlayerChanged(DslModeling::RolePlayerChangedEventArgs e)
+			{
+				if (e == null) throw new global::System.ArgumentNullException("e");
+	
+				global::System.Collections.ObjectModel.ReadOnlyCollection<DslDiagrams::PresentationViewsSubject> connectorLinks = DslDiagrams::PresentationViewsSubject.GetLinksToPresentation(e.ElementLink);
+				foreach (DslDiagrams::PresentationViewsSubject connectorLink in connectorLinks)
+				{
+					// Fix up any binary link shapes attached to the element link.
+					DslDiagrams::BinaryLinkShape linkShape = connectorLink.Presentation as DslDiagrams::BinaryLinkShape;
+					if (linkShape != null)
+					{
+						global::HeuristicLab.SimulationCore.HLSimDiagram diagram = linkShape.Diagram as global::HeuristicLab.SimulationCore.HLSimDiagram;
+						if (diagram != null)
+						{
+							if (e.NewRolePlayer != null)
+							{
+								DslDiagrams::NodeShape fromShape;
+								DslDiagrams::NodeShape toShape;
+								diagram.GetSourceAndTargetForConnector(linkShape, out fromShape, out toShape);
+								if (fromShape != null && toShape != null)
+								{
+									if (!object.Equals(fromShape, linkShape.FromShape))
+									{
+										linkShape.FromShape = fromShape;
+									}
+									if (!object.Equals(linkShape.ToShape, toShape))
+									{
+										linkShape.ToShape = toShape;
+									}
+								}
+								else
+								{
+									// delete the connector if we cannot find an appropriate target shape.
+									linkShape.Delete();
+								}
+							}
+							else
+							{
+								// delete the connector if the new role player is null.
+								linkShape.Delete();
+							}
+						}
+					}
+				}
+			}
+		}
+	}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Diagram.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Diagram.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Diagram.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\Diagram.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DirectiveProcessor.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DirectiveProcessor.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DirectiveProcessor.cs	(revision 10525)
@@ -0,0 +1,423 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+namespace HeuristicLab.SimulationCore
+{
+	#region Using directives
+	using DslModeling = global::Microsoft.VisualStudio.Modeling;
+	using DslValidation = global::Microsoft.VisualStudio.Modeling.Validation;
+	using VSTextTemplating = global::Microsoft.VisualStudio.TextTemplating;
+	#endregion
+	
+	/// <summary>
+	/// Double-derived template directive processor that provides HLSim files
+	/// The implementation is done in HLSimDirectiveProcessorBase. This class
+	/// exist so users can customize behavior easily.
+	/// </summary>
+	public sealed partial class HLSimDirectiveProcessor : HLSimDirectiveProcessorBase
+	{
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		public HLSimDirectiveProcessor()
+			: base()
+		{
+		}
+	}
+	
+	/// <summary>
+	/// Base implementation for template directive processor that provides HLSim files
+	/// </summary>
+	public class HLSimDirectiveProcessorBase : VSTextTemplating::RequiresProvidesDirectiveProcessor
+	{
+		/// <summary>
+		/// The friendly name of this processor.
+		/// </summary>
+		public const string HLSimDirectiveProcessorName = "HLSimDirectiveProcessor";
+	
+		/// <summary>
+		/// The name for the requires parameter that provides the filename of the model
+		/// </summary>
+		private const string requiresFileParameter = "FileName";
+	
+		/// <summary>
+		/// The name for the requires parameter that provides the validation categories to run. 
+		/// The value for this parameter defaults to String.Empty
+		/// </summary>
+		private const string requiresValidationParameter = "Validation";
+	
+		/// <summary>
+		/// The name for the provides parameter whose value decides the name of the property 
+		/// generated by this DirectiveProcessor. The property returns the root element of
+		/// the model in the given file. 
+		/// </summary>
+		private const string providesModelParameter = "SimulationModel";
+	
+		/// <summary>
+		/// The default value of the provides parameter above. It defaults to the name of
+		/// the parameter itself.
+		/// </summary>
+		private const string defaultProvidesModelParameter = providesModelParameter;
+	
+		/// <summary>
+		/// The directive name that is supported by this direcive processor. This defaults
+		/// to the name of the model. 
+		/// </summary>
+		private const string supportedDirectiveName = "HLSim";
+		
+		/// <summary>
+		/// Flag to ensure that some code is only generated once regardless of how many times the processor is used.
+		/// </summary>
+		private bool oneTimeCodeGenerated;
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		public HLSimDirectiveProcessorBase()
+			: base()
+		{
+		}
+	
+		/// <summary>
+		/// The friendly name of this processor.
+		/// </summary>
+		protected override string FriendlyName
+		{
+			get
+			{
+				return HLSimDirectiveProcessorName;
+			}
+		}
+	
+		/// <summary>
+		/// Check if the directive name is supported by this directive processor
+		/// </summary>
+		/// <param name="directiveName"></param>
+		/// <returns></returns>
+		public override bool IsDirectiveSupported(string directiveName)
+		{
+			return (global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0);
+		}
+	
+		/// <summary>
+		/// Override StartProcessingRun to reset the helpers flag.
+		/// </summary>
+		/// <param name="languageProvider"></param>
+		/// <param name="templateContents"></param>
+		/// <param name="errors"></param>
+		public override void StartProcessingRun(global::System.CodeDom.Compiler.CodeDomProvider languageProvider, string templateContents, global::System.CodeDom.Compiler.CompilerErrorCollection errors)
+		{
+			this.oneTimeCodeGenerated = false;
+			base.StartProcessingRun(languageProvider, templateContents, errors);
+		}
+	
+	
+		/// <summary>
+		/// Override to initialize requires dictionary
+		/// </summary>
+		/// <param name="directiveName"></param>
+		/// <param name="requiresDictionary"></param>
+		protected override void InitializeRequiresDictionary(string directiveName, global::System.Collections.Generic.IDictionary<string, string> requiresDictionary)
+		{
+			if ((global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0))
+			{
+				requiresDictionary[requiresFileParameter] = null;
+				requiresDictionary[requiresValidationParameter] = "";
+			}
+		}
+	
+		/// <summary>
+		/// Override to initialize provides dictinoary
+		/// </summary>
+		/// <param name="directiveName"></param>
+		/// <param name="providesDictionary"></param>
+		protected override void InitializeProvidesDictionary(string directiveName, global::System.Collections.Generic.IDictionary<string, string> providesDictionary)
+		{
+			if ((global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0))
+			{
+				providesDictionary[providesModelParameter] = defaultProvidesModelParameter;
+			}
+		}
+	
+		/// <summary>
+		/// Generate the code to access the model. Use to CodeDomProvider so we are language-agnostic
+		/// </summary>
+		/// <param name="directiveName"></param>
+		/// <param name="codeBuffer"></param>
+		/// <param name="languageProvider"></param>
+		/// <param name="requiresArguments"></param>
+		/// <param name="providesArguments"></param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Generated code is not meant for normalization purpose.")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]
+		protected override void GenerateTransformCode(string directiveName, global::System.Text.StringBuilder codeBuffer, global::System.CodeDom.Compiler.CodeDomProvider languageProvider, global::System.Collections.Generic.IDictionary<string, string> requiresArguments, global::System.Collections.Generic.IDictionary<string, string> providesArguments)
+		{
+			if ((global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0))
+			{
+				if (languageProvider != null)
+				{
+					// Create a field to store the model once it is loaded
+					global::System.CodeDom.CodeMemberField rootElement = new global::System.CodeDom.CodeMemberField();
+					rootElement.Name = providesArguments[providesModelParameter].ToLower(global::System.Globalization.CultureInfo.InvariantCulture) + "Value";
+					rootElement.Type = new global::System.CodeDom.CodeTypeReference(typeof(global::HeuristicLab.SimulationCore.SimulationModel));
+					rootElement.Attributes = global::System.CodeDom.MemberAttributes.Private;
+	
+					// Create a property for the Model that delay-loads the model
+					global::System.CodeDom.CodeMemberProperty rootElementProperty = new global::System.CodeDom.CodeMemberProperty();
+					rootElementProperty.Name = providesArguments[providesModelParameter];
+					rootElementProperty.Type = new global::System.CodeDom.CodeTypeReference(typeof(global::HeuristicLab.SimulationCore.SimulationModel));
+					rootElementProperty.Attributes = global::System.CodeDom.MemberAttributes.Private;
+					rootElementProperty.HasSet = false;
+					rootElementProperty.HasGet = true;
+					rootElementProperty.GetStatements.Add(new global::System.CodeDom.CodeMethodReturnStatement(new global::System.CodeDom.CodeFieldReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), rootElement.Name)));
+	
+					// Create a helper method for resolving relative paths
+					global::System.CodeDom.CodeMemberMethod resolver = null;
+					if (!this.oneTimeCodeGenerated && global::System.IO.File.Exists(this.Host.TemplateFile))
+					{
+						resolver = new global::System.CodeDom.CodeMemberMethod();
+						resolver.Name = "Convert" + "SimulationModel" + "RelativePathToTemplateRelativePath";
+						resolver.ReturnType = new global::System.CodeDom.CodeTypeReference(typeof(string));
+						resolver.Parameters.Add(new global::System.CodeDom.CodeParameterDeclarationExpression(typeof(string), "path"));
+						resolver.Attributes = global::System.CodeDom.MemberAttributes.Public;
+						global::System.CodeDom.CodeVariableDeclarationStatement declaration = new global::System.CodeDom.CodeVariableDeclarationStatement(typeof(string), "modelPath", new global::System.CodeDom.CodePrimitiveExpression((string)(requiresArguments[requiresFileParameter])));
+						resolver.Statements.Add(declaration);
+						declaration = new global::System.CodeDom.CodeVariableDeclarationStatement(typeof(string), "templatePath", new global::System.CodeDom.CodePrimitiveExpression((string)(this.Host.TemplateFile)));
+						resolver.Statements.Add(declaration);
+						global::System.CodeDom.CodeMethodReturnStatement returnStatement = new global::System.CodeDom.CodeMethodReturnStatement(
+							new global::System.CodeDom.CodeMethodInvokeExpression(
+								new global::System.CodeDom.CodeMethodReferenceExpression(new global::System.CodeDom.CodeTypeReferenceExpression("Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation"), "ConvertModelRelativePathToTemplateRelativePath"),
+								new global::System.CodeDom.CodeVariableReferenceExpression("modelPath"),
+								new global::System.CodeDom.CodeVariableReferenceExpression("templatePath"),
+								new global::System.CodeDom.CodeVariableReferenceExpression("path")));
+						resolver.Statements.Add(returnStatement);
+					}
+	
+					// Generate the actual code using the CodeDomProvider
+					global::System.CodeDom.Compiler.CodeGeneratorOptions options = new global::System.CodeDom.Compiler.CodeGeneratorOptions();
+					options.BlankLinesBetweenMembers = true;
+					options.IndentString = "    ";
+					options.VerbatimOrder = true;
+					options.BracingStyle = "C";
+					using (global::System.IO.StringWriter writer = new global::System.IO.StringWriter(codeBuffer, global::System.Globalization.CultureInfo.InvariantCulture))
+					{
+						languageProvider.GenerateCodeFromMember(rootElement, writer, options);
+						languageProvider.GenerateCodeFromMember(rootElementProperty, writer, options);
+						if (resolver != null)
+						{
+							languageProvider.GenerateCodeFromMember(resolver, writer, options);
+						}
+					}
+					this.oneTimeCodeGenerated = true;
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Contribute additively to initialization code for the TextTransformation generated class.
+		/// </summary>
+		/// <remarks>
+		/// This code will be added before the call to the base class.
+		/// </remarks>
+		/// <param name="directiveName"></param>
+		/// <param name="codeBuffer"></param>
+		/// <param name="languageProvider"></param>
+		/// <param name="requiresArguments"></param>
+		/// <param name="providesArguments"></param>
+		protected override void GeneratePreInitializationCode(string directiveName, global::System.Text.StringBuilder codeBuffer, global::System.CodeDom.Compiler.CodeDomProvider languageProvider, global::System.Collections.Generic.IDictionary<string, string> requiresArguments, global::System.Collections.Generic.IDictionary<string, string> providesArguments)
+		{
+			if ((global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0))
+			{
+				if (languageProvider != null)
+				{
+					string[] domainModels = {
+						"HeuristicLab.SimulationCore.HLSimDomainModel",
+					};
+	
+					global::System.CodeDom.Compiler.CodeGeneratorOptions options = new global::System.CodeDom.Compiler.CodeGeneratorOptions();
+					options.BlankLinesBetweenMembers = true;
+					options.IndentString = "    ";
+					options.VerbatimOrder = true;
+					options.BracingStyle = "C";
+					using (global::System.IO.StringWriter writer = new global::System.IO.StringWriter(codeBuffer, global::System.Globalization.CultureInfo.InvariantCulture))
+					{
+						foreach (string domainModel in domainModels)
+						{
+							global::System.CodeDom.CodeExpressionStatement addModel = new global::System.CodeDom.CodeExpressionStatement(new global::System.CodeDom.CodeMethodInvokeExpression(new global::System.CodeDom.CodeMethodReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "AddDomainModel"), new global::System.CodeDom.CodeTypeOfExpression(domainModel)));
+							languageProvider.GenerateCodeFromStatement(addModel, writer, options);
+						}
+					}
+				}
+			}
+		}
+		
+		/// <summary>
+		/// Property that indicates whether this directive processor needs access to diagram data as well as
+		/// model data.  Normally, this is not the case so the default value of this property is false.
+		/// Derived classes may override this property to change the value.
+		/// </summary>
+		protected virtual bool LoadDiagramData
+		{
+	 		get
+			{
+				return false;
+			}
+		}
+	
+		/// <summary>
+		/// Contribute additively to initialization code for the TextTransformation generated class.
+		/// </summary>
+		/// <remarks>
+		/// This code will be added after the call to the base class.
+		/// </remarks>
+		/// <param name="directiveName"></param>
+		/// <param name="codeBuffer"></param>
+		/// <param name="languageProvider"></param>
+		/// <param name="requiresArguments"></param>
+		/// <param name="providesArguments"></param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Generated code is not meant for normalization purpose.")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]
+		protected override void GeneratePostInitializationCode(string directiveName, global::System.Text.StringBuilder codeBuffer, global::System.CodeDom.Compiler.CodeDomProvider languageProvider, global::System.Collections.Generic.IDictionary<string, string> requiresArguments, global::System.Collections.Generic.IDictionary<string, string> providesArguments)
+		{
+			if ((global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0))
+			{
+				// We check the encoding of the model file, and ask the host to use that
+				// encoding to write the output. This is to make sure we use the correct encoding
+				// if the model file contains international characters that could be used in 
+				// the template output.
+				string fileName = requiresArguments[requiresFileParameter];
+				if (!string.IsNullOrEmpty(fileName) && global::System.IO.File.Exists(fileName))
+				{
+					Host.SetOutputEncoding(VSTextTemplating::EncodingHelper.GetEncoding(fileName), false);
+				}
+	
+				if (languageProvider != null)
+				{
+					global::System.CodeDom.CodeMethodInvokeExpression invokeLoad;
+					global::System.String transactionName = providesArguments[providesModelParameter].ToLower(global::System.Globalization.CultureInfo.InvariantCulture) + "Transaction";
+					global::System.CodeDom.CodeVariableDeclarationStatement transactionDeclaration = new global::System.CodeDom.CodeVariableDeclarationStatement(new global::System.CodeDom.CodeTypeReference(typeof(DslModeling::Transaction)), transactionName, new global::System.CodeDom.CodePrimitiveExpression(null));
+					global::System.CodeDom.CodeStatement finallyStatement = new global::System.CodeDom.CodeConditionStatement(new global::System.CodeDom.CodeBinaryOperatorExpression(new global::System.CodeDom.CodeVariableReferenceExpression(transactionName), global::System.CodeDom.CodeBinaryOperatorType.IdentityInequality, new global::System.CodeDom.CodePrimitiveExpression(null)), new global::System.CodeDom.CodeExpressionStatement(new global::System.CodeDom.CodeMethodInvokeExpression(new global::System.CodeDom.CodeVariableReferenceExpression(transactionName), "Dispose")));
+					global::System.Collections.Generic.List<global::System.CodeDom.CodeStatement> txTryStatements = new global::System.Collections.Generic.List<global::System.CodeDom.CodeStatement>();
+					global::System.CodeDom.CodeVariableDeclarationStatement serializationResultDeclaration = new global::System.CodeDom.CodeVariableDeclarationStatement(new global::System.CodeDom.CodeTypeReference(typeof(DslModeling::SerializationResult)), "serializationResult", new global::System.CodeDom.CodeObjectCreateExpression(new global::System.CodeDom.CodeTypeReference(typeof(DslModeling::SerializationResult))));
+	
+					global::System.CodeDom.CodeMethodInvokeExpression invokeEnableDiagramRules = null;
+					global::System.CodeDom.CodeVariableDeclarationStatement diagramFileDeclaration = null;
+					global::System.CodeDom.CodeAssignStatement diagramFileAssign = null;
+					if(LoadDiagramData)
+					{
+						// generate code to enable diagram fixup rules and load the diagram if required.
+						invokeEnableDiagramRules = new global::System.CodeDom.CodeMethodInvokeExpression(
+							new global::System.CodeDom.CodeMethodReferenceExpression(new global::System.CodeDom.CodeTypeReferenceExpression("HLSimDomainModel"), "EnableDiagramRules"), new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "Store"));
+						diagramFileDeclaration = new global::System.CodeDom.CodeVariableDeclarationStatement(new global::System.CodeDom.CodeTypeReference("System.String"), "diagramFileName");
+						diagramFileAssign = new global::System.CodeDom.CodeAssignStatement(new global::System.CodeDom.CodeVariableReferenceExpression("diagramFileName"), new global::System.CodeDom.CodeBinaryOperatorExpression(new global::System.CodeDom.CodePrimitiveExpression(requiresArguments[requiresFileParameter]), global::System.CodeDom.CodeBinaryOperatorType.Add, new global::System.CodeDom.CodePrimitiveExpression(".diagram")));
+						invokeLoad = new global::System.CodeDom.CodeMethodInvokeExpression(
+							new global::System.CodeDom.CodeMethodReferenceExpression(new global::System.CodeDom.CodeFieldReferenceExpression(new global::System.CodeDom.CodeTypeReferenceExpression(typeof(HLSimSerializationHelper)), "Instance"), "LoadModelAndDiagram"), new global::System.CodeDom.CodeVariableReferenceExpression("serializationResult"), new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "Store"), new global::System.CodeDom.CodePrimitiveExpression(requiresArguments[requiresFileParameter]), new global::System.CodeDom.CodeVariableReferenceExpression("diagramFileName"), new global::System.CodeDom.CodePrimitiveExpression(null), new global::System.CodeDom.CodePrimitiveExpression(null), new global::System.CodeDom.CodePrimitiveExpression(null));
+					}
+					else
+					{
+						invokeLoad = new global::System.CodeDom.CodeMethodInvokeExpression(
+							new global::System.CodeDom.CodeMethodReferenceExpression(new global::System.CodeDom.CodeFieldReferenceExpression(new global::System.CodeDom.CodeTypeReferenceExpression(typeof(HLSimSerializationHelper)), "Instance"), "LoadModel"), new global::System.CodeDom.CodeVariableReferenceExpression("serializationResult"), new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "Store"), new global::System.CodeDom.CodePrimitiveExpression(requiresArguments[requiresFileParameter]), new global::System.CodeDom.CodePrimitiveExpression(null), new global::System.CodeDom.CodePrimitiveExpression(null), new global::System.CodeDom.CodePrimitiveExpression(null));
+					}
+	
+					global::System.CodeDom.CodeAssignStatement loadAssign = new global::System.CodeDom.CodeAssignStatement(new global::System.CodeDom.CodeFieldReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), providesArguments[providesModelParameter].ToLower(global::System.Globalization.CultureInfo.InvariantCulture) + "Value"), invokeLoad);
+					txTryStatements.Add(serializationResultDeclaration);
+					txTryStatements.Add(new global::System.CodeDom.CodeAssignStatement(new global::System.CodeDom.CodeVariableReferenceExpression(transactionName), new global::System.CodeDom.CodeMethodInvokeExpression(new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "Store"), "TransactionManager"), "BeginTransaction", new global::System.CodeDom.CodePrimitiveExpression("Load"), new global::System.CodeDom.CodePrimitiveExpression(true))));
+					txTryStatements.Add(loadAssign);
+					global::System.CodeDom.CodeConditionStatement serializationResultCheck = new global::System.CodeDom.CodeConditionStatement(
+						new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodeVariableReferenceExpression("serializationResult"), "Failed"),
+						new global::System.CodeDom.CodeThrowExceptionStatement(new global::System.CodeDom.CodeObjectCreateExpression(new global::System.CodeDom.CodeTypeReference(typeof(DslModeling::SerializationException)), new global::System.CodeDom.CodeVariableReferenceExpression("serializationResult")))
+					);
+					txTryStatements.Add(serializationResultCheck);
+					txTryStatements.Add(new global::System.CodeDom.CodeExpressionStatement(new global::System.CodeDom.CodeMethodInvokeExpression(new global::System.CodeDom.CodeVariableReferenceExpression(transactionName), "Commit")));
+					global::System.CodeDom.CodeTryCatchFinallyStatement txTryStatement = new global::System.CodeDom.CodeTryCatchFinallyStatement(txTryStatements.ToArray(), new global::System.CodeDom.CodeCatchClause[] { }, new global::System.CodeDom.CodeStatement[] { finallyStatement });
+	
+	
+					// We check if the user has requested validation to be performed. If so, we call
+					// ValidateStore() on the base ModelingTextTransformation class.
+					string validationCategories = requiresArguments[requiresValidationParameter];
+					global::System.CodeDom.CodeMethodInvokeExpression validationInvoke = null;
+					if (!string.IsNullOrEmpty(validationCategories))
+					{
+						validationInvoke = new global::System.CodeDom.CodeMethodInvokeExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "ValidateStore", new global::System.CodeDom.CodePrimitiveExpression(validationCategories), new global::System.CodeDom.CodePropertyReferenceExpression(new global::System.CodeDom.CodeThisReferenceExpression(), "Errors"));
+					}
+	
+					global::System.CodeDom.Compiler.CodeGeneratorOptions options = new global::System.CodeDom.Compiler.CodeGeneratorOptions();
+					options.BlankLinesBetweenMembers = true;
+					options.IndentString = "    ";
+					options.VerbatimOrder = true;
+					options.BracingStyle = "C";
+					using (global::System.IO.StringWriter writer = new global::System.IO.StringWriter(codeBuffer, global::System.Globalization.CultureInfo.InvariantCulture))
+					{
+						if(invokeEnableDiagramRules != null)
+						{
+							languageProvider.GenerateCodeFromStatement(new global::System.CodeDom.CodeExpressionStatement(invokeEnableDiagramRules), writer, options);
+						}
+						
+						if(diagramFileDeclaration != null)
+						{
+							languageProvider.GenerateCodeFromStatement(diagramFileDeclaration, writer, options);
+							languageProvider.GenerateCodeFromStatement(diagramFileAssign, writer, options);
+						}
+						
+						languageProvider.GenerateCodeFromStatement(transactionDeclaration, writer, options);
+						languageProvider.GenerateCodeFromStatement(txTryStatement, writer, options);
+						
+						if (validationInvoke != null)
+						{
+							languageProvider.GenerateCodeFromStatement(new global::System.CodeDom.CodeExpressionStatement(validationInvoke), writer, options);
+						}
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Process arguments
+		/// </summary>
+		/// <param name="directiveName"></param>
+		/// <param name="requiresArguments"></param>
+		/// <param name="providesArguments"></param>
+		protected override void PostProcessArguments(string directiveName, global::System.Collections.Generic.IDictionary<string, string> requiresArguments, global::System.Collections.Generic.IDictionary<string, string> providesArguments)
+		{
+			if ((global::System.StringComparer.OrdinalIgnoreCase.Compare(directiveName, supportedDirectiveName) == 0))
+			{
+				// Give the host a chance to resolve the fileName
+				requiresArguments[requiresFileParameter] = this.Host.ResolvePath(requiresArguments[requiresFileParameter]);
+			}
+		}
+	
+		/// <summary>
+		/// Return namespace imports necessary for running template
+		/// </summary>
+		/// <returns></returns>
+		public override string[] GetImportsForProcessingRun()
+		{
+			global::System.Collections.Generic.List<string> imports = new global::System.Collections.Generic.List<string>(base.GetImportsForProcessingRun());
+	
+			imports.Add("Microsoft.VisualStudio.Modeling");
+			imports.Add("System.CodeDom.Compiler");
+			imports.Add("HeuristicLab.SimulationCore");
+	
+			return imports.ToArray();
+		}
+	
+		/// <summary>
+		/// Get assembly references needed for running template
+		/// </summary>
+		/// <returns></returns>
+		public override string[] GetReferencesForProcessingRun()
+		{
+			global::System.Collections.Generic.List<string> references = new global::System.Collections.Generic.List<string>(base.GetReferencesForProcessingRun());
+			references.Add(this.GetType().Assembly.Location);
+			references.Add(typeof(global::Microsoft.VisualStudio.Modeling.Diagrams.Diagram).Assembly.Location);
+			references.Add(typeof(DslModeling::Store).Assembly.Location);
+			references.Add("Microsoft.VisualStudio.TextTemplating.Modeling.12.0");
+			return references.ToArray();
+		}
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DirectiveProcessor.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DirectiveProcessor.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DirectiveProcessor.tt	(revision 10525)
@@ -0,0 +1,5 @@
+<#
+	string directiveName = this.Dsl.Name;
+#>
+<#@ include file="Dsl\ModelDirectiveProcessor.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainClasses.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainClasses.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainClasses.cs	(revision 10525)
@@ -0,0 +1,655 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass SimulationModel
+	/// The root in which all other elements are embedded. Appears as a diagram.
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModel.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModel.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainObjectId("bf3fdcd7-a552-4140-a502-130d51fa2a89")]
+	public partial class SimulationModel : DslModeling::ModelElement
+	{
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// SimulationModel domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xbf3fdcd7, 0xa552, 0x4140, 0xa5, 0x02, 0x13, 0x0d, 0x51, 0xfa, 0x2a, 0x89);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public SimulationModel(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public SimulationModel(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+		#region ModelType domain property code
+		
+		/// <summary>
+		/// ModelType domain property Id.
+		/// </summary>
+		public static readonly global::System.Guid ModelTypeDomainPropertyId = new global::System.Guid(0x495a3211, 0xd774, 0x4434, 0x8b, 0xd1, 0x7b, 0x34, 0x00, 0x49, 0xf9, 0xe9);
+		
+		/// <summary>
+		/// Storage for ModelType
+		/// </summary>
+		private global::System.String modelTypePropertyStorage = string.Empty;
+		
+		/// <summary>
+		/// Gets or sets the value of ModelType domain property.
+		/// Description for HeuristicLab.SimulationCore.SimulationModel.Model Type
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModel/ModelType.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModel/ModelType.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainObjectId("495a3211-d774-4434-8bd1-7b340049f9e9")]
+		public global::System.String ModelType
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return modelTypePropertyStorage;
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				ModelTypePropertyHandler.Instance.SetValue(this, value);
+			}
+		}
+		/// <summary>
+		/// Value handler for the SimulationModel.ModelType domain property.
+		/// </summary>
+		internal sealed partial class ModelTypePropertyHandler : DslModeling::DomainPropertyValueHandler<SimulationModel, global::System.String>
+		{
+			private ModelTypePropertyHandler() { }
+		
+			/// <summary>
+			/// Gets the singleton instance of the SimulationModel.ModelType domain property value handler.
+			/// </summary>
+			public static readonly ModelTypePropertyHandler Instance = new ModelTypePropertyHandler();
+		
+			/// <summary>
+			/// Gets the Id of the SimulationModel.ModelType domain property.
+			/// </summary>
+			public sealed override global::System.Guid DomainPropertyId
+			{
+				[global::System.Diagnostics.DebuggerStepThrough]
+				get
+				{
+					return ModelTypeDomainPropertyId;
+				}
+			}
+			
+			/// <summary>
+			/// Gets a strongly-typed value of the property on specified element.
+			/// </summary>
+			/// <param name="element">Element which owns the property.</param>
+			/// <returns>Property value.</returns>
+			public override sealed global::System.String GetValue(SimulationModel element)
+			{
+				if (element == null) throw new global::System.ArgumentNullException("element");
+				return element.modelTypePropertyStorage;
+			}
+		
+			/// <summary>
+			/// Sets property value on an element.
+			/// </summary>
+			/// <param name="element">Element which owns the property.</param>
+			/// <param name="newValue">New property value.</param>
+			public override sealed void SetValue(SimulationModel element, global::System.String newValue)
+			{
+				if (element == null) throw new global::System.ArgumentNullException("element");
+		
+				global::System.String oldValue = GetValue(element);
+				if (newValue != oldValue)
+				{
+					ValueChanging(element, oldValue, newValue);
+					element.modelTypePropertyStorage = newValue;
+					ValueChanged(element, oldValue, newValue);
+				}
+			}
+		}
+		
+		#endregion
+		#region Activities opposite domain role accessor
+		
+		/// <summary>
+		/// Gets a list of Activities.
+		/// Description for
+		/// HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModel
+		/// </summary>
+		public virtual DslModeling::LinkedElementCollection<Activity> Activities
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return GetRoleCollection<DslModeling::LinkedElementCollection<Activity>, Activity>(global::HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModelDomainRoleId);
+			}
+		}
+		#endregion
+		#region Actions opposite domain role accessor
+		
+		/// <summary>
+		/// Gets a list of Actions.
+		/// Description for
+		/// HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModel
+		/// </summary>
+		public virtual DslModeling::LinkedElementCollection<Action> Actions
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return GetRoleCollection<DslModeling::LinkedElementCollection<Action>, Action>(global::HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModelDomainRoleId);
+			}
+		}
+		#endregion
+		#region ElementGroupPrototype Merge methods
+		/// <summary>
+		/// Returns a value indicating whether the source element represented by the
+		/// specified root ProtoElement can be added to this element.
+		/// </summary>
+		/// <param name="rootElement">
+		/// The root ProtoElement representing a source element.  This can be null, 
+		/// in which case the ElementGroupPrototype does not contain an ProtoElements
+		/// and the code should inspect the ElementGroupPrototype context information.
+		/// </param>
+		/// <param name="elementGroupPrototype">The ElementGroupPrototype that contains the root ProtoElement.</param>
+		/// <returns>true if the source element represented by the ProtoElement can be added to this target element.</returns>
+		protected override bool CanMerge(DslModeling::ProtoElementBase rootElement, DslModeling::ElementGroupPrototype elementGroupPrototype)
+		{
+			if ( elementGroupPrototype == null ) throw new global::System.ArgumentNullException("elementGroupPrototype");
+			
+			if (rootElement != null)
+			{
+				DslModeling::DomainClassInfo rootElementDomainInfo = this.Partition.DomainDataDirectory.GetDomainClass(rootElement.DomainClassId);
+				
+				if (rootElementDomainInfo.IsDerivedFrom(global::HeuristicLab.SimulationCore.Activity.DomainClassId)) 
+				{
+					return true;
+				}
+				
+				if (rootElementDomainInfo.IsDerivedFrom(global::HeuristicLab.SimulationCore.Action.DomainClassId)) 
+				{
+					return true;
+				}
+			}
+			return base.CanMerge(rootElement, elementGroupPrototype);
+		}
+		
+		/// <summary>
+		/// Called by the Merge process to create a relationship between 
+		/// this target element and the specified source element. 
+		/// Typically, a parent-child relationship is established
+		/// between the target element (the parent) and the source element 
+		/// (the child), but any relationship can be established.
+		/// </summary>
+		/// <param name="sourceElement">The element that is to be related to this model element.</param>
+		/// <param name="elementGroup">The group of source ModelElements that have been rehydrated into the target store.</param>
+		/// <remarks>
+		/// This method is overriden to create the relationship between the target element and the specified source element.
+		/// The base method does nothing.
+		/// </remarks>
+		protected override void MergeRelate(DslModeling::ModelElement sourceElement, DslModeling::ElementGroup elementGroup)
+		{
+			// In general, sourceElement is allowed to be null, meaning that the elementGroup must be parsed for special cases.
+			// However this is not supported in generated code.  Use double-deriving on this class and then override MergeRelate completely if you 
+			// need to support this case.
+			if ( sourceElement == null ) throw new global::System.ArgumentNullException("sourceElement");
+		
+				
+			global::HeuristicLab.SimulationCore.Activity sourceActivity1 = sourceElement as global::HeuristicLab.SimulationCore.Activity;
+			if (sourceActivity1 != null)
+			{
+				// Create link for path SimulationModelHasActivities.Activities
+				this.Activities.Add(sourceActivity1);
+
+				return;
+			}
+				
+			global::HeuristicLab.SimulationCore.Action sourceAction2 = sourceElement as global::HeuristicLab.SimulationCore.Action;
+			if (sourceAction2 != null)
+			{
+				// Create link for path SimulationModelHasActions.Actions
+				this.Actions.Add(sourceAction2);
+
+				return;
+			}
+		
+			// Sdk workaround to runtime bug #879350 (DSL: can't copy and paste a MEL that has a MEX). Avoid MergeRelate on ModelElementExtension
+			// during a "Paste".
+			if (sourceElement is DslModeling::ExtensionElement
+				&& sourceElement.Store.TransactionManager.CurrentTransaction.TopLevelTransaction.Context.ContextInfo.ContainsKey("{9DAFD42A-DC0E-4d78-8C3F-8266B2CF8B33}"))
+			{
+				return;
+			}
+		
+			// Fall through to base class if this class hasn't handled the merge.
+			base.MergeRelate(sourceElement, elementGroup);
+		}
+		
+		/// <summary>
+		/// Performs operation opposite to MergeRelate - i.e. disconnects a given
+		/// element from the current one (removes links created by MergeRelate).
+		/// </summary>
+		/// <param name="sourceElement">Element to be unmerged/disconnected.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+		protected override void MergeDisconnect(DslModeling::ModelElement sourceElement)
+		{
+			if (sourceElement == null) throw new global::System.ArgumentNullException("sourceElement");
+				
+			global::HeuristicLab.SimulationCore.Activity sourceActivity1 = sourceElement as global::HeuristicLab.SimulationCore.Activity;
+			if (sourceActivity1 != null)
+			{
+				// Delete link for path SimulationModelHasActivities.Activities
+				
+				foreach (DslModeling::ElementLink link in global::HeuristicLab.SimulationCore.SimulationModelHasActivities.GetLinks((global::HeuristicLab.SimulationCore.SimulationModel)this, sourceActivity1))
+				{
+					// Delete the link, but without possible delete propagation to the element since it's moving to a new location.
+					link.Delete(global::HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModelDomainRoleId, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.ActivityDomainRoleId);
+				}
+
+				return;
+			}
+				
+			global::HeuristicLab.SimulationCore.Action sourceAction2 = sourceElement as global::HeuristicLab.SimulationCore.Action;
+			if (sourceAction2 != null)
+			{
+				// Delete link for path SimulationModelHasActions.Actions
+				
+				foreach (DslModeling::ElementLink link in global::HeuristicLab.SimulationCore.SimulationModelHasActions.GetLinks((global::HeuristicLab.SimulationCore.SimulationModel)this, sourceAction2))
+				{
+					// Delete the link, but without possible delete propagation to the element since it's moving to a new location.
+					link.Delete(global::HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModelDomainRoleId, global::HeuristicLab.SimulationCore.SimulationModelHasActions.ActionDomainRoleId);
+				}
+
+				return;
+			}
+			// Fall through to base class if this class hasn't handled the unmerge.
+			base.MergeDisconnect(sourceElement);
+		}
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass Activity
+	/// Description for HeuristicLab.SimulationCore.Activity
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.Activity.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.Activity.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[global::System.Diagnostics.DebuggerDisplay("{GetType().Name,nq} (Name = {namePropertyStorage})")]
+	[DslModeling::DomainObjectId("168d4729-6156-4a96-87c5-6f8e7dbe5a0f")]
+	public partial class Activity : DslModeling::ModelElement
+	{
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// Activity domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x168d4729, 0x6156, 0x4a96, 0x87, 0xc5, 0x6f, 0x8e, 0x7d, 0xbe, 0x5a, 0x0f);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Activity(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Activity(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+		#region Name domain property code
+		
+		/// <summary>
+		/// Name domain property Id.
+		/// </summary>
+		public static readonly global::System.Guid NameDomainPropertyId = new global::System.Guid(0x5d66e342, 0xeb3f, 0x43c5, 0xa1, 0x2d, 0xe7, 0x52, 0x68, 0x9e, 0x36, 0x0f);
+		
+		/// <summary>
+		/// Storage for Name
+		/// </summary>
+		private global::System.String namePropertyStorage = string.Empty;
+		
+		/// <summary>
+		/// Gets or sets the value of Name domain property.
+		/// Description for HeuristicLab.SimulationCore.Activity.Name
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.Activity/Name.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.Activity/Name.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::ElementName]
+		[DslModeling::DomainObjectId("5d66e342-eb3f-43c5-a12d-e752689e360f")]
+		public global::System.String Name
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return namePropertyStorage;
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				NamePropertyHandler.Instance.SetValue(this, value);
+			}
+		}
+		/// <summary>
+		/// Value handler for the Activity.Name domain property.
+		/// </summary>
+		internal sealed partial class NamePropertyHandler : DslModeling::DomainPropertyValueHandler<Activity, global::System.String>
+		{
+			private NamePropertyHandler() { }
+		
+			/// <summary>
+			/// Gets the singleton instance of the Activity.Name domain property value handler.
+			/// </summary>
+			public static readonly NamePropertyHandler Instance = new NamePropertyHandler();
+		
+			/// <summary>
+			/// Gets the Id of the Activity.Name domain property.
+			/// </summary>
+			public sealed override global::System.Guid DomainPropertyId
+			{
+				[global::System.Diagnostics.DebuggerStepThrough]
+				get
+				{
+					return NameDomainPropertyId;
+				}
+			}
+			
+			/// <summary>
+			/// Gets a strongly-typed value of the property on specified element.
+			/// </summary>
+			/// <param name="element">Element which owns the property.</param>
+			/// <returns>Property value.</returns>
+			public override sealed global::System.String GetValue(Activity element)
+			{
+				if (element == null) throw new global::System.ArgumentNullException("element");
+				return element.namePropertyStorage;
+			}
+		
+			/// <summary>
+			/// Sets property value on an element.
+			/// </summary>
+			/// <param name="element">Element which owns the property.</param>
+			/// <param name="newValue">New property value.</param>
+			public override sealed void SetValue(Activity element, global::System.String newValue)
+			{
+				if (element == null) throw new global::System.ArgumentNullException("element");
+		
+				global::System.String oldValue = GetValue(element);
+				if (newValue != oldValue)
+				{
+					ValueChanging(element, oldValue, newValue);
+					element.namePropertyStorage = newValue;
+					ValueChanged(element, oldValue, newValue);
+				}
+			}
+		}
+		
+		#endregion
+		#region SimulationModel opposite domain role accessor
+		/// <summary>
+		/// Gets or sets SimulationModel.
+		/// Description for
+		/// HeuristicLab.SimulationCore.SimulationModelHasActivities.Activity
+		/// </summary>
+		public virtual SimulationModel SimulationModel
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return DslModeling::DomainRoleInfo.GetLinkedElement(this, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.ActivityDomainRoleId) as SimulationModel;
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetLinkedElement(this, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.ActivityDomainRoleId, value);
+			}
+		}
+		#endregion
+		#region Triggers opposite domain role accessor
+		
+		/// <summary>
+		/// Gets a list of Triggers.
+		/// Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Activity
+		/// </summary>
+		public virtual DslModeling::LinkedElementCollection<Action> Triggers
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return GetRoleCollection<DslModeling::LinkedElementCollection<Action>, Action>(global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.ActivityDomainRoleId);
+			}
+		}
+		#endregion
+		#region Actions opposite domain role accessor
+		
+		/// <summary>
+		/// Gets a list of Actions.
+		/// Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Activity
+		/// </summary>
+		public virtual DslModeling::LinkedElementCollection<Action> Actions
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return GetRoleCollection<DslModeling::LinkedElementCollection<Action>, Action>(global::HeuristicLab.SimulationCore.ActionReferencesListeners.ActivityDomainRoleId);
+			}
+		}
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass Action
+	/// Description for HeuristicLab.SimulationCore.Action
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.Action.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.Action.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[global::System.Diagnostics.DebuggerDisplay("{GetType().Name,nq} (Name = {namePropertyStorage})")]
+	[DslModeling::DomainObjectId("d7ac7ca2-929b-4f0c-b690-e05a92bf28ed")]
+	public partial class Action : DslModeling::ModelElement
+	{
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// Action domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0xd7ac7ca2, 0x929b, 0x4f0c, 0xb6, 0x90, 0xe0, 0x5a, 0x92, 0xbf, 0x28, 0xed);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Action(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public Action(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+		#region Name domain property code
+		
+		/// <summary>
+		/// Name domain property Id.
+		/// </summary>
+		public static readonly global::System.Guid NameDomainPropertyId = new global::System.Guid(0x3b4b0b0d, 0xcb17, 0x48f2, 0xb0, 0xe1, 0x45, 0xc2, 0x3f, 0xd2, 0xc3, 0x79);
+		
+		/// <summary>
+		/// Storage for Name
+		/// </summary>
+		private global::System.String namePropertyStorage = string.Empty;
+		
+		/// <summary>
+		/// Gets or sets the value of Name domain property.
+		/// Description for HeuristicLab.SimulationCore.Action.Name
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.Action/Name.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.Action/Name.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::ElementName]
+		[DslModeling::DomainObjectId("3b4b0b0d-cb17-48f2-b0e1-45c23fd2c379")]
+		public global::System.String Name
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return namePropertyStorage;
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				NamePropertyHandler.Instance.SetValue(this, value);
+			}
+		}
+		/// <summary>
+		/// Value handler for the Action.Name domain property.
+		/// </summary>
+		internal sealed partial class NamePropertyHandler : DslModeling::DomainPropertyValueHandler<Action, global::System.String>
+		{
+			private NamePropertyHandler() { }
+		
+			/// <summary>
+			/// Gets the singleton instance of the Action.Name domain property value handler.
+			/// </summary>
+			public static readonly NamePropertyHandler Instance = new NamePropertyHandler();
+		
+			/// <summary>
+			/// Gets the Id of the Action.Name domain property.
+			/// </summary>
+			public sealed override global::System.Guid DomainPropertyId
+			{
+				[global::System.Diagnostics.DebuggerStepThrough]
+				get
+				{
+					return NameDomainPropertyId;
+				}
+			}
+			
+			/// <summary>
+			/// Gets a strongly-typed value of the property on specified element.
+			/// </summary>
+			/// <param name="element">Element which owns the property.</param>
+			/// <returns>Property value.</returns>
+			public override sealed global::System.String GetValue(Action element)
+			{
+				if (element == null) throw new global::System.ArgumentNullException("element");
+				return element.namePropertyStorage;
+			}
+		
+			/// <summary>
+			/// Sets property value on an element.
+			/// </summary>
+			/// <param name="element">Element which owns the property.</param>
+			/// <param name="newValue">New property value.</param>
+			public override sealed void SetValue(Action element, global::System.String newValue)
+			{
+				if (element == null) throw new global::System.ArgumentNullException("element");
+		
+				global::System.String oldValue = GetValue(element);
+				if (newValue != oldValue)
+				{
+					ValueChanging(element, oldValue, newValue);
+					element.namePropertyStorage = newValue;
+					ValueChanged(element, oldValue, newValue);
+				}
+			}
+		}
+		
+		#endregion
+		#region SimulationModel opposite domain role accessor
+		/// <summary>
+		/// Gets or sets SimulationModel.
+		/// Description for HeuristicLab.SimulationCore.SimulationModelHasActions.Action
+		/// </summary>
+		public virtual SimulationModel SimulationModel
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return DslModeling::DomainRoleInfo.GetLinkedElement(this, global::HeuristicLab.SimulationCore.SimulationModelHasActions.ActionDomainRoleId) as SimulationModel;
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetLinkedElement(this, global::HeuristicLab.SimulationCore.SimulationModelHasActions.ActionDomainRoleId, value);
+			}
+		}
+		#endregion
+		#region Activities opposite domain role accessor
+		
+		/// <summary>
+		/// Gets a list of Activities.
+		/// Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Action
+		/// </summary>
+		public virtual DslModeling::LinkedElementCollection<Activity> Activities
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return GetRoleCollection<DslModeling::LinkedElementCollection<Activity>, Activity>(global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.ActionDomainRoleId);
+			}
+		}
+		#endregion
+		#region Listeners opposite domain role accessor
+		
+		/// <summary>
+		/// Gets a list of Listeners.
+		/// Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Action
+		/// </summary>
+		public virtual DslModeling::LinkedElementCollection<Activity> Listeners
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return GetRoleCollection<DslModeling::LinkedElementCollection<Activity>, Activity>(global::HeuristicLab.SimulationCore.ActionReferencesListeners.ActionDomainRoleId);
+			}
+		}
+		#endregion
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainClasses.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainClasses.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainClasses.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\DomainClassCodeGenerator.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModel.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModel.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModel.cs	(revision 10525)
@@ -0,0 +1,456 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainModel HLSimDomainModel
+	/// Description for HeuristicLab.SimulationCore.HLSim
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.HLSimDomainModel.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.HLSimDomainModel.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DependsOnDomainModel(typeof(global::Microsoft.VisualStudio.Modeling.CoreDomainModel))]
+	[DslModeling::DependsOnDomainModel(typeof(global::Microsoft.VisualStudio.Modeling.Diagrams.CoreDesignSurfaceDomainModel))]
+	[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]
+	[DslModeling::DomainObjectId("e76b5f9b-81a1-45f0-ac20-8a25077fff36")]
+	public partial class HLSimDomainModel : DslModeling::DomainModel
+	{
+		#region Constructor, domain model Id
+	
+		/// <summary>
+		/// HLSimDomainModel domain model Id.
+		/// </summary>
+		public static readonly global::System.Guid DomainModelId = new global::System.Guid(0xe76b5f9b, 0x81a1, 0x45f0, 0xac, 0x20, 0x8a, 0x25, 0x07, 0x7f, 0xff, 0x36);
+	
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		/// <param name="store">Store containing the domain model.</param>
+		public HLSimDomainModel(DslModeling::Store store)
+			: base(store, DomainModelId)
+		{
+			// Call the partial method to allow any required serialization setup to be done.
+			this.InitializeSerialization(store);		
+		}
+		
+	
+		///<Summary>
+		/// Defines a partial method that will be called from the constructor to
+		/// allow any necessary serialization setup to be done.
+		///</Summary>
+		///<remarks>
+		/// For a DSL created with the DSL Designer wizard, an implementation of this 
+		/// method will be generated in the GeneratedCode\SerializationHelper.cs class.
+		///</remarks>
+		partial void InitializeSerialization(DslModeling::Store store);
+	
+	
+		#endregion
+		#region Domain model reflection
+			
+		/// <summary>
+		/// Gets the list of generated domain model types (classes, rules, relationships).
+		/// </summary>
+		/// <returns>List of types.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]	
+		protected sealed override global::System.Type[] GetGeneratedDomainModelTypes()
+		{
+			return new global::System.Type[]
+			{
+				typeof(SimulationModel),
+				typeof(Activity),
+				typeof(Action),
+				typeof(SimulationModelHasActivities),
+				typeof(SimulationModelHasActions),
+				typeof(ActivityReferencesTriggers),
+				typeof(ActionReferencesListeners),
+				typeof(HLSimDiagram),
+				typeof(Trigger),
+				typeof(Listener),
+				typeof(ActivityShape),
+				typeof(ActionShape),
+				typeof(global::HeuristicLab.SimulationCore.FixUpDiagram),
+				typeof(global::HeuristicLab.SimulationCore.ConnectorRolePlayerChanged),
+			};
+		}
+		/// <summary>
+		/// Gets the list of generated domain properties.
+		/// </summary>
+		/// <returns>List of property data.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]	
+		protected sealed override DomainMemberInfo[] GetGeneratedDomainProperties()
+		{
+			return new DomainMemberInfo[]
+			{
+				new DomainMemberInfo(typeof(SimulationModel), "ModelType", SimulationModel.ModelTypeDomainPropertyId, typeof(SimulationModel.ModelTypePropertyHandler)),
+				new DomainMemberInfo(typeof(Activity), "Name", Activity.NameDomainPropertyId, typeof(Activity.NamePropertyHandler)),
+				new DomainMemberInfo(typeof(Action), "Name", Action.NameDomainPropertyId, typeof(Action.NamePropertyHandler)),
+			};
+		}
+		/// <summary>
+		/// Gets the list of generated domain roles.
+		/// </summary>
+		/// <returns>List of role data.</returns>
+		protected sealed override DomainRolePlayerInfo[] GetGeneratedDomainRoles()
+		{
+			return new DomainRolePlayerInfo[]
+			{
+				new DomainRolePlayerInfo(typeof(SimulationModelHasActivities), "SimulationModel", SimulationModelHasActivities.SimulationModelDomainRoleId),
+				new DomainRolePlayerInfo(typeof(SimulationModelHasActivities), "Activity", SimulationModelHasActivities.ActivityDomainRoleId),
+				new DomainRolePlayerInfo(typeof(SimulationModelHasActions), "SimulationModel", SimulationModelHasActions.SimulationModelDomainRoleId),
+				new DomainRolePlayerInfo(typeof(SimulationModelHasActions), "Action", SimulationModelHasActions.ActionDomainRoleId),
+				new DomainRolePlayerInfo(typeof(ActivityReferencesTriggers), "Activity", ActivityReferencesTriggers.ActivityDomainRoleId),
+				new DomainRolePlayerInfo(typeof(ActivityReferencesTriggers), "Action", ActivityReferencesTriggers.ActionDomainRoleId),
+				new DomainRolePlayerInfo(typeof(ActionReferencesListeners), "Action", ActionReferencesListeners.ActionDomainRoleId),
+				new DomainRolePlayerInfo(typeof(ActionReferencesListeners), "Activity", ActionReferencesListeners.ActivityDomainRoleId),
+			};
+		}
+		#endregion
+		#region Factory methods
+		private static global::System.Collections.Generic.Dictionary<global::System.Type, int> createElementMap;
+	
+		/// <summary>
+		/// Creates an element of specified type.
+		/// </summary>
+		/// <param name="partition">Partition where element is to be created.</param>
+		/// <param name="elementType">Element type which belongs to this domain model.</param>
+		/// <param name="propertyAssignments">New element property assignments.</param>
+		/// <returns>Created element.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]	
+		public sealed override DslModeling::ModelElement CreateElement(DslModeling::Partition partition, global::System.Type elementType, DslModeling::PropertyAssignment[] propertyAssignments)
+		{
+			if (elementType == null) throw new global::System.ArgumentNullException("elementType");
+	
+			if (createElementMap == null)
+			{
+				createElementMap = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(8);
+				createElementMap.Add(typeof(SimulationModel), 0);
+				createElementMap.Add(typeof(Activity), 1);
+				createElementMap.Add(typeof(Action), 2);
+				createElementMap.Add(typeof(HLSimDiagram), 3);
+				createElementMap.Add(typeof(Trigger), 4);
+				createElementMap.Add(typeof(Listener), 5);
+				createElementMap.Add(typeof(ActivityShape), 6);
+				createElementMap.Add(typeof(ActionShape), 7);
+			}
+			int index;
+			if (!createElementMap.TryGetValue(elementType, out index))
+			{
+				// construct exception error message		
+				string exceptionError = string.Format(
+								global::System.Globalization.CultureInfo.CurrentCulture,
+								global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("UnrecognizedElementType"),
+								elementType.Name);
+				throw new global::System.ArgumentException(exceptionError, "elementType");
+			}
+			switch (index)
+			{
+				case 0: return new SimulationModel(partition, propertyAssignments);
+				case 1: return new Activity(partition, propertyAssignments);
+				case 2: return new Action(partition, propertyAssignments);
+				case 3: return new HLSimDiagram(partition, propertyAssignments);
+				case 4: return new Trigger(partition, propertyAssignments);
+				case 5: return new Listener(partition, propertyAssignments);
+				case 6: return new ActivityShape(partition, propertyAssignments);
+				case 7: return new ActionShape(partition, propertyAssignments);
+				default: return null;
+			}
+		}
+	
+		private static global::System.Collections.Generic.Dictionary<global::System.Type, int> createElementLinkMap;
+	
+		/// <summary>
+		/// Creates an element link of specified type.
+		/// </summary>
+		/// <param name="partition">Partition where element is to be created.</param>
+		/// <param name="elementLinkType">Element link type which belongs to this domain model.</param>
+		/// <param name="roleAssignments">List of relationship role assignments for the new link.</param>
+		/// <param name="propertyAssignments">New element property assignments.</param>
+		/// <returns>Created element link.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+		public sealed override DslModeling::ElementLink CreateElementLink(DslModeling::Partition partition, global::System.Type elementLinkType, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+		{
+			if (elementLinkType == null) throw new global::System.ArgumentNullException("elementLinkType");
+			if (roleAssignments == null) throw new global::System.ArgumentNullException("roleAssignments");
+	
+			if (createElementLinkMap == null)
+			{
+				createElementLinkMap = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(4);
+				createElementLinkMap.Add(typeof(SimulationModelHasActivities), 0);
+				createElementLinkMap.Add(typeof(SimulationModelHasActions), 1);
+				createElementLinkMap.Add(typeof(ActivityReferencesTriggers), 2);
+				createElementLinkMap.Add(typeof(ActionReferencesListeners), 3);
+			}
+			int index;
+			if (!createElementLinkMap.TryGetValue(elementLinkType, out index))
+			{
+				// construct exception error message
+				string exceptionError = string.Format(
+								global::System.Globalization.CultureInfo.CurrentCulture,
+								global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("UnrecognizedElementLinkType"),
+								elementLinkType.Name);
+				throw new global::System.ArgumentException(exceptionError, "elementLinkType");
+			
+			}
+			switch (index)
+			{
+				case 0: return new SimulationModelHasActivities(partition, roleAssignments, propertyAssignments);
+				case 1: return new SimulationModelHasActions(partition, roleAssignments, propertyAssignments);
+				case 2: return new ActivityReferencesTriggers(partition, roleAssignments, propertyAssignments);
+				case 3: return new ActionReferencesListeners(partition, roleAssignments, propertyAssignments);
+				default: return null;
+			}
+		}
+		#endregion
+		#region Resource manager
+		
+		private static global::System.Resources.ResourceManager resourceManager;
+		
+		/// <summary>
+		/// The base name of this model's resources.
+		/// </summary>
+		public const string ResourceBaseName = "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx";
+		
+		/// <summary>
+		/// Gets the DomainModel's ResourceManager. If the ResourceManager does not already exist, then it is created.
+		/// </summary>
+		public override global::System.Resources.ResourceManager ResourceManager
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return HLSimDomainModel.SingletonResourceManager;
+			}
+		}
+	
+		/// <summary>
+		/// Gets the Singleton ResourceManager for this domain model.
+		/// </summary>
+		public static global::System.Resources.ResourceManager SingletonResourceManager
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				if (HLSimDomainModel.resourceManager == null)
+				{
+					HLSimDomainModel.resourceManager = new global::System.Resources.ResourceManager(ResourceBaseName, typeof(HLSimDomainModel).Assembly);
+				}
+				return HLSimDomainModel.resourceManager;
+			}
+		}
+		#endregion
+		#region Copy/Remove closures
+		/// <summary>
+		/// CopyClosure cache
+		/// </summary>
+		private static DslModeling::IElementVisitorFilter copyClosure;
+		/// <summary>
+		/// DeleteClosure cache
+		/// </summary>
+		private static DslModeling::IElementVisitorFilter removeClosure;
+		/// <summary>
+		/// Returns an IElementVisitorFilter that corresponds to the ClosureType.
+		/// </summary>
+		/// <param name="type">closure type</param>
+		/// <param name="rootElements">collection of root elements</param>
+		/// <returns>IElementVisitorFilter or null</returns>
+		public override DslModeling::IElementVisitorFilter GetClosureFilter(DslModeling::ClosureType type, global::System.Collections.Generic.ICollection<DslModeling::ModelElement> rootElements)
+		{
+			switch (type)
+			{
+				case DslModeling::ClosureType.CopyClosure:
+					return HLSimDomainModel.CopyClosure;
+				case DslModeling::ClosureType.DeleteClosure:
+					return HLSimDomainModel.DeleteClosure;
+			}
+			return base.GetClosureFilter(type, rootElements);
+		}
+		/// <summary>
+		/// CopyClosure cache
+		/// </summary>
+		private static DslModeling::IElementVisitorFilter CopyClosure
+		{
+			get
+			{
+				// Incorporate all of the closures from the models we extend
+				if (HLSimDomainModel.copyClosure == null)
+				{
+					DslModeling::ChainingElementVisitorFilter copyFilter = new DslModeling::ChainingElementVisitorFilter();
+					copyFilter.AddFilter(new HLSimCopyClosure());
+					copyFilter.AddFilter(new DslModeling::CoreCopyClosure());
+					copyFilter.AddFilter(new DslDiagrams::CoreDesignSurfaceCopyClosure());
+					
+					HLSimDomainModel.copyClosure = copyFilter;
+				}
+				return HLSimDomainModel.copyClosure;
+			}
+		}
+		/// <summary>
+		/// DeleteClosure cache
+		/// </summary>
+		private static DslModeling::IElementVisitorFilter DeleteClosure
+		{
+			get
+			{
+				// Incorporate all of the closures from the models we extend
+				if (HLSimDomainModel.removeClosure == null)
+				{
+					DslModeling::ChainingElementVisitorFilter removeFilter = new DslModeling::ChainingElementVisitorFilter();
+					removeFilter.AddFilter(new HLSimDeleteClosure());
+					removeFilter.AddFilter(new DslModeling::CoreDeleteClosure());
+					removeFilter.AddFilter(new DslDiagrams::CoreDesignSurfaceDeleteClosure());
+		
+					HLSimDomainModel.removeClosure = removeFilter;
+				}
+				return HLSimDomainModel.removeClosure;
+			}
+		}
+		#endregion
+		#region Diagram rule helpers
+		/// <summary>
+		/// Enables rules in this domain model related to diagram fixup for the given store.
+		/// If diagram data will be loaded into the store, this method should be called first to ensure
+		/// that the diagram behaves properly.
+		/// </summary>
+		public static void EnableDiagramRules(DslModeling::Store store)
+		{
+			if(store == null) throw new global::System.ArgumentNullException("store");
+			
+			DslModeling::RuleManager ruleManager = store.RuleManager;
+			ruleManager.EnableRule(typeof(global::HeuristicLab.SimulationCore.FixUpDiagram));
+			ruleManager.EnableRule(typeof(global::HeuristicLab.SimulationCore.ConnectorRolePlayerChanged));
+		}
+		
+		/// <summary>
+		/// Disables rules in this domain model related to diagram fixup for the given store.
+		/// </summary>
+		public static void DisableDiagramRules(DslModeling::Store store)
+		{
+			if(store == null) throw new global::System.ArgumentNullException("store");
+			
+			DslModeling::RuleManager ruleManager = store.RuleManager;
+			ruleManager.DisableRule(typeof(global::HeuristicLab.SimulationCore.FixUpDiagram));
+			ruleManager.DisableRule(typeof(global::HeuristicLab.SimulationCore.ConnectorRolePlayerChanged));
+		}
+		#endregion
+	}
+		
+	#region Copy/Remove closure classes
+	/// <summary>
+	/// Remove closure visitor filter
+	/// </summary>
+	[global::System.CLSCompliant(true)]
+	public partial class HLSimDeleteClosure : HLSimDeleteClosureBase, DslModeling::IElementVisitorFilter
+	{
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		public HLSimDeleteClosure() : base()
+		{
+		}
+	}
+	
+	/// <summary>
+	/// Base class for remove closure visitor filter
+	/// </summary>
+	[global::System.CLSCompliant(true)]
+	public partial class HLSimDeleteClosureBase : DslModeling::IElementVisitorFilter
+	{
+		/// <summary>
+		/// DomainRoles
+		/// </summary>
+		private global::System.Collections.Specialized.HybridDictionary domainRoles;
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		public HLSimDeleteClosureBase()
+		{
+			#region Initialize DomainData Table
+			DomainRoles.Add(global::HeuristicLab.SimulationCore.SimulationModelHasActivities.ActivityDomainRoleId, true);
+			DomainRoles.Add(global::HeuristicLab.SimulationCore.SimulationModelHasActions.ActionDomainRoleId, true);
+			#endregion
+		}
+		/// <summary>
+		/// Called to ask the filter if a particular relationship from a source element should be included in the traversal
+		/// </summary>
+		/// <param name="walker">ElementWalker that is traversing the model</param>
+		/// <param name="sourceElement">Model Element playing the source role</param>
+		/// <param name="sourceRoleInfo">DomainRoleInfo of the role that the source element is playing in the relationship</param>
+		/// <param name="domainRelationshipInfo">DomainRelationshipInfo for the ElementLink in question</param>
+		/// <param name="targetRelationship">Relationship in question</param>
+		/// <returns>Yes if the relationship should be traversed</returns>
+		public virtual DslModeling::VisitorFilterResult ShouldVisitRelationship(DslModeling::ElementWalker walker, DslModeling::ModelElement sourceElement, DslModeling::DomainRoleInfo sourceRoleInfo, DslModeling::DomainRelationshipInfo domainRelationshipInfo, DslModeling::ElementLink targetRelationship)
+		{
+			return DslModeling::VisitorFilterResult.Yes;
+		}
+		/// <summary>
+		/// Called to ask the filter if a particular role player should be Visited during traversal
+		/// </summary>
+		/// <param name="walker">ElementWalker that is traversing the model</param>
+		/// <param name="sourceElement">Model Element playing the source role</param>
+		/// <param name="elementLink">Element Link that forms the relationship to the role player in question</param>
+		/// <param name="targetDomainRole">DomainRoleInfo of the target role</param>
+		/// <param name="targetRolePlayer">Model Element that plays the target role in the relationship</param>
+		/// <returns></returns>
+		public virtual DslModeling::VisitorFilterResult ShouldVisitRolePlayer(DslModeling::ElementWalker walker, DslModeling::ModelElement sourceElement, DslModeling::ElementLink elementLink, DslModeling::DomainRoleInfo targetDomainRole, DslModeling::ModelElement targetRolePlayer)
+		{
+			if (targetDomainRole == null) throw new global::System.ArgumentNullException("targetDomainRole");
+			return this.DomainRoles.Contains(targetDomainRole.Id) ? DslModeling::VisitorFilterResult.Yes : DslModeling::VisitorFilterResult.DoNotCare;
+		}
+		/// <summary>
+		/// DomainRoles
+		/// </summary>
+		private global::System.Collections.Specialized.HybridDictionary DomainRoles
+		{
+			get
+			{
+				if (this.domainRoles == null)
+				{
+					this.domainRoles = new global::System.Collections.Specialized.HybridDictionary();
+				}
+				return this.domainRoles;
+			}
+		}
+	
+	}
+	/// <summary>
+	/// Copy closure visitor filter
+	/// </summary>
+	[global::System.CLSCompliant(true)]
+	public partial class HLSimCopyClosure : HLSimCopyClosureBase, DslModeling::IElementVisitorFilter
+	{
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		public HLSimCopyClosure() : base()
+		{
+		}
+	}
+	/// <summary>
+	/// Base class for copy closure visitor filter
+	/// </summary>
+	[global::System.CLSCompliant(true)]
+	public partial class HLSimCopyClosureBase : DslModeling::CopyClosureFilter, DslModeling::IElementVisitorFilter
+	{
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		public HLSimCopyClosureBase():base()
+		{
+		}
+	}
+	#endregion
+		
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModel.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModel.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModel.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\DomainModelCodeGenerator.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModelResx.resx
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModelResx.resx	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModelResx.resx	(revision 10525)
@@ -0,0 +1,539 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="HeuristicLab.SimulationCore.HLSimDomainModel.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.HLSim</value>
+    <comment>Description for DslLibrary &apos;HLSim&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.HLSimDomainModel.DisplayName" xml:space="preserve">
+    <value>HLSim</value>
+    <comment>DisplayName for DslLibrary &apos;HLSim&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModel.Description" xml:space="preserve">
+    <value>The root in which all other elements are embedded. Appears as a diagram.</value>
+    <comment>Description for DomainClass &apos;SimulationModel&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModel.DisplayName" xml:space="preserve">
+    <value>Simulation Model</value>
+    <comment>DisplayName for DomainClass &apos;SimulationModel&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModel/ModelType.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModel.Model Type</value>
+    <comment>Description for DomainProperty &apos;ModelType&apos; on DomainClass &apos;SimulationModel&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModel/ModelType.DisplayName" xml:space="preserve">
+    <value>Model Type</value>
+    <comment>DisplayName for DomainProperty &apos;ModelType&apos; on DomainClass &apos;SimulationModel&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Activity.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.Activity</value>
+    <comment>Description for DomainClass &apos;Activity&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Activity.DisplayName" xml:space="preserve">
+    <value>Activity</value>
+    <comment>DisplayName for DomainClass &apos;Activity&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Activity/Name.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.Activity.Name</value>
+    <comment>Description for DomainProperty &apos;Name&apos; on DomainClass &apos;Activity&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Activity/Name.DisplayName" xml:space="preserve">
+    <value>Name</value>
+    <comment>DisplayName for DomainProperty &apos;Name&apos; on DomainClass &apos;Activity&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Action.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.Action</value>
+    <comment>Description for DomainClass &apos;Action&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Action.DisplayName" xml:space="preserve">
+    <value>Action</value>
+    <comment>DisplayName for DomainClass &apos;Action&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Action/Name.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.Action.Name</value>
+    <comment>Description for DomainProperty &apos;Name&apos; on DomainClass &apos;Action&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Action/Name.DisplayName" xml:space="preserve">
+    <value>Name</value>
+    <comment>DisplayName for DomainProperty &apos;Name&apos; on DomainClass &apos;Action&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModelHasActivities</value>
+    <comment>Description for DomainClass &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities.DisplayName" xml:space="preserve">
+    <value>Simulation Model Has Activities</value>
+    <comment>DisplayName for DomainClass &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities/SimulationModel.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModel</value>
+    <comment>Description for DomainRole &apos;SimulationModel&apos; on DomainRelationship &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities/SimulationModel.DisplayName" xml:space="preserve">
+    <value>Simulation Model</value>
+    <comment>DisplayName for DomainRole &apos;SimulationModel&apos; on DomainRelationship &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities/SimulationModel.PropertyDisplayName" xml:space="preserve">
+    <value>Activities</value>
+    <comment>PropertyDisplayName for DomainRole &apos;SimulationModel&apos; on DomainRelationship &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities/Activity.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModelHasActivities.Activity</value>
+    <comment>Description for DomainRole &apos;Activity&apos; on DomainRelationship &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities/Activity.DisplayName" xml:space="preserve">
+    <value>Activity</value>
+    <comment>DisplayName for DomainRole &apos;Activity&apos; on DomainRelationship &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActivities/Activity.PropertyDisplayName" xml:space="preserve">
+    <value>Simulation Model</value>
+    <comment>PropertyDisplayName for DomainRole &apos;Activity&apos; on DomainRelationship &apos;SimulationModelHasActivities&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModelHasActions</value>
+    <comment>Description for DomainClass &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions.DisplayName" xml:space="preserve">
+    <value>Simulation Model Has Actions</value>
+    <comment>DisplayName for DomainClass &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions/SimulationModel.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModel</value>
+    <comment>Description for DomainRole &apos;SimulationModel&apos; on DomainRelationship &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions/SimulationModel.DisplayName" xml:space="preserve">
+    <value>Simulation Model</value>
+    <comment>DisplayName for DomainRole &apos;SimulationModel&apos; on DomainRelationship &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions/SimulationModel.PropertyDisplayName" xml:space="preserve">
+    <value>Actions</value>
+    <comment>PropertyDisplayName for DomainRole &apos;SimulationModel&apos; on DomainRelationship &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions/Action.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.SimulationModelHasActions.Action</value>
+    <comment>Description for DomainRole &apos;Action&apos; on DomainRelationship &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions/Action.DisplayName" xml:space="preserve">
+    <value>Action</value>
+    <comment>DisplayName for DomainRole &apos;Action&apos; on DomainRelationship &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.SimulationModelHasActions/Action.PropertyDisplayName" xml:space="preserve">
+    <value>Simulation Model</value>
+    <comment>PropertyDisplayName for DomainRole &apos;Action&apos; on DomainRelationship &apos;SimulationModelHasActions&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers</value>
+    <comment>Description for DomainClass &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers.DisplayName" xml:space="preserve">
+    <value>Activity References Triggers</value>
+    <comment>DisplayName for DomainClass &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Activity.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Activity</value>
+    <comment>Description for DomainRole &apos;Activity&apos; on DomainRelationship &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Activity.DisplayName" xml:space="preserve">
+    <value>Activity</value>
+    <comment>DisplayName for DomainRole &apos;Activity&apos; on DomainRelationship &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Activity.PropertyDisplayName" xml:space="preserve">
+    <value>Triggers</value>
+    <comment>PropertyDisplayName for DomainRole &apos;Activity&apos; on DomainRelationship &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Action.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Action</value>
+    <comment>Description for DomainRole &apos;Action&apos; on DomainRelationship &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Action.DisplayName" xml:space="preserve">
+    <value>Action</value>
+    <comment>DisplayName for DomainRole &apos;Action&apos; on DomainRelationship &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Action.PropertyDisplayName" xml:space="preserve">
+    <value>Activities</value>
+    <comment>PropertyDisplayName for DomainRole &apos;Action&apos; on DomainRelationship &apos;ActivityReferencesTriggers&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActionReferencesListeners</value>
+    <comment>Description for DomainClass &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners.DisplayName" xml:space="preserve">
+    <value>Action References Listeners</value>
+    <comment>DisplayName for DomainClass &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners/Action.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Action</value>
+    <comment>Description for DomainRole &apos;Action&apos; on DomainRelationship &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners/Action.DisplayName" xml:space="preserve">
+    <value>Action</value>
+    <comment>DisplayName for DomainRole &apos;Action&apos; on DomainRelationship &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners/Action.PropertyDisplayName" xml:space="preserve">
+    <value>Listeners</value>
+    <comment>PropertyDisplayName for DomainRole &apos;Action&apos; on DomainRelationship &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners/Activity.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Activity</value>
+    <comment>Description for DomainRole &apos;Activity&apos; on DomainRelationship &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners/Activity.DisplayName" xml:space="preserve">
+    <value>Activity</value>
+    <comment>DisplayName for DomainRole &apos;Activity&apos; on DomainRelationship &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionReferencesListeners/Activity.PropertyDisplayName" xml:space="preserve">
+    <value>Actions</value>
+    <comment>PropertyDisplayName for DomainRole &apos;Activity&apos; on DomainRelationship &apos;ActionReferencesListeners&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityShape.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActivityShape</value>
+    <comment>Description for DomainClass &apos;ActivityShape&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActivityShape.DisplayName" xml:space="preserve">
+    <value>Activity Shape</value>
+    <comment>DisplayName for DomainClass &apos;ActivityShape&apos;</comment>
+  </data>
+  <data name="ActivityShapeNameDecoratorDefaultText" xml:space="preserve">
+    <value>NameDecorator</value>
+    <comment>Text decorator default text</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionShape.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.ActionShape</value>
+    <comment>Description for DomainClass &apos;ActionShape&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.ActionShape.DisplayName" xml:space="preserve">
+    <value>Action Shape</value>
+    <comment>DisplayName for DomainClass &apos;ActionShape&apos;</comment>
+  </data>
+  <data name="ActionShapeNameDecoratorDefaultText" xml:space="preserve">
+    <value>NameDecorator</value>
+    <comment>Text decorator default text</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Trigger.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.Trigger</value>
+    <comment>Description for DomainClass &apos;Trigger&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Trigger.DisplayName" xml:space="preserve">
+    <value>Trigger</value>
+    <comment>DisplayName for DomainClass &apos;Trigger&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Listener.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.Listener</value>
+    <comment>Description for DomainClass &apos;Listener&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.Listener.DisplayName" xml:space="preserve">
+    <value>Listener</value>
+    <comment>DisplayName for DomainClass &apos;Listener&apos;</comment>
+  </data>
+  <data name="FormatList" xml:space="preserve">
+    <value>HLSim (*.hlsim)|*.hlsim</value>
+    <comment>A list of file format specifiers for the Save dialog box</comment>
+  </data>
+  <data name="ModelExplorerTitle" xml:space="preserve">
+    <value>HLSim Explorer</value>
+    <comment>Model Explorer Toolwindow title</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.HLSimDiagram.Description" xml:space="preserve">
+    <value>Description for HeuristicLab.SimulationCore.HLSimDiagram</value>
+    <comment>Description for DomainClass &apos;HLSimDiagram&apos;</comment>
+  </data>
+  <data name="HeuristicLab.SimulationCore.HLSimDiagram.DisplayName" xml:space="preserve">
+    <value>Minimal Language Diagram</value>
+    <comment>DisplayName for DomainClass &apos;HLSimDiagram&apos;</comment>
+  </data>
+  <data name="HLSimToolboxTab" xml:space="preserve">
+    <value>HLSim</value>
+    <comment>Toolbox item tab name</comment>
+  </data>
+  <data name="ActivityToolboxItem" xml:space="preserve">
+    <value>Activity</value>
+    <comment>Toolbox item name</comment>
+  </data>
+  <data name="ActivityToolboxTooltip" xml:space="preserve">
+    <value>Activity</value>
+    <comment>Toolbox tooltip text</comment>
+  </data>
+  <data name="ActionToolboxItem" xml:space="preserve">
+    <value>Action</value>
+    <comment>Toolbox item name</comment>
+  </data>
+  <data name="ActionToolboxTooltip" xml:space="preserve">
+    <value>Action</value>
+    <comment>Toolbox tooltip text</comment>
+  </data>
+  <data name="TriggerToolboxItem" xml:space="preserve">
+    <value>Trigger</value>
+    <comment>Toolbox item name</comment>
+  </data>
+  <data name="TriggerToolboxTooltip" xml:space="preserve">
+    <value>Trigger</value>
+    <comment>Toolbox tooltip text</comment>
+  </data>
+  <data name="ListenerToolboxItem" xml:space="preserve">
+    <value>Listener</value>
+    <comment>Toolbox item name</comment>
+  </data>
+  <data name="ListenerToolboxTooltip" xml:space="preserve">
+    <value>Listener</value>
+    <comment>Toolbox tooltip text</comment>
+  </data>
+  <data name="UnresolvedToolboxItem" xml:space="preserve">
+    <value>ToolboxItem {0} was not found</value>
+    <comment>Invalid toolId</comment>
+  </data>
+  <data name="UnsupportedToolboxFormat" xml:space="preserve">
+    <value>Unsupported toolbox format: {0}</value>
+    <comment>Unsupported format Id</comment>
+  </data>
+  <data name="UnrecognizedElementType" xml:space="preserve">
+    <value>ElementType {0} is not recognized as a type of domain class which belongs to this domain model.</value>
+    <comment>Incorrect ElementType passed in to Model.CreateElement method</comment>
+  </data>
+  <data name="UnrecognizedElementLinkType" xml:space="preserve">
+    <value>ElementLinkType {0} is not recognized as a type of domain relationship which belongs to this domain model.</value>
+    <comment>Incorrect ElementLinkType passed in to Model.CreateElementLink method</comment>
+  </data>
+  <data name="AmbiguousSchema" xml:space="preserve">
+    <value>More than one schema found for target namespace &apos;{0}&apos;, use the first one at &apos;{1}&apos;.</value>
+    <comment>Serialization Warning: AmbiguousSchema</comment>
+  </data>
+  <data name="ExpectingFullFormRelationship" xml:space="preserve">
+    <value>Element &apos;{0}&apos; is treated as the target role-player of a relationship &apos;{1}&apos; instance, which should be serialized in full-form.</value>
+    <comment>Serialization Warning: ExpectingFullFormRelationship</comment>
+  </data>
+  <data name="ExpectingShortFormRelationship" xml:space="preserve">
+    <value>Instances of relationship &apos;{0}&apos; should be serialized in short-form.</value>
+    <comment>Serialization Warning: ExpectingShortFormRelationship</comment>
+  </data>
+  <data name="IgnoredPropertyValue" xml:space="preserve">
+    <value>Invalid property value &apos;{0}&apos; for property &apos;{1}&apos; with type &apos;{2}&apos;, ignored.</value>
+    <comment>Serialization Warning: IgnoredPropertyValue</comment>
+  </data>
+  <data name="MissingId" xml:space="preserve">
+    <value>Missing &apos;Id&apos; attribute, a new Guid &apos;{0}&apos; is auto-generated.</value>
+    <comment>Serialization Warning: MissingId</comment>
+  </data>
+  <data name="MonikerResolvedToDuplicateLink" xml:space="preserve">
+    <value>Resolving moniker &apos;{0}&apos; causes a duplicate link to be created, so the link and the moniker are ignored.</value>
+    <comment>Serialization Warning: MonikerResolvedToDuplicateLink</comment>
+  </data>
+  <data name="NoSchema" xml:space="preserve">
+    <value>Cannot find a schema that defines target namespace &apos;{0}&apos;, schema validation skipped.</value>
+    <comment>Serialization Warning: NoSchema</comment>
+  </data>
+  <data name="UnexpectedXmlElement" xml:space="preserve">
+    <value>Unexpected XML element &apos;{0}&apos;, ignored.</value>
+    <comment>Serialization Warning: UnexpectedXmlElement</comment>
+  </data>
+  <data name="AmbiguousMoniker" xml:space="preserve">
+    <value>Ambiguous moniker &apos;{0}&apos; encountered. It is used for both &apos;{1}&apos; and &apos;{2}&apos;.</value>
+    <comment>Serialization Error: AmbiguousMoniker</comment>
+  </data>
+  <data name="CannotMonikerizeElement" xml:space="preserve">
+    <value>Instances of DomainClass &apos;{0}&apos; cannot be serialized as a moniker.
+A DomainClass can be serialized as a moniker only if 
+1) it has a defined/inherited DomainProperty marked as IsMonikerKey=true, or 
+2) it is marked/inherited with SerializeId=true.</value>
+    <comment>Serialization Error: CannotMonikerizeElement</comment>
+  </data>
+  <data name="CannotOpenDocument" xml:space="preserve">
+    <value>Error encountered, check Error List window for details.</value>
+    <comment>Serialization Error: CannotOpenDocument</comment>
+  </data>
+  <data name="CannotSaveDocument" xml:space="preserve">
+    <value>Error encountered, check Error List window for details.</value>
+    <comment>Serialization Error: CannotSaveDocument</comment>
+  </data>
+  <data name="DanglingRelationship" xml:space="preserve">
+    <value>Relationship &apos;{0}&apos; instance is missing target role-player.</value>
+    <comment>Serialization Error: DanglingRelationship</comment>
+  </data>
+  <data name="InvalidPropertyValue" xml:space="preserve">
+    <value>Invalid property value &apos;{0}&apos; for property &apos;{1}&apos; with type &apos;{2}&apos;.</value>
+    <comment>Serialization Error: InvalidPropertyValue</comment>
+  </data>
+  <data name="MissingMoniker" xml:space="preserve">
+    <value>Missing moniker. A moniker is expected in attribute &apos;{0}&apos;.</value>
+    <comment>Serialization Error: MissingMoniker</comment>
+  </data>
+  <data name="MissingTransaction" xml:space="preserve">
+    <value>This must be called within the context of an active transaction.</value>
+    <comment>Serialization Error: MissingTransaction</comment>
+  </data>
+  <data name="UnresolvedMoniker" xml:space="preserve">
+    <value>Cannot resolve moniker &apos;{0}&apos;.</value>
+    <comment>Serialization Error: UnresolvedMoniker</comment>
+  </data>
+  <data name="VersionMismatch" xml:space="preserve">
+    <value>Unsupported version &apos;{0}&apos;, can only support &apos;{1}&apos;.</value>
+    <comment>Serialization Error: VersionMismatch</comment>
+  </data>
+  <data name="CannotCloseExistingDiagramDocument" xml:space="preserve">
+    <value>Diagram file &apos;{0}&apos; cannot be closed.</value>
+    <comment>User cancel closing diagram file. Hence, the DSL model file cannot be opened</comment>
+  </data>
+  <data name="BindingErrorOccurred" xml:space="preserve">
+    <value>Extensions for this designer may not be found as a MEF binding error has occurred. The error that occurred was:
+{0}</value>
+    <comment>MEF binding error occurred - exception message being logged in the error window so the user is aware.</comment>
+  </data>
+  <data name="InvalidSaveRootElementType" xml:space="preserve">
+    <value>&apos;{0}&apos; is not a valid root element type.</value>
+    <comment>Exception message used if an invalid root element type is passed to IDomainModelSerializer.SaveModel / SaveModelAndDiagram</comment>
+  </data>
+  <data name="InvalidSaveDiagramType" xml:space="preserve">
+    <value>&apos;{0}&apos; is not a valid diagram type.</value>
+    <comment>Exception message used if an invalid diagram type is passed to IDomainModelSerializer.SaveModelAndDiagram</comment>
+  </data>
+  <data name="MinimumMultiplicityMissingLink" xml:space="preserve">
+    <value>{0} {1} has no {2}.</value>
+    <comment>Multiplicity underflow validation.</comment>
+  </data>
+  <data name="SaveOperationCancelled" xml:space="preserve">
+    <value>Save operation cancelled.</value>
+    <comment>Message when save is cancelled on validation errors</comment>
+  </data>
+  <data name="SaveValidationFailed" xml:space="preserve">
+    <value>There were validation errors, continue save?</value>
+    <comment>Message when validation errors are found on save</comment>
+  </data>
+  <data name="UnloadableSaveValidationFailed" xml:space="preserve">
+    <value>There were validation errors. Continuing to save may cause the file to become unloadable, do you want to continue?</value>
+    <comment>Message when validation errors are found on save that will cause file to become unloadable</comment>
+  </data>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="ActivityToolboxBitmap" type="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+    <value>..\Resources\ExampleShapeToolBitmap.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+    <comment>Toolbox item image</comment>
+  </data>
+  <data name="ActionToolboxBitmap" type="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+    <value>..\Resources\ExampleShapeToolBitmap.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+    <comment>Toolbox item image</comment>
+  </data>
+  <data name="TriggerToolboxBitmap" type="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+    <value>..\Resources\ExampleConnectorToolBitmap.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+    <comment>Toolbox item image</comment>
+  </data>
+  <data name="ListenerToolboxBitmap" type="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+    <value>..\Resources\ExampleConnectorToolBitmap.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+    <comment>Toolbox item image</comment>
+  </data>
+</root>
+
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModelResx.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModelResx.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainModelResx.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\DslResxGenerator.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainRelationships.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainRelationships.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainRelationships.cs	(revision 10525)
@@ -0,0 +1,932 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainRelationship SimulationModelHasActivities
+	/// Description for HeuristicLab.SimulationCore.SimulationModelHasActivities
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModelHasActivities.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModelHasActivities.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainRelationship(IsEmbedding=true)]
+	[DslModeling::DomainObjectId("4a4161d0-95d3-4727-8959-372bd8ba3fc7")]
+	public partial class SimulationModelHasActivities : DslModeling::ElementLink
+	{
+		#region Constructors, domain class Id
+		
+		/// <summary>
+		/// SimulationModelHasActivities domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x4a4161d0, 0x95d3, 0x4727, 0x89, 0x59, 0x37, 0x2b, 0xd8, 0xba, 0x3f, 0xc7);
+	
+				
+		/// <summary>
+		/// Constructor
+		/// Creates a SimulationModelHasActivities link in the same Partition as the given SimulationModel
+		/// </summary>
+		/// <param name="source">SimulationModel to use as the source of the relationship.</param>
+		/// <param name="target">Activity to use as the target of the relationship.</param>
+		public SimulationModelHasActivities(SimulationModel source, Activity target)
+			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(SimulationModelHasActivities.SimulationModelDomainRoleId, source), new DslModeling::RoleAssignment(SimulationModelHasActivities.ActivityDomainRoleId, target)}, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public SimulationModelHasActivities(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public SimulationModelHasActivities(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public SimulationModelHasActivities(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(partition, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public SimulationModelHasActivities(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, roleAssignments, propertyAssignments)
+		{
+		}
+		#endregion
+		#region SimulationModel domain role code
+		
+		/// <summary>
+		/// SimulationModel domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid SimulationModelDomainRoleId = new global::System.Guid(0x1026f01d, 0xc2bd, 0x47e0, 0xa7, 0xf9, 0x01, 0xc0, 0x55, 0x1c, 0x0e, 0x8d);
+		
+		/// <summary>
+		/// DomainRole SimulationModel
+		/// Description for
+		/// HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModel
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModelHasActivities/SimulationModel.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModelHasActivities/SimulationModel.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Activities", PropertyDisplayNameKey="HeuristicLab.SimulationCore.SimulationModelHasActivities/SimulationModel.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
+		[DslModeling::DomainObjectId("1026f01d-c2bd-47e0-a7f9-01c0551c0e8d")]
+		public virtual SimulationModel SimulationModel
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (SimulationModel)DslModeling::DomainRoleInfo.GetRolePlayer(this, SimulationModelDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, SimulationModelDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access SimulationModel of a Activity
+		/// <summary>
+		/// Gets SimulationModel.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static SimulationModel GetSimulationModel(Activity element)
+		{
+			return DslModeling::DomainRoleInfo.GetLinkedElement(element, ActivityDomainRoleId) as SimulationModel;
+		}
+		
+		/// <summary>
+		/// Sets SimulationModel.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static void SetSimulationModel(Activity element, SimulationModel newSimulationModel)
+		{
+			DslModeling::DomainRoleInfo.SetLinkedElement(element, ActivityDomainRoleId, newSimulationModel);
+		}
+		#endregion
+		#region Activity domain role code
+		
+		/// <summary>
+		/// Activity domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid ActivityDomainRoleId = new global::System.Guid(0xcd685a0e, 0x906c, 0x49b2, 0xbc, 0x7b, 0x0b, 0xdc, 0xc4, 0x39, 0xb6, 0x9e);
+		
+		/// <summary>
+		/// DomainRole Activity
+		/// Description for
+		/// HeuristicLab.SimulationCore.SimulationModelHasActivities.Activity
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModelHasActivities/Activity.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModelHasActivities/Activity.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "SimulationModel", PropertyDisplayNameKey="HeuristicLab.SimulationCore.SimulationModelHasActivities/Activity.PropertyDisplayName", PropagatesDelete = true,  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.One)]
+		[DslModeling::DomainObjectId("cd685a0e-906c-49b2-bc7b-0bdcc439b69e")]
+		public virtual Activity Activity
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (Activity)DslModeling::DomainRoleInfo.GetRolePlayer(this, ActivityDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, ActivityDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access Activities of a SimulationModel
+		/// <summary>
+		/// Gets a list of Activities.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static DslModeling::LinkedElementCollection<Activity> GetActivities(SimulationModel element)
+		{
+			return GetRoleCollection<DslModeling::LinkedElementCollection<Activity>, Activity>(element, SimulationModelDomainRoleId);
+		}
+		#endregion
+		#region SimulationModel link accessor
+		/// <summary>
+		/// Get the list of SimulationModelHasActivities links to a SimulationModel.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.SimulationModelHasActivities> GetLinksToActivities ( global::HeuristicLab.SimulationCore.SimulationModel simulationModelInstance )
+		{
+			return DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActivities>(simulationModelInstance, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModelDomainRoleId);
+		}
+		#endregion
+		#region Activity link accessor
+		/// <summary>
+		/// Get the SimulationModelHasActivities link to a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::HeuristicLab.SimulationCore.SimulationModelHasActivities GetLinkToSimulationModel (global::HeuristicLab.SimulationCore.Activity activityInstance)
+		{
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.SimulationModelHasActivities> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActivities>(activityInstance, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.ActivityDomainRoleId);
+			global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Activity not obeyed.");
+			if ( links.Count == 0 )
+			{
+				return null;
+			}
+			else
+			{
+				return links[0];
+			}
+		}
+		#endregion
+		#region SimulationModelHasActivities instance accessors
+		
+		/// <summary>
+		/// Get any SimulationModelHasActivities links between a given SimulationModel and a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.SimulationModelHasActivities> GetLinks( global::HeuristicLab.SimulationCore.SimulationModel source, global::HeuristicLab.SimulationCore.Activity target )
+		{
+			global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.SimulationModelHasActivities> outLinks = new global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.SimulationModelHasActivities>();
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.SimulationModelHasActivities> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActivities>(source, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModelDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.SimulationModelHasActivities link in links )
+			{
+				if ( target.Equals(link.Activity) )
+				{
+					outLinks.Add(link);
+				}
+			}
+			return outLinks.AsReadOnly();
+		}
+		/// <summary>
+		/// Get the one SimulationModelHasActivities link between a given SimulationModeland a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::HeuristicLab.SimulationCore.SimulationModelHasActivities GetLink( global::HeuristicLab.SimulationCore.SimulationModel source, global::HeuristicLab.SimulationCore.Activity target )
+		{
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.SimulationModelHasActivities> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActivities>(source, global::HeuristicLab.SimulationCore.SimulationModelHasActivities.SimulationModelDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.SimulationModelHasActivities link in links )
+			{
+				if ( target.Equals(link.Activity) )
+				{
+					return link;
+				}
+			}
+			return null;
+		}
+		
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainRelationship SimulationModelHasActions
+	/// Description for HeuristicLab.SimulationCore.SimulationModelHasActions
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModelHasActions.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModelHasActions.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainRelationship(IsEmbedding=true)]
+	[DslModeling::DomainObjectId("4f6020f0-423c-4469-af3f-09ac8db8d19a")]
+	public partial class SimulationModelHasActions : DslModeling::ElementLink
+	{
+		#region Constructors, domain class Id
+		
+		/// <summary>
+		/// SimulationModelHasActions domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x4f6020f0, 0x423c, 0x4469, 0xaf, 0x3f, 0x09, 0xac, 0x8d, 0xb8, 0xd1, 0x9a);
+	
+				
+		/// <summary>
+		/// Constructor
+		/// Creates a SimulationModelHasActions link in the same Partition as the given SimulationModel
+		/// </summary>
+		/// <param name="source">SimulationModel to use as the source of the relationship.</param>
+		/// <param name="target">Action to use as the target of the relationship.</param>
+		public SimulationModelHasActions(SimulationModel source, Action target)
+			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(SimulationModelHasActions.SimulationModelDomainRoleId, source), new DslModeling::RoleAssignment(SimulationModelHasActions.ActionDomainRoleId, target)}, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public SimulationModelHasActions(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public SimulationModelHasActions(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public SimulationModelHasActions(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(partition, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public SimulationModelHasActions(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, roleAssignments, propertyAssignments)
+		{
+		}
+		#endregion
+		#region SimulationModel domain role code
+		
+		/// <summary>
+		/// SimulationModel domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid SimulationModelDomainRoleId = new global::System.Guid(0x5f2e5817, 0x063b, 0x4f23, 0xa9, 0x96, 0xd4, 0x90, 0xac, 0x05, 0xec, 0x40);
+		
+		/// <summary>
+		/// DomainRole SimulationModel
+		/// Description for
+		/// HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModel
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModelHasActions/SimulationModel.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModelHasActions/SimulationModel.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Actions", PropertyDisplayNameKey="HeuristicLab.SimulationCore.SimulationModelHasActions/SimulationModel.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.PropagatesCopyToLinkAndOppositeRolePlayer, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
+		[DslModeling::DomainObjectId("5f2e5817-063b-4f23-a996-d490ac05ec40")]
+		public virtual SimulationModel SimulationModel
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (SimulationModel)DslModeling::DomainRoleInfo.GetRolePlayer(this, SimulationModelDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, SimulationModelDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access SimulationModel of a Action
+		/// <summary>
+		/// Gets SimulationModel.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static SimulationModel GetSimulationModel(Action element)
+		{
+			return DslModeling::DomainRoleInfo.GetLinkedElement(element, ActionDomainRoleId) as SimulationModel;
+		}
+		
+		/// <summary>
+		/// Sets SimulationModel.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static void SetSimulationModel(Action element, SimulationModel newSimulationModel)
+		{
+			DslModeling::DomainRoleInfo.SetLinkedElement(element, ActionDomainRoleId, newSimulationModel);
+		}
+		#endregion
+		#region Action domain role code
+		
+		/// <summary>
+		/// Action domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid ActionDomainRoleId = new global::System.Guid(0xa7f0817d, 0x4f04, 0x49ef, 0x95, 0x92, 0xe2, 0xf7, 0x84, 0x32, 0xcc, 0x4f);
+		
+		/// <summary>
+		/// DomainRole Action
+		/// Description for HeuristicLab.SimulationCore.SimulationModelHasActions.Action
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.SimulationModelHasActions/Action.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.SimulationModelHasActions/Action.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "SimulationModel", PropertyDisplayNameKey="HeuristicLab.SimulationCore.SimulationModelHasActions/Action.PropertyDisplayName", PropagatesDelete = true,  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.One)]
+		[DslModeling::DomainObjectId("a7f0817d-4f04-49ef-9592-e2f78432cc4f")]
+		public virtual Action Action
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (Action)DslModeling::DomainRoleInfo.GetRolePlayer(this, ActionDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, ActionDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access Actions of a SimulationModel
+		/// <summary>
+		/// Gets a list of Actions.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static DslModeling::LinkedElementCollection<Action> GetActions(SimulationModel element)
+		{
+			return GetRoleCollection<DslModeling::LinkedElementCollection<Action>, Action>(element, SimulationModelDomainRoleId);
+		}
+		#endregion
+		#region SimulationModel link accessor
+		/// <summary>
+		/// Get the list of SimulationModelHasActions links to a SimulationModel.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.SimulationModelHasActions> GetLinksToActions ( global::HeuristicLab.SimulationCore.SimulationModel simulationModelInstance )
+		{
+			return DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActions>(simulationModelInstance, global::HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModelDomainRoleId);
+		}
+		#endregion
+		#region Action link accessor
+		/// <summary>
+		/// Get the SimulationModelHasActions link to a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::HeuristicLab.SimulationCore.SimulationModelHasActions GetLinkToSimulationModel (global::HeuristicLab.SimulationCore.Action actionInstance)
+		{
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.SimulationModelHasActions> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActions>(actionInstance, global::HeuristicLab.SimulationCore.SimulationModelHasActions.ActionDomainRoleId);
+			global::System.Diagnostics.Debug.Assert(links.Count <= 1, "Multiplicity of Action not obeyed.");
+			if ( links.Count == 0 )
+			{
+				return null;
+			}
+			else
+			{
+				return links[0];
+			}
+		}
+		#endregion
+		#region SimulationModelHasActions instance accessors
+		
+		/// <summary>
+		/// Get any SimulationModelHasActions links between a given SimulationModel and a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.SimulationModelHasActions> GetLinks( global::HeuristicLab.SimulationCore.SimulationModel source, global::HeuristicLab.SimulationCore.Action target )
+		{
+			global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.SimulationModelHasActions> outLinks = new global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.SimulationModelHasActions>();
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.SimulationModelHasActions> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActions>(source, global::HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModelDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.SimulationModelHasActions link in links )
+			{
+				if ( target.Equals(link.Action) )
+				{
+					outLinks.Add(link);
+				}
+			}
+			return outLinks.AsReadOnly();
+		}
+		/// <summary>
+		/// Get the one SimulationModelHasActions link between a given SimulationModeland a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::HeuristicLab.SimulationCore.SimulationModelHasActions GetLink( global::HeuristicLab.SimulationCore.SimulationModel source, global::HeuristicLab.SimulationCore.Action target )
+		{
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.SimulationModelHasActions> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.SimulationModelHasActions>(source, global::HeuristicLab.SimulationCore.SimulationModelHasActions.SimulationModelDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.SimulationModelHasActions link in links )
+			{
+				if ( target.Equals(link.Action) )
+				{
+					return link;
+				}
+			}
+			return null;
+		}
+		
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainRelationship ActivityReferencesTriggers
+	/// Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActivityReferencesTriggers.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActivityReferencesTriggers.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainRelationship()]
+	[DslModeling::DomainObjectId("717952d5-7c93-4315-8e41-453cffe17811")]
+	public partial class ActivityReferencesTriggers : DslModeling::ElementLink
+	{
+		#region Constructors, domain class Id
+		
+		/// <summary>
+		/// ActivityReferencesTriggers domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x717952d5, 0x7c93, 0x4315, 0x8e, 0x41, 0x45, 0x3c, 0xff, 0xe1, 0x78, 0x11);
+	
+				
+		/// <summary>
+		/// Constructor
+		/// Creates a ActivityReferencesTriggers link in the same Partition as the given Activity
+		/// </summary>
+		/// <param name="source">Activity to use as the source of the relationship.</param>
+		/// <param name="target">Action to use as the target of the relationship.</param>
+		public ActivityReferencesTriggers(Activity source, Action target)
+			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ActivityReferencesTriggers.ActivityDomainRoleId, source), new DslModeling::RoleAssignment(ActivityReferencesTriggers.ActionDomainRoleId, target)}, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public ActivityReferencesTriggers(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public ActivityReferencesTriggers(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public ActivityReferencesTriggers(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(partition, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public ActivityReferencesTriggers(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, roleAssignments, propertyAssignments)
+		{
+		}
+		#endregion
+		#region Activity domain role code
+		
+		/// <summary>
+		/// Activity domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid ActivityDomainRoleId = new global::System.Guid(0x7796065f, 0x0003, 0x4aec, 0xbf, 0x7a, 0x6d, 0x22, 0xb9, 0x9f, 0x7c, 0x4b);
+		
+		/// <summary>
+		/// DomainRole Activity
+		/// Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Activity
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActivityReferencesTriggers/Activity.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActivityReferencesTriggers/Activity.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Triggers", PropertyDisplayNameKey="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Activity.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
+		[DslModeling::DomainObjectId("7796065f-0003-4aec-bf7a-6d22b99f7c4b")]
+		public virtual Activity Activity
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (Activity)DslModeling::DomainRoleInfo.GetRolePlayer(this, ActivityDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, ActivityDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access Activities of a Action
+		/// <summary>
+		/// Gets a list of Activities.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static DslModeling::LinkedElementCollection<Activity> GetActivities(Action element)
+		{
+			return GetRoleCollection<DslModeling::LinkedElementCollection<Activity>, Activity>(element, ActionDomainRoleId);
+		}
+		#endregion
+		#region Action domain role code
+		
+		/// <summary>
+		/// Action domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid ActionDomainRoleId = new global::System.Guid(0x93b557c0, 0x5b55, 0x4e27, 0xaa, 0x06, 0x6e, 0xdf, 0xbe, 0x50, 0x85, 0x85);
+		
+		/// <summary>
+		/// DomainRole Action
+		/// Description for HeuristicLab.SimulationCore.ActivityReferencesTriggers.Action
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActivityReferencesTriggers/Action.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActivityReferencesTriggers/Action.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Activities", PropertyDisplayNameKey="HeuristicLab.SimulationCore.ActivityReferencesTriggers/Action.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
+		[DslModeling::DomainObjectId("93b557c0-5b55-4e27-aa06-6edfbe508585")]
+		public virtual Action Action
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (Action)DslModeling::DomainRoleInfo.GetRolePlayer(this, ActionDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, ActionDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access Triggers of a Activity
+		/// <summary>
+		/// Gets a list of Triggers.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static DslModeling::LinkedElementCollection<Action> GetTriggers(Activity element)
+		{
+			return GetRoleCollection<DslModeling::LinkedElementCollection<Action>, Action>(element, ActivityDomainRoleId);
+		}
+		#endregion
+		#region Activity link accessor
+		/// <summary>
+		/// Get the list of ActivityReferencesTriggers links to a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers> GetLinksToTriggers ( global::HeuristicLab.SimulationCore.Activity activityInstance )
+		{
+			return DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers>(activityInstance, global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.ActivityDomainRoleId);
+		}
+		#endregion
+		#region Action link accessor
+		/// <summary>
+		/// Get the list of ActivityReferencesTriggers links to a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers> GetLinksToActivities ( global::HeuristicLab.SimulationCore.Action actionInstance )
+		{
+			return DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers>(actionInstance, global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.ActionDomainRoleId);
+		}
+		#endregion
+		#region ActivityReferencesTriggers instance accessors
+		
+		/// <summary>
+		/// Get any ActivityReferencesTriggers links between a given Activity and a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers> GetLinks( global::HeuristicLab.SimulationCore.Activity source, global::HeuristicLab.SimulationCore.Action target )
+		{
+			global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers> outLinks = new global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers>();
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers>(source, global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.ActivityDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.ActivityReferencesTriggers link in links )
+			{
+				if ( target.Equals(link.Action) )
+				{
+					outLinks.Add(link);
+				}
+			}
+			return outLinks.AsReadOnly();
+		}
+		/// <summary>
+		/// Get the one ActivityReferencesTriggers link between a given Activityand a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::HeuristicLab.SimulationCore.ActivityReferencesTriggers GetLink( global::HeuristicLab.SimulationCore.Activity source, global::HeuristicLab.SimulationCore.Action target )
+		{
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActivityReferencesTriggers>(source, global::HeuristicLab.SimulationCore.ActivityReferencesTriggers.ActivityDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.ActivityReferencesTriggers link in links )
+			{
+				if ( target.Equals(link.Action) )
+				{
+					return link;
+				}
+			}
+			return null;
+		}
+		
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainRelationship ActionReferencesListeners
+	/// Description for HeuristicLab.SimulationCore.ActionReferencesListeners
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActionReferencesListeners.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActionReferencesListeners.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainRelationship()]
+	[DslModeling::DomainObjectId("448eff77-5a72-420f-befa-d599574bb485")]
+	public partial class ActionReferencesListeners : DslModeling::ElementLink
+	{
+		#region Constructors, domain class Id
+		
+		/// <summary>
+		/// ActionReferencesListeners domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x448eff77, 0x5a72, 0x420f, 0xbe, 0xfa, 0xd5, 0x99, 0x57, 0x4b, 0xb4, 0x85);
+	
+				
+		/// <summary>
+		/// Constructor
+		/// Creates a ActionReferencesListeners link in the same Partition as the given Action
+		/// </summary>
+		/// <param name="source">Action to use as the source of the relationship.</param>
+		/// <param name="target">Activity to use as the target of the relationship.</param>
+		public ActionReferencesListeners(Action source, Activity target)
+			: base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(ActionReferencesListeners.ActionDomainRoleId, source), new DslModeling::RoleAssignment(ActionReferencesListeners.ActivityDomainRoleId, target)}, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public ActionReferencesListeners(DslModeling::Store store, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public ActionReferencesListeners(DslModeling::Store store, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, roleAssignments, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		public ActionReferencesListeners(DslModeling::Partition partition, params DslModeling::RoleAssignment[] roleAssignments)
+			: base(partition, roleAssignments, null)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new link is to be created.</param>
+		/// <param name="roleAssignments">List of relationship role assignments.</param>
+		/// <param name="propertyAssignments">List of properties assignments to set on the new link.</param>
+		public ActionReferencesListeners(DslModeling::Partition partition, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, roleAssignments, propertyAssignments)
+		{
+		}
+		#endregion
+		#region Action domain role code
+		
+		/// <summary>
+		/// Action domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid ActionDomainRoleId = new global::System.Guid(0x0e8492e9, 0x920e, 0x4d6c, 0xb3, 0x98, 0x53, 0x84, 0x4a, 0x0b, 0x82, 0x94);
+		
+		/// <summary>
+		/// DomainRole Action
+		/// Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Action
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActionReferencesListeners/Action.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActionReferencesListeners/Action.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Source, PropertyName = "Listeners", PropertyDisplayNameKey="HeuristicLab.SimulationCore.ActionReferencesListeners/Action.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
+		[DslModeling::DomainObjectId("0e8492e9-920e-4d6c-b398-53844a0b8294")]
+		public virtual Action Action
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (Action)DslModeling::DomainRoleInfo.GetRolePlayer(this, ActionDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, ActionDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access Actions of a Activity
+		/// <summary>
+		/// Gets a list of Actions.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static DslModeling::LinkedElementCollection<Action> GetActions(Activity element)
+		{
+			return GetRoleCollection<DslModeling::LinkedElementCollection<Action>, Action>(element, ActivityDomainRoleId);
+		}
+		#endregion
+		#region Activity domain role code
+		
+		/// <summary>
+		/// Activity domain role Id.
+		/// </summary>
+		public static readonly global::System.Guid ActivityDomainRoleId = new global::System.Guid(0xab4b8a78, 0xaa3e, 0x4315, 0x8b, 0xfd, 0xe4, 0x11, 0x26, 0xa5, 0xbc, 0x7a);
+		
+		/// <summary>
+		/// DomainRole Activity
+		/// Description for HeuristicLab.SimulationCore.ActionReferencesListeners.Activity
+		/// </summary>
+		[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActionReferencesListeners/Activity.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActionReferencesListeners/Activity.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+		[DslModeling::DomainRole(DslModeling::DomainRoleOrder.Target, PropertyName = "Actions", PropertyDisplayNameKey="HeuristicLab.SimulationCore.ActionReferencesListeners/Activity.PropertyDisplayName",  PropagatesCopy = DslModeling::PropagatesCopyOption.DoNotPropagateCopy, Multiplicity = DslModeling::Multiplicity.ZeroMany)]
+		[DslModeling::DomainObjectId("ab4b8a78-aa3e-4315-8bfd-e41126a5bc7a")]
+		public virtual Activity Activity
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				return (Activity)DslModeling::DomainRoleInfo.GetRolePlayer(this, ActivityDomainRoleId);
+			}
+			[global::System.Diagnostics.DebuggerStepThrough]
+			set
+			{
+				DslModeling::DomainRoleInfo.SetRolePlayer(this, ActivityDomainRoleId, value);
+			}
+		}
+				
+		#endregion
+		#region Static methods to access Listeners of a Action
+		/// <summary>
+		/// Gets a list of Listeners.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static DslModeling::LinkedElementCollection<Activity> GetListeners(Action element)
+		{
+			return GetRoleCollection<DslModeling::LinkedElementCollection<Activity>, Activity>(element, ActionDomainRoleId);
+		}
+		#endregion
+		#region Action link accessor
+		/// <summary>
+		/// Get the list of ActionReferencesListeners links to a Action.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.ActionReferencesListeners> GetLinksToListeners ( global::HeuristicLab.SimulationCore.Action actionInstance )
+		{
+			return DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActionReferencesListeners>(actionInstance, global::HeuristicLab.SimulationCore.ActionReferencesListeners.ActionDomainRoleId);
+		}
+		#endregion
+		#region Activity link accessor
+		/// <summary>
+		/// Get the list of ActionReferencesListeners links to a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.ActionReferencesListeners> GetLinksToActions ( global::HeuristicLab.SimulationCore.Activity activityInstance )
+		{
+			return DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActionReferencesListeners>(activityInstance, global::HeuristicLab.SimulationCore.ActionReferencesListeners.ActivityDomainRoleId);
+		}
+		#endregion
+		#region ActionReferencesListeners instance accessors
+		
+		/// <summary>
+		/// Get any ActionReferencesListeners links between a given Action and a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.ActionReferencesListeners> GetLinks( global::HeuristicLab.SimulationCore.Action source, global::HeuristicLab.SimulationCore.Activity target )
+		{
+			global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.ActionReferencesListeners> outLinks = new global::System.Collections.Generic.List<global::HeuristicLab.SimulationCore.ActionReferencesListeners>();
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.ActionReferencesListeners> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActionReferencesListeners>(source, global::HeuristicLab.SimulationCore.ActionReferencesListeners.ActionDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.ActionReferencesListeners link in links )
+			{
+				if ( target.Equals(link.Activity) )
+				{
+					outLinks.Add(link);
+				}
+			}
+			return outLinks.AsReadOnly();
+		}
+		/// <summary>
+		/// Get the one ActionReferencesListeners link between a given Actionand a Activity.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerStepThrough]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+		public static global::HeuristicLab.SimulationCore.ActionReferencesListeners GetLink( global::HeuristicLab.SimulationCore.Action source, global::HeuristicLab.SimulationCore.Activity target )
+		{
+			global::System.Collections.Generic.IList<global::HeuristicLab.SimulationCore.ActionReferencesListeners> links = DslModeling::DomainRoleInfo.GetElementLinks<global::HeuristicLab.SimulationCore.ActionReferencesListeners>(source, global::HeuristicLab.SimulationCore.ActionReferencesListeners.ActionDomainRoleId);
+			foreach ( global::HeuristicLab.SimulationCore.ActionReferencesListeners link in links )
+			{
+				if ( target.Equals(link.Activity) )
+				{
+					return link;
+				}
+			}
+			return null;
+		}
+		
+		#endregion
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainRelationships.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainRelationships.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/DomainRelationships.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\DomainRelationshipCodeGenerator.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HLSimSchema.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HLSimSchema.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HLSimSchema.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\DomainSchema.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HLSimSchema.xsd
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HLSimSchema.xsd	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HLSimSchema.xsd	(revision 10525)
@@ -0,0 +1,342 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema id="HLSimSchema" targetNamespace="http://schemas.microsoft.com/dsltools/HLSim" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/HLSim" xmlns:core="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <xsd:import id="CoreSchema" namespace="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" />
+  <!-- SimulationModel -->
+  <xsd:element name="simulationModel" type="SimulationModel" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="SimulationModel">
+    <xsd:annotation>
+      <xsd:documentation>The root in which all other elements are embedded. Appears as a diagram.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Relationship: SimulationModelHasActivities -->
+          <xsd:element name="activities" minOccurs="0" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>Instances of SimulationModelHasActivities</xsd:documentation>
+            </xsd:annotation>
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element ref="simulationModelHasActivities" minOccurs="0" maxOccurs="unbounded">
+                  <xsd:annotation>
+                    <xsd:documentation>[Instance of SimulationModelHasActivities needs to be serialized in full-form]</xsd:documentation>
+                  </xsd:annotation>
+                </xsd:element>
+              </xsd:sequence>
+            </xsd:complexType>
+          </xsd:element>
+          <!-- Relationship: SimulationModelHasActions -->
+          <xsd:element name="actions" minOccurs="0" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>Instances of SimulationModelHasActions</xsd:documentation>
+            </xsd:annotation>
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element ref="simulationModelHasActions" minOccurs="0" maxOccurs="unbounded">
+                  <xsd:annotation>
+                    <xsd:documentation>[Instance of SimulationModelHasActions needs to be serialized in full-form]</xsd:documentation>
+                  </xsd:annotation>
+                </xsd:element>
+              </xsd:sequence>
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <!-- dslVersion -->
+        <xsd:attribute name="dslVersion" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <!-- Property: ModelType -->
+        <xsd:attribute name="modelType" type="xsd:string" />
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- SimulationModel Moniker -->
+  <xsd:element name="simulationModelMoniker" type="SimulationModelMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="SimulationModelMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for SimulationModel instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- Activity -->
+  <xsd:element name="activity" type="Activity" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="Activity">
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Relationship: ActivityReferencesTriggers -->
+          <xsd:element name="triggers" minOccurs="0" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>Instances of ActivityReferencesTriggers</xsd:documentation>
+            </xsd:annotation>
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element ref="activityReferencesTriggers" minOccurs="0" maxOccurs="unbounded">
+                  <xsd:annotation>
+                    <xsd:documentation>[Instance of ActivityReferencesTriggers needs to be serialized in full-form]</xsd:documentation>
+                  </xsd:annotation>
+                </xsd:element>
+              </xsd:sequence>
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <!-- Property: Name -->
+        <xsd:attribute name="name" type="xsd:string" />
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- Activity Moniker -->
+  <xsd:element name="activityMoniker" type="ActivityMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="ActivityMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for Activity instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- Action -->
+  <xsd:element name="action" type="Action" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="Action">
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Relationship: ActionReferencesListeners -->
+          <xsd:element name="listeners" minOccurs="0" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>Instances of ActionReferencesListeners</xsd:documentation>
+            </xsd:annotation>
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element ref="actionReferencesListeners" minOccurs="0" maxOccurs="unbounded">
+                  <xsd:annotation>
+                    <xsd:documentation>[Instance of ActionReferencesListeners needs to be serialized in full-form]</xsd:documentation>
+                  </xsd:annotation>
+                </xsd:element>
+              </xsd:sequence>
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+        <!-- Property: Name -->
+        <xsd:attribute name="name" type="xsd:string" />
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- Action Moniker -->
+  <xsd:element name="actionMoniker" type="ActionMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="ActionMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for Action instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- SimulationModelHasActivities -->
+  <xsd:element name="simulationModelHasActivities" type="SimulationModelHasActivities" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="SimulationModelHasActivities">
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Target end Activity -->
+          <xsd:element ref="activity" minOccurs="1" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>[Target role-player]</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- SimulationModelHasActivities Moniker -->
+  <xsd:element name="simulationModelHasActivitiesMoniker" type="SimulationModelHasActivitiesMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="SimulationModelHasActivitiesMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for SimulationModelHasActivities instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- SimulationModelHasActions -->
+  <xsd:element name="simulationModelHasActions" type="SimulationModelHasActions" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="SimulationModelHasActions">
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Target end Action -->
+          <xsd:element ref="action" minOccurs="1" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>[Target role-player]</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- SimulationModelHasActions Moniker -->
+  <xsd:element name="simulationModelHasActionsMoniker" type="SimulationModelHasActionsMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="SimulationModelHasActionsMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for SimulationModelHasActions instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- ActivityReferencesTriggers -->
+  <xsd:element name="activityReferencesTriggers" type="ActivityReferencesTriggers" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="ActivityReferencesTriggers">
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Target end Action -->
+          <xsd:element ref="actionMoniker" minOccurs="1" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>[Target role-player]</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- ActivityReferencesTriggers Moniker -->
+  <xsd:element name="activityReferencesTriggersMoniker" type="ActivityReferencesTriggersMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="ActivityReferencesTriggersMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for ActivityReferencesTriggers instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- ActionReferencesListeners -->
+  <xsd:element name="actionReferencesListeners" type="ActionReferencesListeners" substitutionGroup="core:modelElement" />
+  <xsd:complexType name="ActionReferencesListeners">
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElement">
+        <xsd:sequence minOccurs="0" maxOccurs="1">
+          <!-- Target end Activity -->
+          <xsd:element ref="activityMoniker" minOccurs="1" maxOccurs="1">
+            <xsd:annotation>
+              <xsd:documentation>[Target role-player]</xsd:documentation>
+            </xsd:annotation>
+          </xsd:element>
+        </xsd:sequence>
+        <!-- Id -->
+        <xsd:attribute name="Id" type="xsd:string">
+          <xsd:annotation>
+            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+  <!-- ActionReferencesListeners Moniker -->
+  <xsd:element name="actionReferencesListenersMoniker" type="ActionReferencesListenersMoniker" substitutionGroup="core:modelElementMoniker" />
+  <xsd:complexType name="ActionReferencesListenersMoniker">
+    <xsd:annotation>
+      <xsd:documentation>Moniker for ActionReferencesListeners instance.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:complexContent>
+      <xsd:extension base="core:ModelElementMoniker">
+        <xsd:attribute name="Id" type="xsd:string" >
+          <xsd:annotation>
+            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
+          </xsd:annotation>
+        </xsd:attribute>
+      </xsd:extension>
+    </xsd:complexContent>
+  </xsd:complexType>
+  
+</xsd:schema>
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HelpKeywordHelper.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HelpKeywordHelper.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HelpKeywordHelper.cs	(revision 10525)
@@ -0,0 +1,148 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Helper class used to map shapes and model elements to help keywords.
+	/// </summary>
+	/// <remarks>
+	/// Double-derived class to allow easier code customization.
+	/// </remarks>
+	public partial class HLSimHelpKeywordHelper : HLSimHelpKeywordHelperBase 
+	{
+		
+		/// <summary>
+		/// Constructs a new HLSimHelpKeywordHelper.
+		/// </summary>
+		protected HLSimHelpKeywordHelper()
+			: base() { }
+			
+		/// <summary>
+		/// Single instance of the HLSimHelpKeywordHelper.
+		/// </summary>
+		public static HLSimHelpKeywordHelper Instance
+		{
+			get
+			{
+				return null; // This DSL does not define any help keywords.
+			}
+		}
+	}
+	
+	/// <summary>
+	/// Helper class used to map shapes and model elements to F1 help keywords.
+	/// </summary>
+	public abstract class HLSimHelpKeywordHelperBase
+	{
+		private global::System.Collections.Generic.Dictionary<string, string> helpKeywords;
+		
+		/// <summary>
+		/// Constructs a new HLSimHelpKeywordHelperBase.
+		/// </summary>
+		protected HLSimHelpKeywordHelperBase()
+			: base() { }
+			
+		/// <summary>
+		/// Called to initialize the HelpKeywords dictionary.  Derived classes may override this to add custom keywords to the collection.
+		/// </summary>
+		protected virtual void Initialize()
+		{
+			this.helpKeywords = new global::System.Collections.Generic.Dictionary<string, string>(0);
+		}
+		
+		/// <summary>
+		/// Collection of key/value pairs describing help keywords for this DSL.
+		/// Keys are strings such as domain class names that describe elements of the DSL.
+		/// Values are corresponding help keywords.
+		/// </summary>
+		protected global::System.Collections.Generic.IDictionary<string, string> HelpKeywords
+		{
+			get
+			{
+				if (this.helpKeywords == null)
+				{
+					this.helpKeywords = new global::System.Collections.Generic.Dictionary<string, string>(10);
+				}
+
+				return this.helpKeywords;
+			}
+		}
+		
+		/// <summary>
+		/// Gets the help keyword associated with the given shape or model element instance.
+		/// </summary>
+		/// <returns>Help keyword, or empty string if there is no associated help keyword.</returns>
+		public virtual string GetHelpKeyword(DslModeling::ModelElement modelElement)
+		{
+			if(modelElement == null) throw new global::System.ArgumentNullException("modelElement");
+			
+			if(this.helpKeywords == null)
+			{
+				Initialize();
+			}
+			
+			string helpKeyword;
+			if(this.helpKeywords.TryGetValue(modelElement.GetType().FullName, out helpKeyword))
+			{
+				return helpKeyword;
+			}
+			
+			return string.Empty;
+		}
+		
+		/// <summary>
+		/// Gets the help keyword associated with the given domain role.
+		/// </summary>
+		/// <returns>Help keyword, or empty string if there is no associated help keyword.</returns>
+		public virtual string GetDomainRoleHelpKeyword(DslModeling::DomainRoleInfo domainRole)
+		{
+			if(domainRole == null) throw new global::System.ArgumentNullException("domainRole");
+			
+			if(this.helpKeywords == null)
+			{
+				Initialize();
+			}
+			
+			string helpKeyword;
+			if(this.helpKeywords.TryGetValue(domainRole.DomainRelationship.ImplementationClass.FullName + "/" + domainRole.Name, out helpKeyword))
+			{
+				return helpKeyword;
+			}
+			
+			return string.Empty;
+		}
+		
+		/// <summary>
+		/// Gets the help keyword associated with the given domain property.
+		/// </summary>
+		/// <returns>Help keyword, or empty string if there is no associated help keyword.</returns>
+		public virtual string GetDomainPropertyHelpKeyword(DslModeling::DomainPropertyInfo domainProperty)
+		{
+			if(domainProperty == null) throw new global::System.ArgumentNullException("domainProperty");
+			
+			if(this.helpKeywords == null)
+			{
+				Initialize();
+			}
+			
+			string helpKeyword;
+			if(this.helpKeywords.TryGetValue(domainProperty.DomainClass.ImplementationClass.FullName + "/" + domainProperty.Name, out helpKeyword))
+			{
+				return helpKeyword;
+			}
+			
+			return string.Empty;
+		}
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HelpKeywordHelper.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HelpKeywordHelper.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/HelpKeywordHelper.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\HelpKeywordHelper.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/MultiplicityValidation.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/MultiplicityValidation.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/MultiplicityValidation.cs	(revision 10525)
@@ -0,0 +1,14 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslValidation = global::Microsoft.VisualStudio.Modeling.Validation;
+	
+ 
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/MultiplicityValidation.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/MultiplicityValidation.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/MultiplicityValidation.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\MultiplicityValidation.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #> 
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/PropertiesGrid.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/PropertiesGrid.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/PropertiesGrid.cs	(revision 10525)
@@ -0,0 +1,12 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+//
+// This file contains no code because there are no DomainTypeDescriptors defined for this DSL.
+//
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/PropertiesGrid.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/PropertiesGrid.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/PropertiesGrid.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\PropertiesGrid.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/SerializationHelper.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/SerializationHelper.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/SerializationHelper.cs	(revision 10525)
@@ -0,0 +1,1531 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using System.Linq;
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslValidation = global::Microsoft.VisualStudio.Modeling.Validation;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	
+	partial class HLSimDomainModel
+	{
+		///<Summary>
+		/// Provide an implementation of the partial method to set up the serialization behavior for this model.
+		///</Summary>
+		///<remarks>
+		/// This partial method is called from the constructor of the domain class.
+		///</remarks>
+		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance","CA1822:MarkMembersAsStatic", Justification="Alternative implementations might need to reference instance variables, so not marked as static.")]
+		partial void InitializeSerialization(DslModeling::Store store)
+		{
+			// Register the serializers and moniker resolver for this model
+			HLSimSerializationHelper.Instance.InitializeSerialization(store);	
+		}
+	}
+	
+	
+	/// <summary>
+	/// Helper class for serializing and deserializing HLSim models.
+	/// </summary>
+	public abstract partial class HLSimSerializationHelperBase
+	{
+		#region Constructor
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		protected HLSimSerializationHelperBase() { }
+		#endregion
+		
+		#region Methods
+		
+		/// <summary>
+		/// Ensure that moniker resolvers and domain element serializers are installed properly on the given store, 
+		/// so that deserialization can be carried out correctly.
+		/// </summary>
+		/// <param name="store">Store on which moniker resolvers will be set up.</param>
+		internal protected virtual void InitializeSerialization(DslModeling::Store store)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(store != null);
+			if (store == null)
+				throw new global::System.ArgumentNullException("store");
+			#endregion
+	
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(store);
+	
+			// Register the moniker resolver for this model, unless one is already registered
+			DslModeling::IMonikerResolver monikerResolver = store.FindMonikerResolver(HLSimDomainModel.DomainModelId);
+			if (monikerResolver == null)
+			{
+				monikerResolver = new HLSimSerializationBehaviorMonikerResolver(store, directory);
+				store.AddMonikerResolver(HLSimDomainModel.DomainModelId, monikerResolver);
+			}
+			
+			// Add serialization behaviors
+			directory.AddBehavior(HLSimSerializationBehavior.Instance);
+		}
+	
+		/// <Summary>
+		/// Called by the serialization helper to allow any necessary setup to be done on each load / save.
+		/// </Summary>
+		/// <param name="partition">The partition being serialized.</param>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="isLoading">Flag to indicate whether the file is being loaded or saved.</param>
+		/// <Remarks>The base implementation does nothing</Remarks>
+		protected virtual void InitializeSerializationContext(DslModeling::Partition partition, DslModeling::SerializationContext serializationContext, bool isLoading)
+		{
+		}
+	
+		/// <summary>
+		/// Return the directory of serializers to use
+		/// </summary>
+		protected virtual DslModeling::DomainXmlSerializerDirectory GetDirectory(DslModeling::Store store)
+		{
+			// Just return the default serialization directory from the store
+			return store.SerializerDirectory;
+		}
+			
+		/// <summary>
+		/// This method returns the moniker resolvers for each of the domain models in the store
+		/// </summary>
+		/// <param name="store">Store on which the moniker resolvers are set up.</param>
+		internal protected virtual global::System.Collections.Generic.IDictionary<global::System.Guid, DslModeling::IMonikerResolver> GetMonikerResolvers(DslModeling::Store store)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(store != null);
+			if (store == null)
+				throw new global::System.ArgumentNullException("store");
+			#endregion
+			
+			global::System.Collections.Generic.Dictionary<global::System.Guid, DslModeling::IMonikerResolver> result = new global::System.Collections.Generic.Dictionary<global::System.Guid, DslModeling::IMonikerResolver>();
+			foreach (DslModeling::DomainModelInfo modelInfo in store.DomainDataDirectory.DomainModels)
+			{
+				if (modelInfo.MonikerResolver != null)
+				{
+					result.Add(modelInfo.Id, modelInfo.MonikerResolver);
+				}
+			}
+			
+			return result;
+		}
+	
+		/// <summary>
+		/// Write extension element data inside the current XML element
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="element">The element whose attributes have just been written.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <remarks>The default implemenation is to write out all non-embedded extension elements,
+		/// regardless of whether they relate to the current element or not.
+		/// The additional data should be written as a series of one or more
+		/// XML elements.</remarks>
+		internal protected virtual void WriteExtensions(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			if (serializationContext == null)
+			{
+				throw new global::System.ArgumentNullException("serializationContext");
+			}
+			if (element == null)
+			{
+				throw new global::System.ArgumentNullException("element");
+			}
+			if (writer == null)
+			{
+				throw new global::System.ArgumentNullException("writer");
+			}
+	
+			// Build a list of extension elements to serialize
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::ModelElement> allExtensionElements = element.Partition.ElementDirectory.FindElements(DslModeling::ExtensionElement.DomainClassId, true);
+			global::System.Collections.Generic.IEnumerable<DslModeling::ExtensionElement> nonEmbeddedExtensionsElements = allExtensionElements.Where(e => DslModeling::DomainClassInfo.FindEmbeddingElementLink(e) == null).OfType<DslModeling::ExtensionElement>();
+	
+			DslModeling::SerializationUtilities.WriteExtensions(serializationContext, writer, nonEmbeddedExtensionsElements);
+		}
+	
+		/// <summary>
+		/// Read any extension data written inside this XML element
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="element">In-memory ModelElement instance that is currently being read.</param>
+		/// <param name="reader">Reader for the file being read. The reader is positioned after the attributes of the specified element.</param>
+		/// <remarks>The method reads any extension element data, regardless of whether it relates the current
+		/// element or not. There may be no additional data for the specified element.</remarks>
+		internal protected virtual void ReadExtensions(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			if (serializationContext == null)
+			{
+				throw new global::System.ArgumentNullException("serializationContext");
+			}
+			if (element == null)
+			{
+				throw new global::System.ArgumentNullException("element");
+			}
+			if (reader == null)
+			{
+				throw new global::System.ArgumentNullException("reader");
+			}
+	
+			if (string.CompareOrdinal(reader.LocalName, DslModeling::SerializationUtilities.ExtensionsXmlElementName) == 0)
+			{
+				DslModeling::SerializationUtilities.ReadExtensions(serializationContext, reader, element.Partition);
+			}
+		}
+		
+		/// <summary>
+		/// Writes the specified attribute to the file.
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="element">The element whose attributes have just been written.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="attributeName">Name of the attribute to be written</param>
+		/// <param name="attributeValue">Value of the attribute to be written</param>
+		/// <remarks>This is an extension point to allow customisation e.g. to encode the data
+		/// being written to the file.</remarks>
+		internal virtual void WriteAttributeString(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, string attributeName, string attributeValue)
+		{
+			writer.WriteAttributeString(attributeName, attributeValue);
+		}
+	
+		/// <summary>
+		/// Writes the specified element to the file.
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="element">The element whose attributes have just been written.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="elementName">Name of the element to be written.</param>
+		/// <param name="elementValue">Value of the element to be written.</param>
+		/// <remarks>This is an extension point to allow customisation e.g. to encode the data
+		/// being written to the file.</remarks>
+		internal virtual void WriteElementString(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, string elementName, string elementValue)
+		{
+			writer.WriteElementString(elementName, elementValue);
+		}
+	
+		/// <summary>
+		/// Reads and returns the value of an attribute.
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="element">The element whose attributes have just been written.</param>
+		/// <param name="reader">XmlReader to read the serialized data from.</param>
+		/// <param name="attributeName">The name of the attribute to be read.</param>
+		/// <returns>The value of the attribute.</returns>
+		/// <remarks>This is an extension point to allow customisation e.g. to decode the data
+		/// being written to the file.</remarks>
+		internal virtual string ReadAttribute(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader, string attributeName)
+		{
+			return reader.GetAttribute(attributeName);
+		}
+	
+		/// <summary>
+		/// Reads and returns the value of an element.
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="element">The element whose attributes have just been written.</param>
+		/// <param name="reader">XmlReader to read the serialized data from.</param>
+		/// <returns>The value of the element.</returns>
+		/// <remarks>This is an extension point to allow customisation e.g. to decode the data
+		/// being written to the file.</remarks>
+		internal virtual string ReadElementContentAsString(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			return reader.ReadElementContentAsString();
+		}
+	
+		/// <summary>
+		/// Creates and returns the settings used when reading a file.
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="isDiagram">Indicates whether a diagram or model file is currently being serialized.</param>
+		internal virtual global::System.Xml.XmlReaderSettings CreateXmlReaderSettings(DslModeling::SerializationContext serializationContext, bool isDiagram)
+		{
+			return new global::System.Xml.XmlReaderSettings();
+		}
+	
+		/// <summary>
+		/// Creates and returns the settings used when writing a file.
+		/// </summary>
+		/// <param name="serializationContext">The current serialization context instance.</param>
+		/// <param name="isDiagram">Indicates whether a diagram or model file is currently being serialized.</param>
+		/// <param name="encoding">The encoding to use when writing the file.</param>
+		internal virtual global::System.Xml.XmlWriterSettings CreateXmlWriterSettings(DslModeling::SerializationContext serializationContext, bool isDiagram, global::System.Text.Encoding encoding)
+		{
+			global::System.Xml.XmlWriterSettings settings = new global::System.Xml.XmlWriterSettings();
+			settings.Indent = true;
+			settings.Encoding = encoding;
+	
+			return settings;
+		}
+		
+		#endregion
+	}
+	
+	/// <summary>
+	/// Helper class for serializing and deserializing HLSim models.
+	/// </summary>
+	public sealed partial class HLSimSerializationHelper : HLSimSerializationHelperBase
+	{
+		#region Constructor
+		/// <summary>
+		/// Private constructor to prevent direct instantiation.
+		/// </summary>
+		private HLSimSerializationHelper() : base () { }
+		#endregion
+		
+		#region Singleton Instance
+		/// <summary>
+		/// Singleton instance.
+		/// </summary>
+		private static HLSimSerializationHelper instance;
+		/// <summary>
+		/// Singleton instance.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerBrowsable(global::System.Diagnostics.DebuggerBrowsableState.Never)] // Will trigger creation otherwise.
+		public static HLSimSerializationHelper Instance
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get
+			{
+				if (HLSimSerializationHelper.instance == null)
+					HLSimSerializationHelper.instance = new HLSimSerializationHelper();
+				return HLSimSerializationHelper.instance;
+			}
+		}
+		#endregion
+	}
+	
+}
+
+
+namespace HeuristicLab.SimulationCore
+{
+	
+	partial class HLSimSerializationHelperBase
+	{
+	
+		/// <summary>
+		/// Loads a SimulationModel instance into the default partition of the given store, and ignore serialization result.
+		/// </summary>
+		/// <param name="store">The new SimulationModel instance will be created into the default partition of this store.</param>
+		/// <param name="fileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="schemaResolver">
+		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
+		/// If null is passed, schema validation will not be performed.
+		/// </param>
+		/// <param name="validationController">
+		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
+		/// is passed, load-time validation will not be performed.
+		/// </param>
+		/// <param name="serializerLocator">
+		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
+		/// </param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		public virtual SimulationModel LoadModel(DslModeling::Store store, string fileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
+		{
+			#region Check Parameters
+			if (store == null) 
+				throw new global::System.ArgumentNullException("store");
+			#endregion
+			
+			return this.LoadModel(new DslModeling::SerializationResult(), store.DefaultPartition, fileName, schemaResolver, validationController, serializerLocator);
+		}
+		
+		/// <summary>
+		/// Loads a SimulationModel instance into the default partition of the given store.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
+		/// <param name="store">The new SimulationModel instance will be created into the default partition of this store.</param>
+		/// <param name="fileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="schemaResolver">
+		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
+		/// If null is passed, schema validation will not be performed.
+		/// </param>
+		/// <param name="validationController">
+		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
+		/// is passed, load-time validation will not be performed.
+		/// </param>
+		/// <param name="serializerLocator">
+		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
+		/// </param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		public virtual SimulationModel LoadModel(DslModeling::SerializationResult serializationResult, DslModeling::Store store, string fileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
+		{
+			#region Check Parameters
+			if (store == null) 
+				throw new global::System.ArgumentNullException("store");
+			#endregion
+			
+			return this.LoadModel(serializationResult, store.DefaultPartition, fileName, schemaResolver, validationController, serializerLocator);
+		}
+	
+		/// <summary>
+		/// Loads a SimulationModel instance.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
+		/// <param name="partition">Partition in which the new SimulationModel instance will be created.</param>
+		/// <param name="fileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="schemaResolver">
+		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
+		/// If null is passed, schema validation will not be performed.
+		/// </param>
+		/// <param name="validationController">
+		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
+		/// is passed, load-time validation will not be performed.
+		/// </param>
+		/// <param name="serializerLocator">
+		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
+		/// </param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability","CA1506:AvoidExcessiveClassCoupling", Justification="Generated code")]
+		public virtual SimulationModel LoadModel(DslModeling::SerializationResult serializationResult, DslModeling::Partition partition, string fileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
+		{
+			#region Check Parameters
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			if (partition == null)
+				throw new global::System.ArgumentNullException("partition");
+			if (string.IsNullOrEmpty(fileName))
+				throw new global::System.ArgumentNullException("fileName");
+			#endregion
+		
+			// Ensure there is a transaction for this model to Load in.
+			if (!partition.Store.TransactionActive)
+			{
+				throw new global::System.InvalidOperationException(HLSimDomainModel.SingletonResourceManager.GetString("MissingTransaction"));
+			}
+			
+			SimulationModel modelRoot = null;
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(partition.Store);
+			DslModeling::DomainClassXmlSerializer modelRootSerializer = directory.GetSerializer(SimulationModel.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(modelRootSerializer != null, "Cannot find serializer for SimulationModel!");
+			if (modelRootSerializer != null)
+			{
+				using (global::System.IO.FileStream fileStream = global::System.IO.File.OpenRead(fileName))
+				{
+					DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileStream.Name, serializationResult);
+					this.InitializeSerializationContext(partition, serializationContext, true);
+					DslModeling::TransactionContext transactionContext = new DslModeling::TransactionContext();
+					transactionContext.Add(DslModeling::SerializationContext.TransactionContextKey, serializationContext);
+					using (DslModeling::Transaction t = partition.Store.TransactionManager.BeginTransaction("Load Model from " + fileName, true, transactionContext))
+					{
+						// Ensure there is some content in the file.  Blank (or almost blank, to account for encoding header bytes, etc.)
+						// files will cause a new root element to be created and returned. 
+						if (fileStream.Length > 5)
+						{
+							try
+							{
+								global::System.Xml.XmlReaderSettings settings = HLSimSerializationHelper.Instance.CreateXmlReaderSettings(serializationContext, false);
+								using (global::System.Xml.XmlReader reader = global::System.Xml.XmlReader.Create(fileStream, settings))
+								{
+									// Attempt to read the encoding.
+									reader.Read(); // Move to the first node - will be the XmlDeclaration if there is one.
+									global::System.Text.Encoding encoding;
+									if (this.TryGetEncoding(reader, out encoding))
+									{
+										serializationResult.Encoding = encoding;
+									}
+	
+									// Load any additional domain models that are required
+									DslModeling::SerializationUtilities.ResolveDomainModels(reader, serializerLocator, partition.Store);
+								
+									reader.MoveToContent();
+	
+									
+									modelRoot = modelRootSerializer.TryCreateInstance(serializationContext, reader, partition) as SimulationModel;
+									if (modelRoot != null && !serializationResult.Failed)
+									{
+										this.ReadRootElement(serializationContext, modelRoot, reader, schemaResolver);
+									}
+								}
+	
+							}
+							catch (global::System.Xml.XmlException xEx)
+							{
+								DslModeling::SerializationUtilities.AddMessage(
+									serializationContext,
+									DslModeling::SerializationMessageKind.Error,
+									xEx
+								);
+							}
+						}
+				
+						if(modelRoot == null && !serializationResult.Failed)
+						{
+							// create model root if it doesn't exist.
+							modelRoot = this.CreateModelHelper(partition);
+						}
+						if (t.IsActive)
+							t.Commit();
+					} // End Inner Tx
+	
+					// Do load-time validation if a ValidationController is provided.
+					if (!serializationResult.Failed && validationController != null)
+					{
+						using (new SerializationValidationObserver(serializationResult, validationController))
+						{
+							validationController.Validate(partition, DslValidation::ValidationCategories.Load);
+						}
+					}
+	
+				}
+			}
+			return modelRoot;
+		}
+	
+		/// <summary>
+		/// Attempts to return the encoding used by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The reader will be positioned at the start of the document when calling this method.
+		/// </remarks>
+		protected virtual bool TryGetEncoding(global::System.Xml.XmlReader reader, out global::System.Text.Encoding encoding)
+		{
+			global::System.Diagnostics.Debug.Assert(reader.NodeType == System.Xml.XmlNodeType.XmlDeclaration, "reader should be at the XmlDeclaration node when calling this method");
+	
+			encoding = null;
+			// Attempt to read and parse the "encoding" attribute from the XML declaration node
+			if (reader.NodeType == global::System.Xml.XmlNodeType.XmlDeclaration)
+			{
+				string encodingName = reader.GetAttribute("encoding");
+				if (!string.IsNullOrWhiteSpace(encodingName))
+				{
+					encoding = global::System.Text.Encoding.GetEncoding(encodingName);
+					return true;
+				}
+			}
+			return false;
+		}
+	
+		/// <summary>
+		/// Saves the given model root to the given file, with default encoding (UTF-8), and optional properties with default value will not
+		/// be written out.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="fileName">Name of the file in which the SimulationModel instance will be saved.</param>
+		public virtual void SaveModel(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string fileName)
+		{
+			this.SaveModel(serializationResult, modelRoot, fileName, global::System.Text.Encoding.UTF8, false);
+		}
+		
+		/// <summary>
+		/// Saves the given model to the given file, with default encoding (UTF-8).
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="fileName">Name of the file in which the SimulationModel instance will be saved.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		public virtual void SaveModel(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string fileName, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			this.SaveModel(serializationResult, modelRoot, fileName, global::System.Text.Encoding.UTF8, writeOptionalPropertiesWithDefaultValue);
+		}
+	
+		/// <summary>
+		/// Saves the given model root to the given file, with specified encoding.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="fileName">Name of the file in which the SimulationModel instance will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the SimulationModel instance.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+		public virtual void SaveModel(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string fileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			#region Check Parameters
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			if (modelRoot == null)
+				throw new global::System.ArgumentNullException("modelRoot");
+			if (string.IsNullOrEmpty(fileName))
+				throw new global::System.ArgumentNullException("fileName");
+			#endregion
+	
+			if (serializationResult.Failed)
+				return;
+	
+			using (global::System.IO.MemoryStream newFileContent = this.InternalSaveModel(serializationResult, modelRoot, fileName, encoding, writeOptionalPropertiesWithDefaultValue))
+			{
+				if (!serializationResult.Failed && newFileContent != null)
+				{	// Only write the content if there's no error encountered during serialization.
+					using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(fileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
+					{
+						using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
+						{
+							writer.Write(newFileContent.ToArray());
+						}
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Saves the given model root as a in-memory stream.
+		/// This is a helper used by SaveModel() and SaveModelAndDiagram(). When saving the model and the diagram together, we want to make sure that 
+		/// both can be saved without error before writing the content to disk, so we serialize the model into a in-memory stream first.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="fileName">Name of the file in which the SimulationModel instance will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the SimulationModel instance.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		/// <returns>In-memory stream containing the serialized SimulationModel instance.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+		internal global::System.IO.MemoryStream InternalSaveModel(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string fileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationResult != null);
+			global::System.Diagnostics.Debug.Assert(modelRoot != null);
+			global::System.Diagnostics.Debug.Assert(!serializationResult.Failed);
+			#endregion
+	
+			serializationResult.Encoding = encoding;
+	
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(modelRoot.Store);
+	
+			
+			global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream();
+			
+			DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileName, serializationResult);
+			this.InitializeSerializationContext(modelRoot.Partition, serializationContext, false);
+			// MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
+			serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
+			global::System.Xml.XmlWriterSettings settings = HLSimSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, false, encoding);
+			using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
+			{
+				this.WriteRootElement(serializationContext, modelRoot, writer);
+			}
+				
+			return newFileContent;
+		}
+		/// <summary>
+		/// Saves the given model root as a in-memory stream.
+		/// This is a helper used by SaveModel() and SaveModelAndDiagram(). When saving the model and the diagram together, we want to make sure that 
+		/// both can be saved without error before writing the content to disk, so we serialize the model into a in-memory stream first.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the diagram.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		/// <returns>In-memory stream containing the serialized HLSimDiagram instance.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+		internal global::System.IO.MemoryStream InternalSaveDiagram(DslModeling::SerializationResult serializationResult, HLSimDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationResult != null);
+			global::System.Diagnostics.Debug.Assert(diagram != null);
+			global::System.Diagnostics.Debug.Assert(!serializationResult.Failed);
+			#endregion
+	
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(diagram.Store);
+	
+			
+			global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream();
+			
+			DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, diagramFileName, serializationResult);
+			this.InitializeSerializationContext(diagram.Partition, serializationContext, false);
+			// MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
+			serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
+			global::System.Xml.XmlWriterSettings settings = HLSimSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, true, encoding);
+			using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
+			{
+				this.WriteRootElement(serializationContext, diagram, writer);
+			}
+	
+			return newFileContent;
+		}
+	
+		/// <summary>
+		/// Helper method to create and initialize a new SimulationModel.
+		/// </summary>
+		internal protected virtual SimulationModel CreateModelHelper(DslModeling::Partition modelPartition)
+		{
+			SimulationModel model = new SimulationModel(modelPartition);
+			return model;
+		}
+		
+		/// <summary>
+		/// Loads a SimulationModel instance and its associated diagram file into the default partition of the given store, and ignore serialization result.
+		/// </summary>
+		/// <param name="store">The new SimulationModel instance will be created into the default partition of this store.</param>
+		/// <param name="modelFileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="diagramFileName">Name of the file from which the HLSimDiagram instance will be deserialized.</param>
+		/// <param name="schemaResolver">
+		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
+		/// If null is passed, schema validation will not be performed.
+		/// </param>
+		/// <param name="validationController">
+		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
+		/// is passed, load-time validation will not be performed.
+		/// </param>
+		/// <param name="serializerLocator">
+		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
+		/// </param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		public virtual SimulationModel LoadModelAndDiagram(DslModeling::Store store, string modelFileName, string diagramFileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
+		{
+			return this.LoadModelAndDiagram(new DslModeling::SerializationResult(), store, modelFileName, diagramFileName, schemaResolver, validationController, serializerLocator);
+		}
+		
+		/// <summary>
+		/// Loads a SimulationModel instance and its associated diagram file into the default partition of the given store.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
+		/// <param name="store">The new SimulationModel instance will be created into the default partition of this store.</param>
+		/// <param name="modelFileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="diagramFileName">Name of the file from which the HLSimDiagram instance will be deserialized.</param>
+		/// <param name="schemaResolver">
+		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
+		/// If null is passed, schema validation will not be performed.
+		/// </param>
+		/// <param name="validationController">
+		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
+		/// is passed, load-time validation will not be performed.
+		/// </param>
+		/// <param name="serializerLocator">
+		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
+		/// </param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		public virtual SimulationModel LoadModelAndDiagram(DslModeling::SerializationResult serializationResult, DslModeling::Store store, string modelFileName, string diagramFileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
+		{
+			#region Check Parameters
+			if (store == null)
+				throw new global::System.ArgumentNullException("store");
+			#endregion
+			
+			DslModeling::Partition diagramPartition = new DslModeling::Partition(store);
+			return this.LoadModelAndDiagram(serializationResult, store.DefaultPartition, modelFileName, diagramPartition, diagramFileName, schemaResolver, validationController, serializerLocator);
+		}
+			
+		/// <summary>
+		/// Loads a SimulationModel instance and its associated diagram file.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
+		/// <param name="modelPartition">Partition in which the new SimulationModel instance will be created.</param>
+		/// <param name="modelFileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="diagramPartition">Partition in which the new HLSimDiagram instance will be created.</param>
+		/// <param name="diagramFileName">Name of the file from which the HLSimDiagram instance will be deserialized.</param>
+		/// <param name="schemaResolver">
+		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
+		/// If null is passed, schema validation will not be performed.
+		/// </param>
+		/// <param name="validationController">
+		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
+		/// is passed, load-time validation will not be performed.
+		/// </param>
+		/// <param name="serializerLocator">
+		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
+		/// </param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]
+		public virtual SimulationModel LoadModelAndDiagram(DslModeling::SerializationResult serializationResult, DslModeling::Partition modelPartition, string modelFileName, DslModeling::Partition diagramPartition, string diagramFileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
+		{
+			#region Check Parameters
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			if (modelPartition == null)		
+				throw new global::System.ArgumentNullException("modelPartition");
+			if (diagramPartition == null)
+				throw new global::System.ArgumentNullException("diagramPartition");
+			if (string.IsNullOrEmpty(diagramFileName))
+				throw new global::System.ArgumentNullException("diagramFileName");
+			#endregion
+	
+			SimulationModel modelRoot;
+	
+			// Ensure there is an outer transaction spanning both model and diagram load, so moniker resolution works properly.
+			if (!diagramPartition.Store.TransactionActive)
+			{
+				throw new global::System.InvalidOperationException(HLSimDomainModel.SingletonResourceManager.GetString("MissingTransaction"));
+			}
+	
+			modelRoot = this.LoadModel(serializationResult, modelPartition, modelFileName, schemaResolver, validationController, serializerLocator);
+	
+			if (serializationResult.Failed)
+			{
+				// don't try to deserialize diagram data if model load failed.
+				return modelRoot;
+			}
+	
+			HLSimDiagram diagram = null;
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(diagramPartition.Store);
+			DslModeling::DomainClassXmlSerializer diagramSerializer = directory.GetSerializer(HLSimDiagram.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(diagramSerializer != null, "Cannot find serializer for HLSimDiagram");
+			if (diagramSerializer != null)
+			{
+				if(!global::System.IO.File.Exists(diagramFileName))
+				{
+					// missing diagram file indicates we should create a new diagram.
+					diagram = this.CreateDiagramHelper(diagramPartition, modelRoot);
+				}
+				else
+				{
+					using (global::System.IO.FileStream fileStream = global::System.IO.File.OpenRead(diagramFileName))
+					{
+						DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, fileStream.Name, serializationResult);
+						this.InitializeSerializationContext(diagramPartition, serializationContext, true);
+						DslModeling::TransactionContext transactionContext = new DslModeling::TransactionContext();
+						transactionContext.Add(DslModeling::SerializationContext.TransactionContextKey, serializationContext);
+						
+						using (DslModeling::Transaction t = diagramPartition.Store.TransactionManager.BeginTransaction("LoadDiagram", true, transactionContext))
+						{
+							// Ensure there is some content in the file. Blank (or almost blank, to account for encoding header bytes, etc.)
+							// files will cause a new diagram to be created and returned 
+							if (fileStream.Length > 5)
+							{
+								global::System.Xml.XmlReaderSettings settings = HLSimSerializationHelper.Instance.CreateXmlReaderSettings(serializationContext, false);
+								try
+								{
+									using (global::System.Xml.XmlReader reader = global::System.Xml.XmlReader.Create(fileStream, settings))
+									{
+										reader.MoveToContent();
+										diagram = diagramSerializer.TryCreateInstance(serializationContext, reader, diagramPartition) as HLSimDiagram;
+										if (diagram != null)
+										{
+											this.ReadRootElement(serializationContext, diagram, reader, schemaResolver);
+										}
+									}
+								}
+								catch (global::System.Xml.XmlException xEx)
+								{
+									DslModeling::SerializationUtilities.AddMessage(
+										serializationContext,
+										DslModeling::SerializationMessageKind.Error,
+										xEx
+									);
+								}
+								if (serializationResult.Failed)
+								{	
+									// Serialization error encountered, rollback the transaction.
+									diagram = null;
+									t.Rollback();
+								}
+							}
+							
+							if(diagram == null && !serializationResult.Failed)
+							{
+								// Create diagram if it doesn't exist
+								diagram = this.CreateDiagramHelper(diagramPartition, modelRoot);
+							}
+							
+							if (t.IsActive)
+								t.Commit();
+						} // End inner Tx
+	
+						// Do load-time validation if a ValidationController is provided.
+						if (!serializationResult.Failed && validationController != null)
+						{
+							using (new SerializationValidationObserver(serializationResult, validationController))
+							{
+								validationController.Validate(diagramPartition, DslValidation::ValidationCategories.Load);
+							}
+						}
+					}
+				}
+	
+				if (diagram != null)
+				{
+					if (!serializationResult.Failed)
+					{	// Succeeded.
+						diagram.ModelElement = modelRoot;
+						diagram.PostDeserialization(true);
+						this.CheckForOrphanedShapes(diagram, serializationResult);
+					}
+					else
+					{	// Failed.
+						diagram.PostDeserialization(false);
+					}
+				}
+			}
+			return modelRoot;
+		}
+	
+		/// <summary>
+		/// Helper method to create and initialize a new HLSimDiagram.
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="modelRoot", Justification = "Signature enforced by caller.")]
+		internal protected virtual HLSimDiagram CreateDiagramHelper(DslModeling::Partition diagramPartition, DslModeling::ModelElement modelRoot)
+		{
+			HLSimDiagram diagram = new HLSimDiagram(diagramPartition);
+			return diagram;
+		}
+		
+	
+		/// <summary>
+		/// Saves the given diagram to the given file, with default encoding (UTF-8), and optional properties with default value will not
+		/// be written out.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="modelFileName">Name of the file in which the CanonicalSampleRoot instance will be saved.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		public virtual void SaveModelAndDiagram(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string modelFileName, HLSimDiagram diagram, string diagramFileName)
+		{
+			this.SaveModelAndDiagram(serializationResult, modelRoot, modelFileName, diagram, diagramFileName, global::System.Text.Encoding.UTF8, false);
+		}
+		
+		/// <summary>
+		/// Saves the given diagram to the given file, with default encoding (UTF-8).
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="modelFileName">Name of the file in which the CanonicalSampleRoot instance will be saved.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		public virtual void SaveModelAndDiagram(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string modelFileName, HLSimDiagram diagram, string diagramFileName, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			this.SaveModelAndDiagram(serializationResult, modelRoot, modelFileName, diagram, diagramFileName, global::System.Text.Encoding.UTF8, writeOptionalPropertiesWithDefaultValue);
+		}
+	
+		/// <summary>
+		/// Saves the given SimulationModel and HLSimDiagram to the given files, with specified encoding.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="modelFileName">Name of the file in which the CanonicalSampleRoot instance will be saved.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the diagram.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+		public virtual void SaveModelAndDiagram(DslModeling::SerializationResult serializationResult, SimulationModel modelRoot, string modelFileName, HLSimDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			#region Check Parameters
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			if (string.IsNullOrEmpty(modelFileName))
+				throw new global::System.ArgumentNullException("modelFileName");
+			if (diagram == null)
+				throw new global::System.ArgumentNullException("diagram");
+			if (string.IsNullOrEmpty(diagramFileName))
+				throw new global::System.ArgumentNullException("diagramFileName");
+			#endregion
+	
+			if (serializationResult.Failed)
+				return;
+	
+			// Save the model file first
+			using (global::System.IO.MemoryStream modelFileContent = this.InternalSaveModel(serializationResult, modelRoot, modelFileName, encoding, writeOptionalPropertiesWithDefaultValue))
+			{
+				if (serializationResult.Failed)
+					return;
+	
+				using (global::System.IO.MemoryStream diagramFileContent = this.InternalSaveDiagram(serializationResult, diagram, diagramFileName, encoding, writeOptionalPropertiesWithDefaultValue))
+				{
+					if (!serializationResult.Failed)
+					{
+						// Only write the contents if there's no error encountered during serialization.
+						if (modelFileContent != null)
+						{
+							using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(modelFileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
+							{
+								using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
+								{
+									writer.Write(modelFileContent.ToArray());
+								}
+							}
+						}
+						if (diagramFileContent != null)
+						{
+							using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(diagramFileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
+							{
+								using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
+								{
+									writer.Write(diagramFileContent.ToArray());
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Saves the given diagram to the given file, with default encoding (UTF-8), and optional properties with default value will not
+		/// be written out.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		public virtual void SaveDiagram(DslModeling::SerializationResult serializationResult, HLSimDiagram diagram, string diagramFileName)
+		{
+			this.SaveDiagram(serializationResult, diagram, diagramFileName, global::System.Text.Encoding.UTF8, false);
+		}
+		
+		/// <summary>
+		/// Saves the given diagram to the given file, with default encoding (UTF-8).
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		public virtual void SaveDiagram(DslModeling::SerializationResult serializationResult, HLSimDiagram diagram, string diagramFileName, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			this.SaveDiagram(serializationResult, diagram, diagramFileName, global::System.Text.Encoding.UTF8, writeOptionalPropertiesWithDefaultValue);
+		}
+	
+		/// <summary>
+		/// Saves the given HLSimDiagram to the given file, with specified encoding.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the diagram.</param>
+		/// <param name="writeOptionalPropertiesWithDefaultValue">Whether optional properties with default value will be saved.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+		public virtual void SaveDiagram(DslModeling::SerializationResult serializationResult, HLSimDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
+		{
+			#region Check Parameters
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			if (diagram == null)
+				throw new global::System.ArgumentNullException("diagram");
+			if (string.IsNullOrEmpty(diagramFileName))
+				throw new global::System.ArgumentNullException("diagramFileName");
+			#endregion
+	
+			if (serializationResult.Failed)
+				return;
+	
+			using (global::System.IO.MemoryStream diagramFileContent = this.InternalSaveDiagram(serializationResult, diagram, diagramFileName, encoding, writeOptionalPropertiesWithDefaultValue))
+			{
+				if (!serializationResult.Failed)
+				{
+					// Only write the contents if there's no error encountered during serialization.
+					if (diagramFileContent != null)
+					{
+						using (global::System.IO.FileStream fileStream = new global::System.IO.FileStream(diagramFileName, global::System.IO.FileMode.Create, global::System.IO.FileAccess.Write, global::System.IO.FileShare.None))
+						{
+							using (global::System.IO.BinaryWriter writer = new global::System.IO.BinaryWriter(fileStream, encoding))
+							{
+								writer.Write(diagramFileContent.ToArray());
+							}
+						}
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Read an element from the root of XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="rootElement">In-memory element instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="schemaResolver">An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).</param>
+		protected virtual void ReadRootElement(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement rootElement, global::System.Xml.XmlReader reader, DslModeling::ISchemaResolver schemaResolver)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(rootElement != null);
+			if (rootElement == null)
+				throw new global::System.ArgumentNullException("rootElement");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			#endregion
+	
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(rootElement.Store);
+	
+			DslModeling::DomainClassXmlSerializer rootSerializer = directory.GetSerializer(rootElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(rootSerializer != null, "Cannot find serializer for " + rootElement.GetDomainClass().Name + "!");
+	
+			// Version check.
+			this.CheckVersion(serializationContext, reader);
+	
+			if (!serializationContext.Result.Failed)
+			{	
+				// Use a validating reader if possible
+				using (reader = TryCreateValidatingReader(schemaResolver, reader, serializationContext))
+				{
+					rootSerializer.Read(serializationContext, rootElement, reader);
+				}
+			}
+	
+		}
+		
+		/// <summary>
+		/// Write an element as the root of XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="rootElement">Root element instance that will be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		public virtual void WriteRootElement(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement rootElement, global::System.Xml.XmlWriter writer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(rootElement != null);
+			if (rootElement == null)
+				throw new global::System.ArgumentNullException("rootElement");
+			global::System.Diagnostics.Debug.Assert(writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException("writer");
+			#endregion
+	
+			DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(rootElement.Store);
+	
+			DslModeling::DomainClassXmlSerializer rootSerializer = directory.GetSerializer(rootElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(rootSerializer != null, "Cannot find serializer for " + rootElement.GetDomainClass().Name + "!");
+	
+			// Set up root element settings
+			DslModeling::RootElementSettings rootElementSettings = new DslModeling::RootElementSettings();
+			if (!(rootElement is DslDiagrams::Diagram))
+			{
+				// Only model has schema, diagram has no schema.
+				rootElementSettings.SchemaTargetNamespace = "http://schemas.microsoft.com/dsltools/HLSim";
+			}
+			rootElementSettings.Version = new global::System.Version("1.0.0.0");
+	
+			// Carry out the normal serialization.
+			rootSerializer.Write(serializationContext, rootElement, writer, rootElementSettings);
+		}
+	
+		/// <summary>
+		/// Checks the version of the file being read.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">Reader for the file being read. The reader is positioned at the open tag of the root element being read.</param>
+		protected virtual void CheckVersion(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			#endregion
+	
+			global::System.Version expectedVersion = new global::System.Version("1.0.0.0");
+			string dslVersionStr = reader.GetAttribute("dslVersion");
+			if (dslVersionStr != null)
+			{
+				try
+				{
+					global::System.Version actualVersion = new global::System.Version(dslVersionStr);
+					if (actualVersion != expectedVersion)
+					{
+						HLSimSerializationBehaviorSerializationMessages.VersionMismatch(serializationContext, reader, expectedVersion, actualVersion);
+					}
+				}
+				catch (global::System.ArgumentException)
+				{
+					HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "dslVersion", typeof(global::System.Version), dslVersionStr);
+				}
+				catch (global::System.FormatException)
+				{
+					HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "dslVersion", typeof(global::System.Version), dslVersionStr);
+				}
+				catch (global::System.OverflowException)
+				{
+					HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "dslVersion", typeof(global::System.Version), dslVersionStr);
+				}
+			}
+		}
+	
+	
+		/// <summary>
+		/// Attempts to return a validating XML reader
+		/// </summary>
+		/// <returns>If all of the schema for registered serializers and all of the schema referenced in the file can be resolved,
+		/// then a validating reader is returned. Otherwise, the supplied reader is returned.
+		/// The serialization context will contain warning messages for all schema that could not be resolved.</returns>
+		protected virtual global::System.Xml.XmlReader TryCreateValidatingReader(DslModeling::ISchemaResolver schemaResolver, global::System.Xml.XmlReader reader, DslModeling::SerializationContext serializationContext)
+		{
+			System.Diagnostics.Debug.Assert(serializationContext != null, "Serialization context should not be null");
+	
+			// Can't do anything without a schema resolver
+			if (schemaResolver == null)
+			{
+				return reader;
+			}
+			
+			global::System.Xml.Schema.XmlSchemaSet schemaSet = new global::System.Xml.Schema.XmlSchemaSet(reader.NameTable);
+	
+			// Combine the list of namespaces for models in the store with those referred to in the current node
+			System.Collections.Generic.IEnumerable<string> namespaces = serializationContext.Directory.Namespaces.Select(n => n.TargetNamespace);
+			namespaces = namespaces.Concat(DslModeling::SerializationUtilities.GetNamespacesFromCurrentNode(reader));		
+	
+			bool success = true;
+			foreach (string ns in namespaces.Distinct())
+			{
+				// Try to resolve all namespaces so warnings are shown for all missing namespaces
+				success = ResolveSchema(ns, schemaSet, schemaResolver, reader, serializationContext) & success;
+			}
+	
+			if (success && schemaSet.Count > 0)
+			{
+				global::System.Xml.XmlReaderSettings readerSettings = reader.Settings.Clone();
+				readerSettings.ConformanceLevel = global::System.Xml.ConformanceLevel.Auto;
+				readerSettings.ValidationType = global::System.Xml.ValidationType.Schema;
+				readerSettings.Schemas = schemaSet;
+				HLSimSerializationBehaviorSchemaValidationCallback validationCallback = new HLSimSerializationBehaviorSchemaValidationCallback(serializationContext);
+				readerSettings.ValidationEventHandler += new global::System.Xml.Schema.ValidationEventHandler(validationCallback.Handler);
+	
+	
+				// Wrap the given reader as a validating reader and carry out the normal deserialization.
+				global::System.Xml.XmlReader validatingReader = global::System.Xml.XmlReader.Create(reader, readerSettings);
+	
+				validationCallback.Reader = validatingReader;
+				return validatingReader;
+			}
+	
+			return reader;
+		}
+	
+		/// <summary>
+		/// Attempts to resolve the supplied schema namespace
+		/// </summary>
+		/// <remarks>If the schema can be resolved it is added to the supplied schema set. Otherwise, a 
+		/// warning will be written to serializationContext.
+		/// </remarks>
+		/// <returns>A flag indicating whether the schema was resolved or not</returns>
+		protected static bool ResolveSchema(string targetNamespace, global::System.Xml.Schema.XmlSchemaSet schemaSet, DslModeling::ISchemaResolver schemaResolver, global::System.Xml.XmlReader reader, DslModeling::SerializationContext serializationContext)
+		{
+			global::System.Collections.Generic.IList<string> schemas = schemaResolver.ResolveSchema(targetNamespace);
+			if (schemas != null && schemas.Count > 0)
+			{
+				if (schemas.Count > 1)
+				{
+					HLSimSerializationBehaviorSerializationMessages.AmbiguousSchema(serializationContext, reader, targetNamespace, schemas[0]);
+				}
+				schemaSet.Add(targetNamespace, schemas[0]);
+				return true;
+			}
+	
+			HLSimSerializationBehaviorSerializationMessages.NoSchema(serializationContext, reader, targetNamespace);
+			return false;
+		}
+	
+	
+		/// <summary>
+		/// A utility class to handle schema validation warning/error
+		/// </summary>
+		private sealed class HLSimSerializationBehaviorSchemaValidationCallback
+		{
+			#region Member Variables
+			/// <summary>
+			/// SerializationContext to store schema validation warning/error.
+			/// </summary>
+			DslModeling::SerializationContext serializationContext;
+			/// <summary>
+			/// Reader that generates the schema warning/error.
+			/// </summary>
+			global::System.Xml.XmlReader reader;
+			#endregion
+	
+			#region Constructor
+			/// <summary>
+			/// Constructor
+			/// </summary>
+			/// <param name="serializationContext">SerializationContext to be used to store schema validation warning/error.</param>
+			internal HLSimSerializationBehaviorSchemaValidationCallback(DslModeling::SerializationContext serializationContext)
+			{
+				global::System.Diagnostics.Debug.Assert(serializationContext != null);
+				this.serializationContext = serializationContext;
+			}
+			#endregion
+	
+			#region Accessor
+			/// <summary>
+			/// Sets the reader that generates the schema validation warning/error.
+			/// </summary>
+			internal global::System.Xml.XmlReader Reader
+			{
+				[global::System.Diagnostics.DebuggerStepThrough]
+				set { this.reader = value; }
+			}
+			#endregion
+	
+			#region Callback method
+			/// <summary>
+			/// Callback to handler schema validation warning/error.
+			/// </summary>
+			internal void Handler(object sender, global::System.Xml.Schema.ValidationEventArgs e)
+			{
+				global::System.Diagnostics.Debug.Assert(this.serializationContext != null);
+				if (this.serializationContext != null)
+					HLSimSerializationBehaviorSerializationMessages.SchemaValidationError(this.serializationContext, this.reader, e.Message);
+			}
+			#endregion
+		}
+	
+		/// <summary>
+		/// Return the model in XML format
+		/// </summary>
+		/// <param name="modelRoot">Root instance to be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the root instance.</param>
+		/// <returns>Model in XML form</returns>
+		public virtual string GetSerializedModelString(global::HeuristicLab.SimulationCore.SimulationModel modelRoot, global::System.Text.Encoding encoding)
+		{
+			string result = string.Empty;
+			if (modelRoot == null)
+			{
+				return result;
+			}
+	
+			DslModeling::SerializationResult serializationResult = new DslModeling::SerializationResult();
+			using (global::System.IO.MemoryStream modelFileContent = this.InternalSaveModel(serializationResult, modelRoot, string.Empty, encoding, false))
+			{
+				if (!serializationResult.Failed && modelFileContent != null)
+				{
+					char[] chars = encoding.GetChars(modelFileContent.GetBuffer());
+	
+					// search the open angle bracket and trim off the Byte Of Mark.
+					result = new string( chars);
+					int indexPos = result.IndexOf('<');
+					if (indexPos > 0)
+					{
+						// strip off the leading Byte Of Mark.
+						result = result.Substring(indexPos);
+					}
+	
+					// trim off trailing 0s.
+					result = result.TrimEnd( '\0');
+				}
+			}
+			return result;
+		}
+		
+	
+		#region Private/Helper Methods/Properties
+			
+		#region Class SerializationValidationObserver
+		/// <summary>
+		/// An utility class to collect validation messages during serialization, and store them in serialization result.
+		/// </summary>
+		protected sealed class SerializationValidationObserver : DslValidation::ValidationMessageObserver, global::System.IDisposable
+		{
+			#region Member Variables
+			/// <summary>
+			/// SerializationResult to store the messages.
+			/// </summary>
+			private DslModeling::SerializationResult serializationResult;
+			/// <summary>
+			/// ValidationController to get messages from.
+			/// </summary>
+			private DslValidation::ValidationController validationController;
+			#endregion
+	
+			#region Constructor
+			/// <summary>
+			/// Constructor
+			/// </summary>
+			internal SerializationValidationObserver(DslModeling::SerializationResult serializationResult, DslValidation::ValidationController validationController)
+			{
+				#region Check Parameters
+				global::System.Diagnostics.Debug.Assert(serializationResult != null);
+				global::System.Diagnostics.Debug.Assert(validationController != null);
+				#endregion
+	
+				this.serializationResult = serializationResult;
+				this.validationController = validationController;
+	
+				// Subscribe to validation messages.
+				this.validationController.AddObserver(this);
+			}
+	
+			/// <summary>
+			/// Destructor
+			/// </summary>
+			~SerializationValidationObserver()
+			{
+				this.Dispose(false);
+			}
+			#endregion
+	
+			#region Base Overrides
+			/// <summary>
+			/// Called with validation messages are added.
+			/// </summary>
+			protected override void OnValidationMessageAdded(DslValidation::ValidationMessage addedMessage)
+			{
+				#region Check Parameters
+				global::System.Diagnostics.Debug.Assert(addedMessage != null);
+				#endregion
+	
+				if (addedMessage != null && this.serializationResult != null)
+				{	// Record the validation message as a serialization message.
+					DslModeling::SerializationUtilities.AddValidationMessage(this.serializationResult, addedMessage);
+				}
+				base.OnValidationMessageAdded(addedMessage);
+			}
+			#endregion
+	
+			#region IDisposable Members
+			/// <summary>
+			/// IDisposable.Dispose().
+			/// </summary>
+			public void Dispose()
+			{
+				this.Dispose(true);
+				global::System.GC.SuppressFinalize(this);
+			}
+	
+			/// <summary>
+			/// Unregister the observer on dispose.
+			/// </summary>
+			private void Dispose(bool disposing)
+			{
+				global::System.Diagnostics.Debug.Assert(disposing, "SerializationValidationObserver finalized without being disposed!");
+				if (disposing && this.validationController != null)
+				{
+					this.validationController.RemoveObserver(this);
+					this.validationController = null;
+				}
+				this.serializationResult = null;
+			}
+			#endregion
+		}
+		#endregion
+		
+		/// <summary>
+		/// Go through the diagram to find all shapes that are not connected to a model element. Some of them may be by design, the rest are out-of-sync shapes.
+		/// We want to make sure that all out-of-sync shapes are given a chance to fix themselves up, or post proper warning/error messages.
+		/// </summary>
+		/// <param name="diagram">The diagram of which the shapes are being checked.</param>
+		/// <param name="serializationResult">SerializationResult to store warning/error in case an orphaned shape choose to do so.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+		protected virtual void CheckForOrphanedShapes(DslDiagrams::Diagram diagram, DslModeling::SerializationResult serializationResult)
+		{
+			global::System.Collections.Generic.List<DslDiagrams::ShapeElement> orphanedShapes = new global::System.Collections.Generic.List<DslDiagrams::ShapeElement>();
+			diagram.IterateShapes(new OrphanedShapeIterator(orphanedShapes, diagram));
+			foreach (DslDiagrams::ShapeElement orphanedShape in orphanedShapes)
+			{
+				if (serializationResult.Failed)
+					break;
+	
+				orphanedShape.OnOrphaned(serializationResult);
+			}
+		}
+		
+		#region Class OrphanedShapeIterator
+		/// <summary>
+		/// An iterator to collect all the orphaned shapes.
+		/// </summary>
+		private class OrphanedShapeIterator : DslDiagrams::IShapeIterator
+		{
+			#region Member Variables
+			/// <summary>
+			/// Stores all iterated orphaned shapes.
+			/// </summary>
+			private global::System.Collections.Generic.List<DslDiagrams::ShapeElement> orphanedShapes;
+			
+			/// <summary>
+			/// Diagram that contains the shapes to be iterated.
+			/// </summary>
+			private DslDiagrams::Diagram diagram;
+			#endregion
+	
+			#region Constructor
+			/// <summary>
+			/// Constructor.
+			/// </summary>
+			/// <param name="orphanedShapes">Storage for all iterated orphaned shapes.</param>
+			/// <param name="diagram">Diagram that contains the shapes to be iterated.</param>
+			internal OrphanedShapeIterator(global::System.Collections.Generic.List<DslDiagrams::ShapeElement> orphanedShapes, DslDiagrams::Diagram diagram)
+			{
+				#region Check Parameters
+				global::System.Diagnostics.Debug.Assert(orphanedShapes != null);
+				global::System.Diagnostics.Debug.Assert(diagram != null);
+				#endregion
+	
+				this.orphanedShapes = orphanedShapes;
+				this.diagram = diagram;
+			}
+			#endregion
+	
+			#region IShapeIterator Members
+			/// <summary>
+			/// Called when a shape is encountered during iteration. The shape will be stored if it's orphaned.
+			/// A shape is considered "orphaned" if:
+			/// 1) It has a PresentationViewsSubject link out of it, but the Subject cannot be resolved.
+			/// 2) It is a connector, and the Subject is null (regardless of the existence of PresentationViewsSubject relationship).
+			/// </summary>
+			/// <param name="shape">Shape encountered.</param>
+			public void OnShape(DslDiagrams::ShapeElement shape)
+			{
+				if (this.diagram.IsOrphaned(shape))
+					this.orphanedShapes.Add(shape);	// Orphaned.
+			}
+			#endregion
+		}
+		#endregion
+		#endregion
+	}
+	
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	[DslValidation::ValidationState(DslValidation::ValidationState.Enabled)]
+	public partial class SimulationModel
+	{
+		/// <summary>
+		/// Check to make sure all elements in the model will have unambiguous monikers when serialized.
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Generated code.")]
+		[DslValidation::ValidationMethod(DslValidation::ValidationCategories.Load | DslValidation::ValidationCategories.Save | DslValidation::ValidationCategories.Menu)]
+		private void ValidateMonikerAmbiguity(DslValidation::ValidationContext context)
+		{
+			// Don't run this rule when deserializing - any ambiguous monikers will 
+			// already have stopped the file from loading.
+			if (this.Store.InSerializationTransaction)
+			{
+				return;
+			}
+		
+			global::System.Collections.Generic.IDictionary<global::System.Guid, DslModeling::IMonikerResolver> monikerResolvers = HLSimSerializationHelper.Instance.GetMonikerResolvers(this.Store);
+			foreach (DslModeling::ModelElement element in this.Store.ElementDirectory.AllElements)
+			{
+				global::System.Guid domainModelId = element.GetDomainClass().DomainModel.Id;
+				DslModeling::IMonikerResolver monikerResolver = null;
+				if (monikerResolvers.TryGetValue(domainModelId, out monikerResolver) && monikerResolver != null)
+				{
+					DslModeling::SimpleMonikerResolver simpleMonikerResolver = monikerResolver as DslModeling::SimpleMonikerResolver;
+					if (simpleMonikerResolver != null)
+					{
+						try
+						{
+							simpleMonikerResolver.ProcessAddedElement(element);
+						}
+						catch (DslModeling::AmbiguousMonikerException amEx)
+						{	// Ambiguous moniker detected.
+							context.LogError(
+								string.Format(
+									global::System.Globalization.CultureInfo.CurrentCulture,
+									HLSimDomainModel.SingletonResourceManager.GetString("AmbiguousMoniker"),
+									amEx.Moniker,
+									DslModeling::SerializationUtilities.GetElementName(element),
+									DslModeling::SerializationUtilities.GetElementName(amEx.Element)
+								),
+								"AmbiguousMoniker", 
+								this,
+								amEx.Element
+							);
+						}
+					}
+				}
+			}
+			// Clean up the created moniker resolvers after the check.
+			foreach (DslModeling::IMonikerResolver monikerResolver in monikerResolvers.Values)
+			{
+				DslModeling::SimpleMonikerResolver simpleMonikerResolver = monikerResolver as DslModeling::SimpleMonikerResolver;
+				if (simpleMonikerResolver != null)
+					simpleMonikerResolver.Reset();
+			}
+			monikerResolvers.Clear();
+		}
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/SerializationHelper.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/SerializationHelper.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/SerializationHelper.tt	(revision 10525)
@@ -0,0 +1,6 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\SerializationHelper.tt" #>
+<#@ include file="Dsl\MonikerAmbiguityValidation.tt" #>
+<#
+	GenerateMonikerAmbiguityValidation(this.DslLibrary);
+#>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Serializer.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Serializer.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Serializer.cs	(revision 10525)
@@ -0,0 +1,9641 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer SimulationModelSerializer for DomainClass SimulationModel.
+	/// </summary>
+	public partial class SimulationModelSerializer : DslModeling::DomainClassXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// SimulationModelSerializer Constructor
+		/// </summary>
+		public SimulationModelSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of SimulationModel.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"simulationModel"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of SimulationModel.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"simulationModelMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of SimulationModel in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one SimulationModel instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the SimulationModel element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModel instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModel instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			SimulationModel instanceOfSimulationModel = element as SimulationModel;
+			global::System.Diagnostics.Debug.Assert(instanceOfSimulationModel != null, "Expecting an instance of SimulationModel");
+	
+			// ModelType
+			if (!serializationContext.Result.Failed)
+			{
+				string attribModelType = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, element, reader, "modelType");
+				if (attribModelType != null)
+				{
+					global::System.String valueOfModelType;
+					if (DslModeling::SerializationUtilities.TryGetValue<global::System.String>(serializationContext, attribModelType, out valueOfModelType))
+					{
+						instanceOfSimulationModel.ModelType = valueOfModelType;
+					}
+					else
+					{	// Invalid property value, ignored.
+						HLSimSerializationBehaviorSerializationMessages.IgnoredPropertyValue(serializationContext, reader, "modelType", typeof(global::System.String), attribModelType);
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModel instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+			SimulationModel instanceOfSimulationModel = element as SimulationModel;
+			global::System.Diagnostics.Debug.Assert(instanceOfSimulationModel != null, "Expecting an instance of SimulationModel!");
+	
+			// Read child model elements (which are always serialized as nested XML elements).
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+				ReadChildElements(serializationContext, instanceOfSimulationModel, reader);
+		}
+	
+		/// <summary>
+		/// This method deserializes all child model elements.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first child XML element to deserialized.
+		/// This method will read as many child elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the 
+		///    open tag of the unknown element. This implies that if the first child XML element is unknown, this method 
+		///    should return immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="element">In-memory SimulationModel instance that will get the deserialized data.</param>
+		private static void ReadChildElements(DslModeling::SerializationContext serializationContext, SimulationModel element, global::System.Xml.XmlReader reader)
+		{
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				switch (reader.LocalName)
+				{
+					case "activities":	// Relationship "SimulationModelHasActivities"
+						if (reader.IsEmptyElement)
+						{	// No instance of this relationship, just skip
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+						else
+						{
+							DslModeling::SerializationUtilities.SkipToFirstChild(reader);  // Skip the open tag of <activities>
+							ReadSimulationModelHasActivitiesInstances(serializationContext, element, reader);
+							DslModeling::SerializationUtilities.Skip(reader);  // Skip the close tag of </activities>
+						}
+						break;
+					case "actions":	// Relationship "SimulationModelHasActions"
+						if (reader.IsEmptyElement)
+						{	// No instance of this relationship, just skip
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+						else
+						{
+							DslModeling::SerializationUtilities.SkipToFirstChild(reader);  // Skip the open tag of <actions>
+							ReadSimulationModelHasActionsInstances(serializationContext, element, reader);
+							DslModeling::SerializationUtilities.Skip(reader);  // Skip the close tag of </actions>
+						}
+						break;
+					default:
+						return;  // Don't know this element.
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Reads all instances of relationship SimulationModelHasActivities.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first XML element inside the relationship tag, so it can be
+		/// either the first instance, or a bogus tag. This method will deserialize all instances and ignore all bogus tags. When the
+		/// method returns, the reader will be positioned at the end tag of the relationship (or EOF if somehow that happens).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModel instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		private static void ReadSimulationModelHasActivitiesInstances(DslModeling::SerializationContext serializationContext, SimulationModel element, global::System.Xml.XmlReader reader)
+		{
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				DslModeling::DomainClassXmlSerializer newSimulationModelHasActivitiesSerializer = serializationContext.Directory.GetSerializer(SimulationModelHasActivities.DomainClassId);
+				global::System.Diagnostics.Debug.Assert(newSimulationModelHasActivitiesSerializer != null, "Cannot find serializer for SimulationModelHasActivities!");
+				SimulationModelHasActivities newSimulationModelHasActivities = newSimulationModelHasActivitiesSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as SimulationModelHasActivities;
+				if (newSimulationModelHasActivities != null)
+				{
+					DslModeling::DomainRoleInfo.SetRolePlayer (newSimulationModelHasActivities, SimulationModelHasActivities.SimulationModelDomainRoleId, element);
+					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newSimulationModelHasActivities.GetDomainClass().Id);	
+					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newSimulationModelHasActivities.GetDomainClass().Name + "!");
+					targetSerializer.Read(serializationContext, newSimulationModelHasActivities, reader);
+				}
+				else
+				{	// Maybe the relationship is serialized in short-form by mistake.
+					DslModeling::DomainClassXmlSerializer newActivityOfSimulationModelHasActivitiesSerializer = serializationContext.Directory.GetSerializer(Activity.DomainClassId);
+					global::System.Diagnostics.Debug.Assert(newActivityOfSimulationModelHasActivitiesSerializer != null, "Cannot find serializer for Activity!");
+					Activity newActivityOfSimulationModelHasActivities = newActivityOfSimulationModelHasActivitiesSerializer.TryCreateInstance(serializationContext, reader, element.Partition) as Activity;
+					if (newActivityOfSimulationModelHasActivities != null)
+					{
+						HLSimSerializationBehaviorSerializationMessages.ExpectingFullFormRelationship(serializationContext, reader, typeof(SimulationModelHasActivities));
+						element.Activities.Add(newActivityOfSimulationModelHasActivities);
+						DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newActivityOfSimulationModelHasActivities.GetDomainClass().Id);	
+						global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newActivityOfSimulationModelHasActivities.GetDomainClass().Name + "!");
+						targetSerializer.Read(serializationContext, newActivityOfSimulationModelHasActivities, reader);
+					}
+					else
+					{	// Unknown element, skip.
+						DslModeling::SerializationUtilities.Skip(reader);
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Reads all instances of relationship SimulationModelHasActions.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first XML element inside the relationship tag, so it can be
+		/// either the first instance, or a bogus tag. This method will deserialize all instances and ignore all bogus tags. When the
+		/// method returns, the reader will be positioned at the end tag of the relationship (or EOF if somehow that happens).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModel instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		private static void ReadSimulationModelHasActionsInstances(DslModeling::SerializationContext serializationContext, SimulationModel element, global::System.Xml.XmlReader reader)
+		{
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				DslModeling::DomainClassXmlSerializer newSimulationModelHasActionsSerializer = serializationContext.Directory.GetSerializer(SimulationModelHasActions.DomainClassId);
+				global::System.Diagnostics.Debug.Assert(newSimulationModelHasActionsSerializer != null, "Cannot find serializer for SimulationModelHasActions!");
+				SimulationModelHasActions newSimulationModelHasActions = newSimulationModelHasActionsSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as SimulationModelHasActions;
+				if (newSimulationModelHasActions != null)
+				{
+					DslModeling::DomainRoleInfo.SetRolePlayer (newSimulationModelHasActions, SimulationModelHasActions.SimulationModelDomainRoleId, element);
+					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newSimulationModelHasActions.GetDomainClass().Id);	
+					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newSimulationModelHasActions.GetDomainClass().Name + "!");
+					targetSerializer.Read(serializationContext, newSimulationModelHasActions, reader);
+				}
+				else
+				{	// Maybe the relationship is serialized in short-form by mistake.
+					DslModeling::DomainClassXmlSerializer newActionOfSimulationModelHasActionsSerializer = serializationContext.Directory.GetSerializer(Action.DomainClassId);
+					global::System.Diagnostics.Debug.Assert(newActionOfSimulationModelHasActionsSerializer != null, "Cannot find serializer for Action!");
+					Action newActionOfSimulationModelHasActions = newActionOfSimulationModelHasActionsSerializer.TryCreateInstance(serializationContext, reader, element.Partition) as Action;
+					if (newActionOfSimulationModelHasActions != null)
+					{
+						HLSimSerializationBehaviorSerializationMessages.ExpectingFullFormRelationship(serializationContext, reader, typeof(SimulationModelHasActions));
+						element.Actions.Add(newActionOfSimulationModelHasActions);
+						DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newActionOfSimulationModelHasActions.GetDomainClass().Id);	
+						global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newActionOfSimulationModelHasActions.GetDomainClass().Name + "!");
+						targetSerializer.Read(serializationContext, newActionOfSimulationModelHasActions, reader);
+					}
+					else
+					{	// Unknown element, skip.
+						DslModeling::SerializationUtilities.Skip(reader);
+					}
+				}
+			}
+		}
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of SimulationModel based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized SimulationModel, a new SimulationModel instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created SimulationModel instance, or null if the reader is not pointing to a serialized SimulationModel instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "SimulationModel" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "SimulationModel".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						SimulationModelSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as SimulationModelSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of SimulationModel based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of SimulationModel.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new SimulationModel instance should be created.</param>	
+		/// <returns>Created SimulationModel instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new SimulationModel(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from SimulationModel, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from SimulationModel.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(SimulationModel.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including SimulationModel itself) instance of SimulationModel based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "SimulationModel" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "SimulationModel".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						SimulationModelSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as SimulationModelSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of SimulationModel based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, SimulationModel.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from SimulationModel, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from SimulationModel.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(SimulationModel.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized SimulationModel instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModel instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the SimulationModel instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the SimulationModel instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one SimulationModel instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModel instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModel instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			SimulationModel instanceOfSimulationModel = element as SimulationModel;
+			global::System.Diagnostics.Debug.Assert(instanceOfSimulationModel != null, "Expecting an instance of SimulationModel");
+	
+			// ModelType
+			if (!serializationContext.Result.Failed)
+			{
+				global::System.String propValue = instanceOfSimulationModel.ModelType;
+				if (!serializationContext.Result.Failed)
+				{
+					if (!string.IsNullOrEmpty(propValue))
+						HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, "modelType", propValue);
+	
+				}
+			}
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModel instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+			SimulationModel instance = element as SimulationModel;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of SimulationModel!");
+	
+			// Write child model elements (which are always serialized as nested XML elements).
+			if (!serializationContext.Result.Failed)
+				WriteChildElements(serializationContext, instance, writer);
+		}
+		
+	
+		/// <summary>
+		/// Serialize all child model elements.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModel instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]		
+		private static void WriteChildElements(DslModeling::SerializationContext serializationContext, SimulationModel element, global::System.Xml.XmlWriter writer)
+		{
+			// SimulationModelHasActivities
+			global::System.Collections.ObjectModel.ReadOnlyCollection<SimulationModelHasActivities> allSimulationModelHasActivitiesInstances = SimulationModelHasActivities.GetLinksToActivities(element);
+			if (!serializationContext.Result.Failed && allSimulationModelHasActivitiesInstances.Count > 0)
+			{
+				writer.WriteStartElement("activities");
+				foreach (SimulationModelHasActivities eachSimulationModelHasActivitiesInstance in allSimulationModelHasActivitiesInstances)
+				{
+					if (serializationContext.Result.Failed)
+						break;
+	
+					DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachSimulationModelHasActivitiesInstance.GetDomainClass().Id);
+					global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachSimulationModelHasActivitiesInstance.GetDomainClass().Name + "!");
+					relSerializer.Write(serializationContext, eachSimulationModelHasActivitiesInstance, writer);
+				}
+				writer.WriteEndElement();
+			}
+	
+			// SimulationModelHasActions
+			global::System.Collections.ObjectModel.ReadOnlyCollection<SimulationModelHasActions> allSimulationModelHasActionsInstances = SimulationModelHasActions.GetLinksToActions(element);
+			if (!serializationContext.Result.Failed && allSimulationModelHasActionsInstances.Count > 0)
+			{
+				writer.WriteStartElement("actions");
+				foreach (SimulationModelHasActions eachSimulationModelHasActionsInstance in allSimulationModelHasActionsInstances)
+				{
+					if (serializationContext.Result.Failed)
+						break;
+	
+					DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachSimulationModelHasActionsInstance.GetDomainClass().Id);
+					global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachSimulationModelHasActionsInstance.GetDomainClass().Name + "!");
+					relSerializer.Write(serializationContext, eachSimulationModelHasActionsInstance, writer);
+				}
+				writer.WriteEndElement();
+			}
+	
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given SimulationModel instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">SimulationModel instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the SimulationModel instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			SimulationModel instance = element as SimulationModel;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of SimulationModel!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">SimulationModel instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ActivitySerializer for DomainClass Activity.
+	/// </summary>
+	public partial class ActivitySerializer : DslModeling::DomainClassXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ActivitySerializer Constructor
+		/// </summary>
+		public ActivitySerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of Activity.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"activity"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of Activity.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"activityMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of Activity in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one Activity instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the Activity element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Activity instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Activity instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			Activity instanceOfActivity = element as Activity;
+			global::System.Diagnostics.Debug.Assert(instanceOfActivity != null, "Expecting an instance of Activity");
+	
+			// Name
+			if (!serializationContext.Result.Failed)
+			{
+				string attribName = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, element, reader, "name");
+				if (attribName != null)
+				{
+					global::System.String valueOfName;
+					if (DslModeling::SerializationUtilities.TryGetValue<global::System.String>(serializationContext, attribName, out valueOfName))
+					{
+						instanceOfActivity.Name = valueOfName;
+					}
+					else
+					{	// Invalid property value, ignored.
+						HLSimSerializationBehaviorSerializationMessages.IgnoredPropertyValue(serializationContext, reader, "name", typeof(global::System.String), attribName);
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Activity instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+			Activity instanceOfActivity = element as Activity;
+			global::System.Diagnostics.Debug.Assert(instanceOfActivity != null, "Expecting an instance of Activity!");
+	
+			// Read child model elements (which are always serialized as nested XML elements).
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+				ReadChildElements(serializationContext, instanceOfActivity, reader);
+		}
+	
+		/// <summary>
+		/// This method deserializes all child model elements.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first child XML element to deserialized.
+		/// This method will read as many child elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the 
+		///    open tag of the unknown element. This implies that if the first child XML element is unknown, this method 
+		///    should return immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="element">In-memory Activity instance that will get the deserialized data.</param>
+		private static void ReadChildElements(DslModeling::SerializationContext serializationContext, Activity element, global::System.Xml.XmlReader reader)
+		{
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				if (string.Compare(reader.LocalName, "triggers", global::System.StringComparison.CurrentCulture) == 0)
+				{
+					if (reader.IsEmptyElement)
+					{	// No instance of this relationship, just skip
+						DslModeling::SerializationUtilities.Skip(reader);
+					}
+					else
+					{
+						DslModeling::SerializationUtilities.SkipToFirstChild(reader);  // Skip the open tag of <triggers>
+						ReadActivityReferencesTriggersInstances(serializationContext, element, reader);
+						DslModeling::SerializationUtilities.Skip(reader);  // Skip the close tag of </triggers>
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Reads all instances of relationship ActivityReferencesTriggers.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first XML element inside the relationship tag, so it can be
+		/// either the first instance, or a bogus tag. This method will deserialize all instances and ignore all bogus tags. When the
+		/// method returns, the reader will be positioned at the end tag of the relationship (or EOF if somehow that happens).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Activity instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806")]
+		private static void ReadActivityReferencesTriggersInstances(DslModeling::SerializationContext serializationContext, Activity element, global::System.Xml.XmlReader reader)
+		{
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				DslModeling::DomainClassXmlSerializer newActivityReferencesTriggersSerializer = serializationContext.Directory.GetSerializer(ActivityReferencesTriggers.DomainClassId);
+				global::System.Diagnostics.Debug.Assert(newActivityReferencesTriggersSerializer != null, "Cannot find serializer for ActivityReferencesTriggers!");
+				ActivityReferencesTriggers newActivityReferencesTriggers = newActivityReferencesTriggersSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as ActivityReferencesTriggers;
+				if (newActivityReferencesTriggers != null)
+				{
+					DslModeling::DomainRoleInfo.SetRolePlayer (newActivityReferencesTriggers, ActivityReferencesTriggers.ActivityDomainRoleId, element);
+					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newActivityReferencesTriggers.GetDomainClass().Id);	
+					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newActivityReferencesTriggers.GetDomainClass().Name + "!");
+					targetSerializer.Read(serializationContext, newActivityReferencesTriggers, reader);
+				}
+				else
+				{	// Maybe the relationship is serialized in short-form by mistake.
+					DslModeling::DomainClassXmlSerializer newActionMonikerOfActivityReferencesTriggersSerializer = serializationContext.Directory.GetSerializer(Action.DomainClassId);
+					global::System.Diagnostics.Debug.Assert(newActionMonikerOfActivityReferencesTriggersSerializer != null, "Cannot find serializer for Action!");
+					DslModeling::Moniker newActionMonikerOfActivityReferencesTriggers = newActionMonikerOfActivityReferencesTriggersSerializer.TryCreateMonikerInstance(serializationContext, reader, element, ActivityReferencesTriggers.DomainClassId, element.Partition);
+					if (newActionMonikerOfActivityReferencesTriggers != null)
+					{
+						HLSimSerializationBehaviorSerializationMessages.ExpectingFullFormRelationship(serializationContext, reader, typeof(ActivityReferencesTriggers));
+						new ActivityReferencesTriggers(element.Partition, new DslModeling::RoleAssignment(ActivityReferencesTriggers.ActivityDomainRoleId, element), new DslModeling::RoleAssignment(ActivityReferencesTriggers.ActionDomainRoleId, newActionMonikerOfActivityReferencesTriggers));
+						DslModeling::SerializationUtilities.Skip(reader);	// Moniker contains no child XML elements, so just skip.
+					}
+					else
+					{	// Unknown element, skip.
+						DslModeling::SerializationUtilities.Skip(reader);
+					}
+				}
+			}
+		}
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of Activity based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized Activity, a new Activity instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created Activity instance, or null if the reader is not pointing to a serialized Activity instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Activity" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "Activity".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						ActivitySerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActivitySerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of Activity based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of Activity.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new Activity instance should be created.</param>	
+		/// <returns>Created Activity instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new Activity(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from Activity, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from Activity.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Activity.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including Activity itself) instance of Activity based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Activity" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "Activity".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ActivitySerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActivitySerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of Activity based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, Activity.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from Activity, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from Activity.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Activity.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized Activity instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Activity instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the Activity instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the Activity instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one Activity instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Activity instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Activity instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			Activity instanceOfActivity = element as Activity;
+			global::System.Diagnostics.Debug.Assert(instanceOfActivity != null, "Expecting an instance of Activity");
+	
+			// Name
+			if (!serializationContext.Result.Failed)
+			{
+				global::System.String propValue = instanceOfActivity.Name;
+				if (!serializationContext.Result.Failed)
+				{
+					if (!string.IsNullOrEmpty(propValue))
+						HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, "name", propValue);
+	
+				}
+			}
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Activity instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+			Activity instance = element as Activity;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of Activity!");
+	
+			// Write child model elements (which are always serialized as nested XML elements).
+			if (!serializationContext.Result.Failed)
+				WriteChildElements(serializationContext, instance, writer);
+		}
+		
+	
+		/// <summary>
+		/// Serialize all child model elements.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Activity instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]		
+		private static void WriteChildElements(DslModeling::SerializationContext serializationContext, Activity element, global::System.Xml.XmlWriter writer)
+		{
+			// ActivityReferencesTriggers
+			global::System.Collections.ObjectModel.ReadOnlyCollection<ActivityReferencesTriggers> allActivityReferencesTriggersInstances = ActivityReferencesTriggers.GetLinksToTriggers(element);
+			if (!serializationContext.Result.Failed && allActivityReferencesTriggersInstances.Count > 0)
+			{
+				writer.WriteStartElement("triggers");
+				foreach (ActivityReferencesTriggers eachActivityReferencesTriggersInstance in allActivityReferencesTriggersInstances)
+				{
+					if (serializationContext.Result.Failed)
+						break;
+	
+					DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachActivityReferencesTriggersInstance.GetDomainClass().Id);
+					global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachActivityReferencesTriggersInstance.GetDomainClass().Name + "!");
+					relSerializer.Write(serializationContext, eachActivityReferencesTriggersInstance, writer);
+				}
+				writer.WriteEndElement();
+			}
+	
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given Activity instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Activity instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the Activity instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			Activity instance = element as Activity;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of Activity!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Activity instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ActionSerializer for DomainClass Action.
+	/// </summary>
+	public partial class ActionSerializer : DslModeling::DomainClassXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ActionSerializer Constructor
+		/// </summary>
+		public ActionSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of Action.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"action"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of Action.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"actionMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of Action in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one Action instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the Action element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Action instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Action instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			Action instanceOfAction = element as Action;
+			global::System.Diagnostics.Debug.Assert(instanceOfAction != null, "Expecting an instance of Action");
+	
+			// Name
+			if (!serializationContext.Result.Failed)
+			{
+				string attribName = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, element, reader, "name");
+				if (attribName != null)
+				{
+					global::System.String valueOfName;
+					if (DslModeling::SerializationUtilities.TryGetValue<global::System.String>(serializationContext, attribName, out valueOfName))
+					{
+						instanceOfAction.Name = valueOfName;
+					}
+					else
+					{	// Invalid property value, ignored.
+						HLSimSerializationBehaviorSerializationMessages.IgnoredPropertyValue(serializationContext, reader, "name", typeof(global::System.String), attribName);
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Action instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+			Action instanceOfAction = element as Action;
+			global::System.Diagnostics.Debug.Assert(instanceOfAction != null, "Expecting an instance of Action!");
+	
+			// Read child model elements (which are always serialized as nested XML elements).
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+				ReadChildElements(serializationContext, instanceOfAction, reader);
+		}
+	
+		/// <summary>
+		/// This method deserializes all child model elements.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first child XML element to deserialized.
+		/// This method will read as many child elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the 
+		///    open tag of the unknown element. This implies that if the first child XML element is unknown, this method 
+		///    should return immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="element">In-memory Action instance that will get the deserialized data.</param>
+		private static void ReadChildElements(DslModeling::SerializationContext serializationContext, Action element, global::System.Xml.XmlReader reader)
+		{
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				if (string.Compare(reader.LocalName, "listeners", global::System.StringComparison.CurrentCulture) == 0)
+				{
+					if (reader.IsEmptyElement)
+					{	// No instance of this relationship, just skip
+						DslModeling::SerializationUtilities.Skip(reader);
+					}
+					else
+					{
+						DslModeling::SerializationUtilities.SkipToFirstChild(reader);  // Skip the open tag of <listeners>
+						ReadActionReferencesListenersInstances(serializationContext, element, reader);
+						DslModeling::SerializationUtilities.Skip(reader);  // Skip the close tag of </listeners>
+					}
+				}
+			}
+		}
+	
+		/// <summary>
+		/// Reads all instances of relationship ActionReferencesListeners.
+		/// </summary>
+		/// <remarks>
+		/// The caller will position the reader at the open tag of the first XML element inside the relationship tag, so it can be
+		/// either the first instance, or a bogus tag. This method will deserialize all instances and ignore all bogus tags. When the
+		/// method returns, the reader will be positioned at the end tag of the relationship (or EOF if somehow that happens).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Action instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806")]
+		private static void ReadActionReferencesListenersInstances(DslModeling::SerializationContext serializationContext, Action element, global::System.Xml.XmlReader reader)
+		{
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				DslModeling::DomainClassXmlSerializer newActionReferencesListenersSerializer = serializationContext.Directory.GetSerializer(ActionReferencesListeners.DomainClassId);
+				global::System.Diagnostics.Debug.Assert(newActionReferencesListenersSerializer != null, "Cannot find serializer for ActionReferencesListeners!");
+				ActionReferencesListeners newActionReferencesListeners = newActionReferencesListenersSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as ActionReferencesListeners;
+				if (newActionReferencesListeners != null)
+				{
+					DslModeling::DomainRoleInfo.SetRolePlayer (newActionReferencesListeners, ActionReferencesListeners.ActionDomainRoleId, element);
+					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newActionReferencesListeners.GetDomainClass().Id);	
+					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newActionReferencesListeners.GetDomainClass().Name + "!");
+					targetSerializer.Read(serializationContext, newActionReferencesListeners, reader);
+				}
+				else
+				{	// Maybe the relationship is serialized in short-form by mistake.
+					DslModeling::DomainClassXmlSerializer newActivityMonikerOfActionReferencesListenersSerializer = serializationContext.Directory.GetSerializer(Activity.DomainClassId);
+					global::System.Diagnostics.Debug.Assert(newActivityMonikerOfActionReferencesListenersSerializer != null, "Cannot find serializer for Activity!");
+					DslModeling::Moniker newActivityMonikerOfActionReferencesListeners = newActivityMonikerOfActionReferencesListenersSerializer.TryCreateMonikerInstance(serializationContext, reader, element, ActionReferencesListeners.DomainClassId, element.Partition);
+					if (newActivityMonikerOfActionReferencesListeners != null)
+					{
+						HLSimSerializationBehaviorSerializationMessages.ExpectingFullFormRelationship(serializationContext, reader, typeof(ActionReferencesListeners));
+						new ActionReferencesListeners(element.Partition, new DslModeling::RoleAssignment(ActionReferencesListeners.ActionDomainRoleId, element), new DslModeling::RoleAssignment(ActionReferencesListeners.ActivityDomainRoleId, newActivityMonikerOfActionReferencesListeners));
+						DslModeling::SerializationUtilities.Skip(reader);	// Moniker contains no child XML elements, so just skip.
+					}
+					else
+					{	// Unknown element, skip.
+						DslModeling::SerializationUtilities.Skip(reader);
+					}
+				}
+			}
+		}
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of Action based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized Action, a new Action instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created Action instance, or null if the reader is not pointing to a serialized Action instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Action" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "Action".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						ActionSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActionSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of Action based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of Action.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new Action instance should be created.</param>	
+		/// <returns>Created Action instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new Action(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from Action, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from Action.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Action.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including Action itself) instance of Action based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Action" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "Action".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ActionSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActionSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of Action based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, Action.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from Action, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from Action.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Action.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized Action instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Action instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the Action instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the Action instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one Action instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Action instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Action instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			Action instanceOfAction = element as Action;
+			global::System.Diagnostics.Debug.Assert(instanceOfAction != null, "Expecting an instance of Action");
+	
+			// Name
+			if (!serializationContext.Result.Failed)
+			{
+				global::System.String propValue = instanceOfAction.Name;
+				if (!serializationContext.Result.Failed)
+				{
+					if (!string.IsNullOrEmpty(propValue))
+						HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, "name", propValue);
+	
+				}
+			}
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Action instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+			Action instance = element as Action;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of Action!");
+	
+			// Write child model elements (which are always serialized as nested XML elements).
+			if (!serializationContext.Result.Failed)
+				WriteChildElements(serializationContext, instance, writer);
+		}
+		
+	
+		/// <summary>
+		/// Serialize all child model elements.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Action instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]		
+		private static void WriteChildElements(DslModeling::SerializationContext serializationContext, Action element, global::System.Xml.XmlWriter writer)
+		{
+			// ActionReferencesListeners
+			global::System.Collections.ObjectModel.ReadOnlyCollection<ActionReferencesListeners> allActionReferencesListenersInstances = ActionReferencesListeners.GetLinksToListeners(element);
+			if (!serializationContext.Result.Failed && allActionReferencesListenersInstances.Count > 0)
+			{
+				writer.WriteStartElement("listeners");
+				foreach (ActionReferencesListeners eachActionReferencesListenersInstance in allActionReferencesListenersInstances)
+				{
+					if (serializationContext.Result.Failed)
+						break;
+	
+					DslModeling::DomainClassXmlSerializer relSerializer = serializationContext.Directory.GetSerializer(eachActionReferencesListenersInstance.GetDomainClass().Id);
+					global::System.Diagnostics.Debug.Assert(relSerializer != null, "Cannot find serializer for " + eachActionReferencesListenersInstance.GetDomainClass().Name + "!");
+					relSerializer.Write(serializationContext, eachActionReferencesListenersInstance, writer);
+				}
+				writer.WriteEndElement();
+			}
+	
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given Action instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Action instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the Action instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			Action instance = element as Action;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of Action!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Action instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer SimulationModelHasActivitiesSerializer for DomainClass SimulationModelHasActivities.
+	/// </summary>
+	public partial class SimulationModelHasActivitiesSerializer : DslModeling::DomainRelationshipXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// SimulationModelHasActivitiesSerializer Constructor
+		/// </summary>
+		public SimulationModelHasActivitiesSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of SimulationModelHasActivities.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"simulationModelHasActivities"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of SimulationModelHasActivities.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"simulationModelHasActivitiesMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of SimulationModelHasActivities in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one SimulationModelHasActivities instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the SimulationModelHasActivities element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActivities instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+				
+			// Read nested XML elements, which include at least the instance of target role-player Activity
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read target role-player Activity.
+					ReadTargetRolePlayer(serializationContext, element, reader);
+	
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+				else
+				{
+					HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "SimulationModelHasActivities");
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method reads the target role player Activity.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at the open tag of the first child XML element.
+		/// This method will read only one target role player instance. The method will skip any child XML element it encounters until it reaches:
+		/// 1) The open tag of the target role player.
+		/// 2) The end tag of the parent element (dangling relationship).
+		/// 3) EOF (dangling relationship).
+		/// After the call, the reader is positioned at:
+		/// 1) The open tag of the next child element after the target role player.
+		/// 2) The end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActivities instance that will link to the target Activity instance.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected virtual void ReadTargetRolePlayer(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+	
+			// Read the instance of target role-player Activity
+			DslModeling::ModelElement targetRolePlayer = null;
+			DslModeling::DomainClassXmlSerializer targetRoleSerializer = serializationContext.Directory.GetSerializer(Activity.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(targetRoleSerializer != null, "Cannot find serializer for Activity!");
+	
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				targetRolePlayer = targetRoleSerializer.TryCreateInstance(serializationContext, reader, element.Partition);
+				if (targetRolePlayer != null)
+				{
+					// Attach the target role-player.
+					DslModeling::DomainRoleInfo.SetRolePlayer(element as DslModeling::ElementLink, SimulationModelHasActivities.ActivityDomainRoleId, targetRolePlayer);
+					// Read target role-player.
+					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (targetRolePlayer.GetDomainClass().Id);	
+					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + targetRolePlayer.GetDomainClass().Name + "!");
+					targetSerializer.Read(serializationContext, targetRolePlayer, reader);
+					break;
+				}
+				// Encountered one unknown XML element, skip it and keep reading.
+				HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+				DslModeling::SerializationUtilities.Skip(reader);
+			}
+			if (targetRolePlayer == null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "SimulationModelHasActivities");
+			}
+		}
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActivities instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// There is no property to read; do nothing
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActivities instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+		}
+	
+		#region TryCreateInstance & TryCreateDerivedInstance
+		/// <summary>
+		/// This method creates a correct instance of SimulationModelHasActivities based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized SimulationModelHasActivities, a new SimulationModelHasActivities instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created SimulationModelHasActivities instance, or null if the reader is not pointing to a serialized SimulationModelHasActivities instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, false /* include the type itself */);
+		}
+	
+		/// <summary>
+		/// This method creates a correct derived instance of SimulationModelHasActivities based on the tag currently pointed by the reader.
+		/// Note that the difference between this method and the above one is that this method will never create an instance of the
+		/// SimulationModelHasActivities type itself, only derived types are checked.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <returns>Created instance that derives from SimulationModelHasActivities, or null if the reader is not pointing to such a serialized instance.</returns>
+		public override DslModeling::ElementLink TryCreateDerivedInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, true /* derived types only */) as DslModeling::ElementLink;
+		}
+	
+		/// <summary>
+		/// Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <param name="derivedTypesOnly">If true, this method will only check derived types, but not the domain class iitself.</param>
+		private DslModeling::ModelElement InternalTryCreateInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition, bool derivedTypesOnly)
+		{
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (!derivedTypesOnly && string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "SimulationModelHasActivities" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "SimulationModelHasActivities".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived relationship instance.
+						SimulationModelHasActivitiesSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as SimulationModelHasActivitiesSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of SimulationModelHasActivities based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of SimulationModelHasActivities.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new SimulationModelHasActivities instance should be created.</param>	
+		/// <returns>Created SimulationModelHasActivities instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				// Create the link with place-holder role-players.
+				return new SimulationModelHasActivities(
+					partition,
+					new DslModeling::RoleAssignment[] {
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (SimulationModelHasActivities.SimulationModelDomainRoleId), 
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (SimulationModelHasActivities.ActivityDomainRoleId)
+					},
+					new DslModeling::PropertyAssignment[] {
+						new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id)
+					}
+				);
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from SimulationModelHasActivities, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from SimulationModelHasActivities.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(SimulationModelHasActivities.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including SimulationModelHasActivities itself) instance of SimulationModelHasActivities based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "SimulationModelHasActivities" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "SimulationModelHasActivities".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						SimulationModelHasActivitiesSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as SimulationModelHasActivitiesSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of SimulationModelHasActivities based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, SimulationModelHasActivities.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from SimulationModelHasActivities, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from SimulationModelHasActivities.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(SimulationModelHasActivities.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized SimulationModelHasActivities instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActivities instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the SimulationModelHasActivities instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the SimulationModelHasActivities instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one SimulationModelHasActivities instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActivities instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			// Write the target role-player instance.
+			SimulationModelHasActivities instance = element as SimulationModelHasActivities;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of SimulationModelHasActivities!");
+	
+			DslModeling::ModelElement targetElement = instance.Activity;
+			DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
+			targetSerializer.Write(serializationContext, targetElement, writer);
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActivities instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// There are no properties; do nothing
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActivities instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+		}
+		
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given SimulationModelHasActivities instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">SimulationModelHasActivities instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the SimulationModelHasActivities instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			SimulationModelHasActivities instance = element as SimulationModelHasActivities;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of SimulationModelHasActivities!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">SimulationModelHasActivities instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+		
+		#region Overrides to provide metadata at runtime
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing Id.
+		/// </summary>
+		public override bool SerializesId
+		{
+			get
+			{
+				return true;
+			}
+		}
+	
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing this relationship in full form.
+		/// </summary>
+		public override bool UsesFullForm
+		{
+			get
+			{
+				return true;
+			}
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer SimulationModelHasActionsSerializer for DomainClass SimulationModelHasActions.
+	/// </summary>
+	public partial class SimulationModelHasActionsSerializer : DslModeling::DomainRelationshipXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// SimulationModelHasActionsSerializer Constructor
+		/// </summary>
+		public SimulationModelHasActionsSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of SimulationModelHasActions.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"simulationModelHasActions"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of SimulationModelHasActions.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"simulationModelHasActionsMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of SimulationModelHasActions in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one SimulationModelHasActions instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the SimulationModelHasActions element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActions instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+				
+			// Read nested XML elements, which include at least the instance of target role-player Action
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read target role-player Action.
+					ReadTargetRolePlayer(serializationContext, element, reader);
+	
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+				else
+				{
+					HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "SimulationModelHasActions");
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method reads the target role player Action.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at the open tag of the first child XML element.
+		/// This method will read only one target role player instance. The method will skip any child XML element it encounters until it reaches:
+		/// 1) The open tag of the target role player.
+		/// 2) The end tag of the parent element (dangling relationship).
+		/// 3) EOF (dangling relationship).
+		/// After the call, the reader is positioned at:
+		/// 1) The open tag of the next child element after the target role player.
+		/// 2) The end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActions instance that will link to the target Action instance.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected virtual void ReadTargetRolePlayer(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+	
+			// Read the instance of target role-player Action
+			DslModeling::ModelElement targetRolePlayer = null;
+			DslModeling::DomainClassXmlSerializer targetRoleSerializer = serializationContext.Directory.GetSerializer(Action.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(targetRoleSerializer != null, "Cannot find serializer for Action!");
+	
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				targetRolePlayer = targetRoleSerializer.TryCreateInstance(serializationContext, reader, element.Partition);
+				if (targetRolePlayer != null)
+				{
+					// Attach the target role-player.
+					DslModeling::DomainRoleInfo.SetRolePlayer(element as DslModeling::ElementLink, SimulationModelHasActions.ActionDomainRoleId, targetRolePlayer);
+					// Read target role-player.
+					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (targetRolePlayer.GetDomainClass().Id);	
+					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + targetRolePlayer.GetDomainClass().Name + "!");
+					targetSerializer.Read(serializationContext, targetRolePlayer, reader);
+					break;
+				}
+				// Encountered one unknown XML element, skip it and keep reading.
+				HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+				DslModeling::SerializationUtilities.Skip(reader);
+			}
+			if (targetRolePlayer == null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "SimulationModelHasActions");
+			}
+		}
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActions instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// There is no property to read; do nothing
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory SimulationModelHasActions instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+		}
+	
+		#region TryCreateInstance & TryCreateDerivedInstance
+		/// <summary>
+		/// This method creates a correct instance of SimulationModelHasActions based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized SimulationModelHasActions, a new SimulationModelHasActions instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created SimulationModelHasActions instance, or null if the reader is not pointing to a serialized SimulationModelHasActions instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, false /* include the type itself */);
+		}
+	
+		/// <summary>
+		/// This method creates a correct derived instance of SimulationModelHasActions based on the tag currently pointed by the reader.
+		/// Note that the difference between this method and the above one is that this method will never create an instance of the
+		/// SimulationModelHasActions type itself, only derived types are checked.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <returns>Created instance that derives from SimulationModelHasActions, or null if the reader is not pointing to such a serialized instance.</returns>
+		public override DslModeling::ElementLink TryCreateDerivedInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, true /* derived types only */) as DslModeling::ElementLink;
+		}
+	
+		/// <summary>
+		/// Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <param name="derivedTypesOnly">If true, this method will only check derived types, but not the domain class iitself.</param>
+		private DslModeling::ModelElement InternalTryCreateInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition, bool derivedTypesOnly)
+		{
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (!derivedTypesOnly && string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "SimulationModelHasActions" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "SimulationModelHasActions".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived relationship instance.
+						SimulationModelHasActionsSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as SimulationModelHasActionsSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of SimulationModelHasActions based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of SimulationModelHasActions.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new SimulationModelHasActions instance should be created.</param>	
+		/// <returns>Created SimulationModelHasActions instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				// Create the link with place-holder role-players.
+				return new SimulationModelHasActions(
+					partition,
+					new DslModeling::RoleAssignment[] {
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (SimulationModelHasActions.SimulationModelDomainRoleId), 
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (SimulationModelHasActions.ActionDomainRoleId)
+					},
+					new DslModeling::PropertyAssignment[] {
+						new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id)
+					}
+				);
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from SimulationModelHasActions, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from SimulationModelHasActions.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(SimulationModelHasActions.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including SimulationModelHasActions itself) instance of SimulationModelHasActions based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "SimulationModelHasActions" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "SimulationModelHasActions".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						SimulationModelHasActionsSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as SimulationModelHasActionsSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of SimulationModelHasActions based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, SimulationModelHasActions.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from SimulationModelHasActions, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from SimulationModelHasActions.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(SimulationModelHasActions.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized SimulationModelHasActions instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActions instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the SimulationModelHasActions instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the SimulationModelHasActions instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one SimulationModelHasActions instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActions instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			// Write the target role-player instance.
+			SimulationModelHasActions instance = element as SimulationModelHasActions;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of SimulationModelHasActions!");
+	
+			DslModeling::ModelElement targetElement = instance.Action;
+			DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
+			targetSerializer.Write(serializationContext, targetElement, writer);
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActions instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// There are no properties; do nothing
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">SimulationModelHasActions instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+		}
+		
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given SimulationModelHasActions instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">SimulationModelHasActions instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the SimulationModelHasActions instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			SimulationModelHasActions instance = element as SimulationModelHasActions;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of SimulationModelHasActions!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">SimulationModelHasActions instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+		
+		#region Overrides to provide metadata at runtime
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing Id.
+		/// </summary>
+		public override bool SerializesId
+		{
+			get
+			{
+				return true;
+			}
+		}
+	
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing this relationship in full form.
+		/// </summary>
+		public override bool UsesFullForm
+		{
+			get
+			{
+				return true;
+			}
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ActivityReferencesTriggersSerializer for DomainClass ActivityReferencesTriggers.
+	/// </summary>
+	public partial class ActivityReferencesTriggersSerializer : DslModeling::DomainRelationshipXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ActivityReferencesTriggersSerializer Constructor
+		/// </summary>
+		public ActivityReferencesTriggersSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of ActivityReferencesTriggers.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"activityReferencesTriggers"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of ActivityReferencesTriggers.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"activityReferencesTriggersMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of ActivityReferencesTriggers in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one ActivityReferencesTriggers instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the ActivityReferencesTriggers element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActivityReferencesTriggers instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+				
+			// Read nested XML elements, which include at least the monikerized instance of target role-player Action
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read target role-player Action.
+					ReadTargetRolePlayer(serializationContext, element, reader);
+	
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+				else
+				{
+					HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "ActivityReferencesTriggers");
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method reads the target role player Action.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at the open tag of the first child XML element.
+		/// This method will read only one target role player instance. The method will skip any child XML element it encounters until it reaches:
+		/// 1) The open tag of the target role player.
+		/// 2) The end tag of the parent element (dangling relationship).
+		/// 3) EOF (dangling relationship).
+		/// After the call, the reader is positioned at:
+		/// 1) The open tag of the next child element after the target role player.
+		/// 2) The end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActivityReferencesTriggers instance that will link to the target Action instance.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected virtual void ReadTargetRolePlayer(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+	
+			// Read the monikerized instance of target role-player Action
+			DslModeling::Moniker targetRoleMoniker = null;
+			DslModeling::DomainClassXmlSerializer targetRoleSerializer = serializationContext.Directory.GetSerializer(Action.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(targetRoleSerializer != null, "Cannot find serializer for Action!");
+	
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				targetRoleMoniker = targetRoleSerializer.TryCreateMonikerInstance(serializationContext, reader, ((ActivityReferencesTriggers)element).Activity, ActivityReferencesTriggers.DomainClassId, element.Partition);
+				if (targetRoleMoniker != null)
+				{
+					// Attach the target role-player moniker.
+					DslModeling::DomainRoleInfo.SetRolePlayerMoniker (element as DslModeling::ElementLink, ActivityReferencesTriggers.ActionDomainRoleId, targetRoleMoniker);
+					// Moniker tag has no child XML elements in it, so just skip to the next element.
+					DslModeling::SerializationUtilities.Skip(reader);
+					break;
+				}
+				// Encountered one unknown XML element, skip it and keep reading.
+				HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+				DslModeling::SerializationUtilities.Skip(reader);
+			}
+			if (targetRoleMoniker == null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "ActivityReferencesTriggers");
+			}
+		}
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActivityReferencesTriggers instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// There is no property to read; do nothing
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActivityReferencesTriggers instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+		}
+	
+		#region TryCreateInstance & TryCreateDerivedInstance
+		/// <summary>
+		/// This method creates a correct instance of ActivityReferencesTriggers based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized ActivityReferencesTriggers, a new ActivityReferencesTriggers instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created ActivityReferencesTriggers instance, or null if the reader is not pointing to a serialized ActivityReferencesTriggers instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, false /* include the type itself */);
+		}
+	
+		/// <summary>
+		/// This method creates a correct derived instance of ActivityReferencesTriggers based on the tag currently pointed by the reader.
+		/// Note that the difference between this method and the above one is that this method will never create an instance of the
+		/// ActivityReferencesTriggers type itself, only derived types are checked.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <returns>Created instance that derives from ActivityReferencesTriggers, or null if the reader is not pointing to such a serialized instance.</returns>
+		public override DslModeling::ElementLink TryCreateDerivedInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, true /* derived types only */) as DslModeling::ElementLink;
+		}
+	
+		/// <summary>
+		/// Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <param name="derivedTypesOnly">If true, this method will only check derived types, but not the domain class iitself.</param>
+		private DslModeling::ModelElement InternalTryCreateInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition, bool derivedTypesOnly)
+		{
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (!derivedTypesOnly && string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActivityReferencesTriggers" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "ActivityReferencesTriggers".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived relationship instance.
+						ActivityReferencesTriggersSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActivityReferencesTriggersSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of ActivityReferencesTriggers based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of ActivityReferencesTriggers.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new ActivityReferencesTriggers instance should be created.</param>	
+		/// <returns>Created ActivityReferencesTriggers instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				// Create the link with place-holder role-players.
+				return new ActivityReferencesTriggers(
+					partition,
+					new DslModeling::RoleAssignment[] {
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (ActivityReferencesTriggers.ActivityDomainRoleId), 
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (ActivityReferencesTriggers.ActionDomainRoleId)
+					},
+					new DslModeling::PropertyAssignment[] {
+						new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id)
+					}
+				);
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from ActivityReferencesTriggers, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from ActivityReferencesTriggers.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActivityReferencesTriggers.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including ActivityReferencesTriggers itself) instance of ActivityReferencesTriggers based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActivityReferencesTriggers" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "ActivityReferencesTriggers".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ActivityReferencesTriggersSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActivityReferencesTriggersSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of ActivityReferencesTriggers based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, ActivityReferencesTriggers.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from ActivityReferencesTriggers, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from ActivityReferencesTriggers.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActivityReferencesTriggers.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized ActivityReferencesTriggers instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActivityReferencesTriggers instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the ActivityReferencesTriggers instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the ActivityReferencesTriggers instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one ActivityReferencesTriggers instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActivityReferencesTriggers instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			// Write the target role-player instance.
+			ActivityReferencesTriggers instance = element as ActivityReferencesTriggers;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of ActivityReferencesTriggers!");
+	
+			DslModeling::ModelElement targetElement = instance.Action;
+			DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
+			targetSerializer.WriteMoniker(serializationContext, targetElement, writer, instance.Activity, this);
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActivityReferencesTriggers instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// There are no properties; do nothing
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActivityReferencesTriggers instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+		}
+		
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given ActivityReferencesTriggers instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActivityReferencesTriggers instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the ActivityReferencesTriggers instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			ActivityReferencesTriggers instance = element as ActivityReferencesTriggers;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of ActivityReferencesTriggers!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActivityReferencesTriggers instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	
+		#region Monikerization Support
+		/// <summary>
+		/// Calculates a Moniker, given a reference to a Action
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="sourceElement">Instance of Activity that contains the given serialized reference</param>
+		/// <param name="domainClassId">DomainClassId of the model element that the given moniker string will be resolved to.</param>
+		/// <param name="monikerString">Serialized string reference to an instance of Action</param>
+		/// <param name="store">Store where the Moniker will be created</param>
+		/// <returns>A Moniker encapsulating the serialized string reference of Action instance</returns>
+		public override DslModeling::Moniker MonikerizeReference(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement sourceElement, global::System.Guid domainClassId, string monikerString, DslModeling::Store store)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(sourceElement != null);
+			if (sourceElement == null)
+				throw new global::System.ArgumentNullException ("sourceElement");
+			global::System.Diagnostics.Debug.Assert (sourceElement is Activity, "Expecting an instance of Activity!");
+			global::System.Diagnostics.Debug.Assert (!string.IsNullOrEmpty (monikerString));
+			if (string.IsNullOrEmpty (monikerString))
+				throw new global::System.ArgumentNullException ("monikerString");
+			global::System.Diagnostics.Debug.Assert(store != null);
+			if (store == null)
+				throw new global::System.ArgumentNullException ("store");
+			#endregion
+			
+			DslModeling::MonikerKey key = null;
+			if (DslModeling::SimpleMonikerResolver.IsFullyQualified(monikerString))
+			{
+				key = new DslModeling::MonikerKey(monikerString, ActivityReferencesTriggers.DomainClassId, domainClassId, store);
+			}
+			else
+			{
+				DslModeling::DomainClassXmlSerializer sourceSerializer = serializationContext.Directory.GetSerializer(sourceElement.GetDomainClass().Id);
+				global::System.Diagnostics.Debug.Assert(sourceSerializer != null, "Cannot find serializer for " + sourceElement.GetDomainClass().Name + "!");
+				string sourceQualifier = sourceSerializer.GetMonikerQualifier(serializationContext.Directory, sourceElement);
+				key = new DslModeling::MonikerKey(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, "{0}/{1}", sourceQualifier, monikerString), ActivityReferencesTriggers.DomainClassId, domainClassId, store);
+			}
+			return new DslModeling::Moniker(key, store);
+		}
+	
+		/// <summary>
+		/// Calculates a monikerized string reference to a Action.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="sourceElement">Source side of reference relationship. The referenced target element will be serialized.</param>
+		/// <param name="targetElement">Target side of relationship that will be serialized.</param>
+		/// <returns>A monikerized string reference to target element.</returns>		
+		public override string SerializeReference(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement sourceElement, DslModeling::ModelElement targetElement)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(sourceElement != null);
+			if (sourceElement == null)
+				throw new global::System.ArgumentNullException ("sourceElement");
+			global::System.Diagnostics.Debug.Assert (sourceElement is Activity, "Expecting an instance of Activity!");
+			global::System.Diagnostics.Debug.Assert(targetElement != null);
+			if (targetElement == null)
+				throw new global::System.ArgumentNullException ("targetElement");
+			global::System.Diagnostics.Debug.Assert (targetElement is Action, "Expecting an instance of Action!");
+			#endregion
+			
+			// full form reference
+			DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
+			string targetMoniker = targetSerializer.CalculateQualifiedName(serializationContext.Directory, targetElement);
+			string targetQualifier = targetSerializer.GetMonikerQualifier(serializationContext.Directory, targetElement);
+			
+			if (!string.IsNullOrEmpty(targetQualifier))
+			{
+				DslModeling::DomainClassXmlSerializer sourceSerializer = serializationContext.Directory.GetSerializer(sourceElement.GetDomainClass().Id);
+				global::System.Diagnostics.Debug.Assert(sourceSerializer != null, "Cannot find serializer for " + sourceElement.GetDomainClass().Name + "!");
+				string sourceQualifier = sourceSerializer.GetMonikerQualifier(serializationContext.Directory, sourceElement);
+				if (string.Compare(targetQualifier, sourceQualifier, global::System.StringComparison.CurrentCulture) == 0)
+				{
+					// See if we can create a short form reference by omitting the qualifier
+					global::System.Diagnostics.Debug.Assert(targetMoniker.StartsWith(targetQualifier + "/", global::System.StringComparison.CurrentCulture));
+					string shortFormTargetMoniker = targetMoniker.Substring(targetQualifier.Length + 1);
+					if (!DslModeling::SimpleMonikerResolver.IsFullyQualified(shortFormTargetMoniker))
+						targetMoniker = shortFormTargetMoniker;
+				}
+			}
+	
+			return targetMoniker;
+		}
+		#endregion
+		
+		#region Overrides to provide metadata at runtime
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing Id.
+		/// </summary>
+		public override bool SerializesId
+		{
+			get
+			{
+				return true;
+			}
+		}
+	
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing this relationship in full form.
+		/// </summary>
+		public override bool UsesFullForm
+		{
+			get
+			{
+				return true;
+			}
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ActionReferencesListenersSerializer for DomainClass ActionReferencesListeners.
+	/// </summary>
+	public partial class ActionReferencesListenersSerializer : DslModeling::DomainRelationshipXmlSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ActionReferencesListenersSerializer Constructor
+		/// </summary>
+		public ActionReferencesListenersSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of ActionReferencesListeners.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"actionReferencesListeners"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of ActionReferencesListeners.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"actionReferencesListenersMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of ActionReferencesListeners in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one ActionReferencesListeners instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the ActionReferencesListeners element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActionReferencesListeners instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			ReadPropertiesFromAttributes(serializationContext, element, reader);
+				
+			// Read nested XML elements, which include at least the monikerized instance of target role-player Activity
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read target role-player Activity.
+					ReadTargetRolePlayer(serializationContext, element, reader);
+	
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+				else
+				{
+					HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "ActionReferencesListeners");
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		/// <summary>
+		/// This method reads the target role player Activity.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at the open tag of the first child XML element.
+		/// This method will read only one target role player instance. The method will skip any child XML element it encounters until it reaches:
+		/// 1) The open tag of the target role player.
+		/// 2) The end tag of the parent element (dangling relationship).
+		/// 3) EOF (dangling relationship).
+		/// After the call, the reader is positioned at:
+		/// 1) The open tag of the next child element after the target role player.
+		/// 2) The end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActionReferencesListeners instance that will link to the target Activity instance.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected virtual void ReadTargetRolePlayer(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+	
+			// Read the monikerized instance of target role-player Activity
+			DslModeling::Moniker targetRoleMoniker = null;
+			DslModeling::DomainClassXmlSerializer targetRoleSerializer = serializationContext.Directory.GetSerializer(Activity.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(targetRoleSerializer != null, "Cannot find serializer for Activity!");
+	
+			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				targetRoleMoniker = targetRoleSerializer.TryCreateMonikerInstance(serializationContext, reader, ((ActionReferencesListeners)element).Action, ActionReferencesListeners.DomainClassId, element.Partition);
+				if (targetRoleMoniker != null)
+				{
+					// Attach the target role-player moniker.
+					DslModeling::DomainRoleInfo.SetRolePlayerMoniker (element as DslModeling::ElementLink, ActionReferencesListeners.ActivityDomainRoleId, targetRoleMoniker);
+					// Moniker tag has no child XML elements in it, so just skip to the next element.
+					DslModeling::SerializationUtilities.Skip(reader);
+					break;
+				}
+				// Encountered one unknown XML element, skip it and keep reading.
+				HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+				DslModeling::SerializationUtilities.Skip(reader);
+			}
+			if (targetRoleMoniker == null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "ActionReferencesListeners");
+			}
+		}
+	
+		/// <summary>
+		/// This method deserializes all properties that are serialized as XML attributes.
+		/// </summary>
+		/// <remarks>
+		/// Because this method only handles properties serialized as XML attributes, the passed-in reader shouldn't be moved inside this method.
+		/// The caller will guarantee that the reader is positioned on the open XML tag of the current element being deserialized.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActionReferencesListeners instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void ReadPropertiesFromAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// There is no property to read; do nothing
+		}
+	
+		/// <summary>
+		/// This methods deserializes nested XML elements inside the passed-in element.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the current element does have nested XML elements, and the call will position the 
+		/// reader at the open tag of the first child XML element.
+		/// This method will read as many child XML elements as it can. It returns under three circumstances:
+		/// 1) When an unknown child XML element is encountered. In this case, this method will position the reader at the open 
+		///    tag of the unknown element. This implies that if the first child XML element is unknown, this method should return 
+		///    immediately and do nothing.
+		/// 2) When all child XML elemnets are read. In this case, the reader will be positioned at the end tag of the parent element.
+		/// 3) EOF.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActionReferencesListeners instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		protected override void ReadElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			// Always call the base class so any extensions are deserialized
+			base.ReadElements(serializationContext, element, reader);
+	
+		}
+	
+		#region TryCreateInstance & TryCreateDerivedInstance
+		/// <summary>
+		/// This method creates a correct instance of ActionReferencesListeners based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized ActionReferencesListeners, a new ActionReferencesListeners instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created ActionReferencesListeners instance, or null if the reader is not pointing to a serialized ActionReferencesListeners instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, false /* include the type itself */);
+		}
+	
+		/// <summary>
+		/// This method creates a correct derived instance of ActionReferencesListeners based on the tag currently pointed by the reader.
+		/// Note that the difference between this method and the above one is that this method will never create an instance of the
+		/// ActionReferencesListeners type itself, only derived types are checked.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <returns>Created instance that derives from ActionReferencesListeners, or null if the reader is not pointing to such a serialized instance.</returns>
+		public override DslModeling::ElementLink TryCreateDerivedInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			return this.InternalTryCreateInstance(serializationContext, reader, partition, true /* derived types only */) as DslModeling::ElementLink;
+		}
+	
+		/// <summary>
+		/// Internal helper method for TryCreateInstance() and TryCreateDerivedInstance().
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>
+		/// <param name="derivedTypesOnly">If true, this method will only check derived types, but not the domain class iitself.</param>
+		private DslModeling::ModelElement InternalTryCreateInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition, bool derivedTypesOnly)
+		{
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (!derivedTypesOnly && string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActionReferencesListeners" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "ActionReferencesListeners".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived relationship instance.
+						ActionReferencesListenersSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActionReferencesListenersSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of ActionReferencesListeners based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of ActionReferencesListeners.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new ActionReferencesListeners instance should be created.</param>	
+		/// <returns>Created ActionReferencesListeners instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				// Create the link with place-holder role-players.
+				return new ActionReferencesListeners(
+					partition,
+					new DslModeling::RoleAssignment[] {
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (ActionReferencesListeners.ActionDomainRoleId), 
+						DslModeling::RoleAssignment.CreatePlaceholderRoleAssignment (ActionReferencesListeners.ActivityDomainRoleId)
+					},
+					new DslModeling::PropertyAssignment[] {
+						new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id)
+					}
+				);
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from ActionReferencesListeners, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from ActionReferencesListeners.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActionReferencesListeners.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including ActionReferencesListeners itself) instance of ActionReferencesListeners based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActionReferencesListeners" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "ActionReferencesListeners".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ActionReferencesListenersSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActionReferencesListenersSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of ActionReferencesListeners based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, ActionReferencesListeners.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from ActionReferencesListeners, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from ActionReferencesListeners.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActionReferencesListeners.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized ActionReferencesListeners instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActionReferencesListeners instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the ActionReferencesListeners instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the ActionReferencesListeners instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one ActionReferencesListeners instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActionReferencesListeners instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			// Write the target role-player instance.
+			ActionReferencesListeners instance = element as ActionReferencesListeners;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of ActionReferencesListeners!");
+	
+			DslModeling::ModelElement targetElement = instance.Activity;
+			DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
+			targetSerializer.WriteMoniker(serializationContext, targetElement, writer, instance.Action, this);
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+	
+		/// <summary>
+		/// Write all properties that need to be serialized as XML attributes.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActionReferencesListeners instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param> 
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Generated code.")]
+		protected override void WritePropertiesAsAttributes(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// There are no properties; do nothing
+		}
+	
+		/// <summary>
+		/// This methods serializes 1) properties serialized as nested XML elements and 2) child model elements into XML. 
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActionReferencesListeners instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>        
+		protected override void WriteElements(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer)
+		{
+			// Always call the base class so any extensions are serialized
+			base.WriteElements(serializationContext, element, writer);
+	
+		}
+		
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given ActionReferencesListeners instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActionReferencesListeners instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the ActionReferencesListeners instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			ActionReferencesListeners instance = element as ActionReferencesListeners;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of ActionReferencesListeners!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActionReferencesListeners instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	
+		#region Monikerization Support
+		/// <summary>
+		/// Calculates a Moniker, given a reference to a Activity
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="sourceElement">Instance of Action that contains the given serialized reference</param>
+		/// <param name="domainClassId">DomainClassId of the model element that the given moniker string will be resolved to.</param>
+		/// <param name="monikerString">Serialized string reference to an instance of Activity</param>
+		/// <param name="store">Store where the Moniker will be created</param>
+		/// <returns>A Moniker encapsulating the serialized string reference of Activity instance</returns>
+		public override DslModeling::Moniker MonikerizeReference(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement sourceElement, global::System.Guid domainClassId, string monikerString, DslModeling::Store store)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(sourceElement != null);
+			if (sourceElement == null)
+				throw new global::System.ArgumentNullException ("sourceElement");
+			global::System.Diagnostics.Debug.Assert (sourceElement is Action, "Expecting an instance of Action!");
+			global::System.Diagnostics.Debug.Assert (!string.IsNullOrEmpty (monikerString));
+			if (string.IsNullOrEmpty (monikerString))
+				throw new global::System.ArgumentNullException ("monikerString");
+			global::System.Diagnostics.Debug.Assert(store != null);
+			if (store == null)
+				throw new global::System.ArgumentNullException ("store");
+			#endregion
+			
+			DslModeling::MonikerKey key = null;
+			if (DslModeling::SimpleMonikerResolver.IsFullyQualified(monikerString))
+			{
+				key = new DslModeling::MonikerKey(monikerString, ActionReferencesListeners.DomainClassId, domainClassId, store);
+			}
+			else
+			{
+				DslModeling::DomainClassXmlSerializer sourceSerializer = serializationContext.Directory.GetSerializer(sourceElement.GetDomainClass().Id);
+				global::System.Diagnostics.Debug.Assert(sourceSerializer != null, "Cannot find serializer for " + sourceElement.GetDomainClass().Name + "!");
+				string sourceQualifier = sourceSerializer.GetMonikerQualifier(serializationContext.Directory, sourceElement);
+				key = new DslModeling::MonikerKey(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, "{0}/{1}", sourceQualifier, monikerString), ActionReferencesListeners.DomainClassId, domainClassId, store);
+			}
+			return new DslModeling::Moniker(key, store);
+		}
+	
+		/// <summary>
+		/// Calculates a monikerized string reference to a Activity.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="sourceElement">Source side of reference relationship. The referenced target element will be serialized.</param>
+		/// <param name="targetElement">Target side of relationship that will be serialized.</param>
+		/// <returns>A monikerized string reference to target element.</returns>		
+		public override string SerializeReference(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement sourceElement, DslModeling::ModelElement targetElement)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(sourceElement != null);
+			if (sourceElement == null)
+				throw new global::System.ArgumentNullException ("sourceElement");
+			global::System.Diagnostics.Debug.Assert (sourceElement is Action, "Expecting an instance of Action!");
+			global::System.Diagnostics.Debug.Assert(targetElement != null);
+			if (targetElement == null)
+				throw new global::System.ArgumentNullException ("targetElement");
+			global::System.Diagnostics.Debug.Assert (targetElement is Activity, "Expecting an instance of Activity!");
+			#endregion
+			
+			// full form reference
+			DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer(targetElement.GetDomainClass().Id);
+			global::System.Diagnostics.Debug.Assert(targetSerializer != null, "Cannot find serializer for " + targetElement.GetDomainClass().Name + "!");
+			string targetMoniker = targetSerializer.CalculateQualifiedName(serializationContext.Directory, targetElement);
+			string targetQualifier = targetSerializer.GetMonikerQualifier(serializationContext.Directory, targetElement);
+			
+			if (!string.IsNullOrEmpty(targetQualifier))
+			{
+				DslModeling::DomainClassXmlSerializer sourceSerializer = serializationContext.Directory.GetSerializer(sourceElement.GetDomainClass().Id);
+				global::System.Diagnostics.Debug.Assert(sourceSerializer != null, "Cannot find serializer for " + sourceElement.GetDomainClass().Name + "!");
+				string sourceQualifier = sourceSerializer.GetMonikerQualifier(serializationContext.Directory, sourceElement);
+				if (string.Compare(targetQualifier, sourceQualifier, global::System.StringComparison.CurrentCulture) == 0)
+				{
+					// See if we can create a short form reference by omitting the qualifier
+					global::System.Diagnostics.Debug.Assert(targetMoniker.StartsWith(targetQualifier + "/", global::System.StringComparison.CurrentCulture));
+					string shortFormTargetMoniker = targetMoniker.Substring(targetQualifier.Length + 1);
+					if (!DslModeling::SimpleMonikerResolver.IsFullyQualified(shortFormTargetMoniker))
+						targetMoniker = shortFormTargetMoniker;
+				}
+			}
+	
+			return targetMoniker;
+		}
+		#endregion
+		
+		#region Overrides to provide metadata at runtime
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing Id.
+		/// </summary>
+		public override bool SerializesId
+		{
+			get
+			{
+				return true;
+			}
+		}
+	
+		/// <summary>
+		/// Exposes whether serializers derived from this class are serializing this relationship in full form.
+		/// </summary>
+		public override bool UsesFullForm
+		{
+			get
+			{
+				return true;
+			}
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ActivityShapeSerializer for DomainClass ActivityShape.
+	/// </summary>
+	public partial class ActivityShapeSerializer : DslDiagrams::NodeShapeSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ActivityShapeSerializer Constructor
+		/// </summary>
+		public ActivityShapeSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of ActivityShape.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"activityShape"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of ActivityShape.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"activityShapeMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of ActivityShape in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one ActivityShape instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the ActivityShape element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActivityShape instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						base.ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of ActivityShape based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized ActivityShape, a new ActivityShape instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created ActivityShape instance, or null if the reader is not pointing to a serialized ActivityShape instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActivityShape" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "ActivityShape".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						ActivityShapeSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActivityShapeSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of ActivityShape based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of ActivityShape.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new ActivityShape instance should be created.</param>	
+		/// <returns>Created ActivityShape instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new ActivityShape(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from ActivityShape, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from ActivityShape.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActivityShape.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including ActivityShape itself) instance of ActivityShape based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActivityShape" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "ActivityShape".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ActivityShapeSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActivityShapeSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of ActivityShape based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, ActivityShape.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from ActivityShape, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from ActivityShape.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActivityShape.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized ActivityShape instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActivityShape instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the ActivityShape instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the ActivityShape instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one ActivityShape instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActivityShape instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				base.WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given ActivityShape instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActivityShape instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the ActivityShape instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			ActivityShape instance = element as ActivityShape;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of ActivityShape!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActivityShape instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ActionShapeSerializer for DomainClass ActionShape.
+	/// </summary>
+	public partial class ActionShapeSerializer : DslDiagrams::NodeShapeSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ActionShapeSerializer Constructor
+		/// </summary>
+		public ActionShapeSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of ActionShape.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"actionShape"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of ActionShape.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"actionShapeMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of ActionShape in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one ActionShape instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the ActionShape element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory ActionShape instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						base.ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of ActionShape based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized ActionShape, a new ActionShape instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created ActionShape instance, or null if the reader is not pointing to a serialized ActionShape instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActionShape" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "ActionShape".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						ActionShapeSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActionShapeSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of ActionShape based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of ActionShape.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new ActionShape instance should be created.</param>	
+		/// <returns>Created ActionShape instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new ActionShape(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from ActionShape, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from ActionShape.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActionShape.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including ActionShape itself) instance of ActionShape based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "ActionShape" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "ActionShape".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ActionShapeSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ActionShapeSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of ActionShape based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, ActionShape.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from ActionShape, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from ActionShape.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(ActionShape.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized ActionShape instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActionShape instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the ActionShape instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the ActionShape instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one ActionShape instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">ActionShape instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				base.WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given ActionShape instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActionShape instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the ActionShape instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			ActionShape instance = element as ActionShape;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of ActionShape!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">ActionShape instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer TriggerSerializer for DomainClass Trigger.
+	/// </summary>
+	public partial class TriggerSerializer : DslDiagrams::BinaryLinkShapeSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// TriggerSerializer Constructor
+		/// </summary>
+		public TriggerSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of Trigger.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"trigger"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of Trigger.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"triggerMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of Trigger in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one Trigger instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the Trigger element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Trigger instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						base.ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of Trigger based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized Trigger, a new Trigger instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created Trigger instance, or null if the reader is not pointing to a serialized Trigger instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Trigger" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "Trigger".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						TriggerSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as TriggerSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of Trigger based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of Trigger.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new Trigger instance should be created.</param>	
+		/// <returns>Created Trigger instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new Trigger(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from Trigger, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from Trigger.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Trigger.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including Trigger itself) instance of Trigger based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Trigger" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "Trigger".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						TriggerSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as TriggerSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of Trigger based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, Trigger.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from Trigger, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from Trigger.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Trigger.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized Trigger instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Trigger instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the Trigger instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the Trigger instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one Trigger instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Trigger instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				base.WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given Trigger instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Trigger instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the Trigger instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			Trigger instance = element as Trigger;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of Trigger!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Trigger instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer ListenerSerializer for DomainClass Listener.
+	/// </summary>
+	public partial class ListenerSerializer : DslDiagrams::BinaryLinkShapeSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// ListenerSerializer Constructor
+		/// </summary>
+		public ListenerSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of Listener.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"listener"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of Listener.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"listenerMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of Listener in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one Listener instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the Listener element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory Listener instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						base.ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of Listener based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized Listener, a new Listener instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created Listener instance, or null if the reader is not pointing to a serialized Listener instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Listener" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "Listener".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						ListenerSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ListenerSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of Listener based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of Listener.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new Listener instance should be created.</param>	
+		/// <returns>Created Listener instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new Listener(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from Listener, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from Listener.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Listener.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including Listener itself) instance of Listener based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "Listener" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "Listener".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						ListenerSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as ListenerSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of Listener based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, Listener.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from Listener, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from Listener.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(Listener.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized Listener instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Listener instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the Listener instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the Listener instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one Listener instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">Listener instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				base.WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given Listener instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Listener instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the Listener instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			Listener instance = element as Listener;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of Listener!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">Listener instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Serializer HLSimDiagramSerializer for DomainClass HLSimDiagram.
+	/// </summary>
+	public partial class HLSimDiagramSerializer : DslDiagrams::DiagramSerializer
+	{
+		#region Constructor
+		/// <summary>
+		/// HLSimDiagramSerializer Constructor
+		/// </summary>
+		public HLSimDiagramSerializer ()
+			: base ()
+		{
+		}
+		#endregion
+	
+		
+		#region Miscellaneous methods
+	
+		/// <summary>
+		/// Reset the serializer
+		/// </summary>
+		/// <remarks>
+		/// Clear the cached information about any derived classes so that it is recalculated.
+		/// </remarks>
+		public override void Reset()
+		{
+			base.Reset();
+			this.derivedClasses = null;
+			this.derivedClassMonikers = null;
+		}
+	
+		#endregion
+	
+		#region Public Properties
+		/// <summary>
+		/// This is the XML tag name used to serialize an instance of HLSimDiagram.
+		/// </summary>
+		public override string XmlTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"hLSimDiagram"; }
+		}
+	
+		/// <summary>
+		/// This is the XML tag name used to serialize a monikerized instance of HLSimDiagram.
+		/// </summary>
+		public override string MonikerTagName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"hLSimDiagramMoniker"; }
+		}
+		
+		/// <summary>
+		/// This is the name of the XML attribute that stores the moniker of HLSimDiagram in a serialized monikerized instance.
+		/// </summary>
+		public override string MonikerAttributeName
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return @"Id"; }
+		}
+		#endregion
+	
+		#region Read Methods
+		/// <summary>
+		/// Public Read() method that deserializes one HLSimDiagram instance from XML.
+		/// </summary>
+		/// <remarks>
+		/// When this method is called, caller guarantees that the passed-in XML reader is positioned at the open XML tag
+		/// of the HLSimDiagram element that is about to be deserialized. 
+		/// The method needs to ensure that when it returns, the reader is positioned at the open XML tag of the next sibling element,
+		/// or the close tag of the parent element (or EOF).
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">In-memory HLSimDiagram instance that will get the deserialized data.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		public override void Read(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			#endregion
+			
+			// Read properties serialized as XML attributes.
+			base.ReadPropertiesFromAttributes(serializationContext, element, reader);
+	
+			// Read nested XML elements.
+			if (!serializationContext.Result.Failed)
+			{
+				if (!reader.IsEmptyElement)
+				{
+					// Read to the start of the first child element.
+					DslModeling::SerializationUtilities.SkipToFirstChild(reader);
+					
+					// Read any extension element data under this XML element
+					HLSimSerializationHelper.Instance.ReadExtensions(serializationContext, element, reader);
+					
+					// Read nested XML elements, they can be either properties serialized as XML elements, or child 
+					// model elements.
+					while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+					{
+						base.ReadElements(serializationContext, element, reader);
+						if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+						{
+							// Encountered one unknown XML element, skip it and keep reading.
+							HLSimSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
+							DslModeling::SerializationUtilities.Skip(reader);
+						}
+					}
+				}
+			}
+	
+			// Advance the reader to the next element (open tag of the next sibling, end tag of the parent, or EOF)
+			DslModeling::SerializationUtilities.Skip(reader);
+		}
+		
+	
+		#region TryCreateInstance
+		/// <summary>
+		/// This method creates a correct instance of HLSimDiagram based on the tag currently pointed by the reader. If the reader
+		/// is positioned at a serialized HLSimDiagram, a new HLSimDiagram instance will be created in the given partition, otherwise 
+		/// null is returned.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new elements should be created.</param>	
+		/// <returns>Created HLSimDiagram instance, or null if the reader is not pointing to a serialized HLSimDiagram instance.</returns>
+		public override DslModeling::ModelElement TryCreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::ModelElement result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.XmlTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "HLSimDiagram" instance.
+					result = this.CreateInstance(serializationContext, reader, partition);
+				}
+				else
+				{	// Check for derived classes of "HLSimDiagram".
+					if (this.derivedClasses == null)
+						this.ConstructDerivedClassesLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert (this.derivedClasses != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClasses.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class instance.
+						HLSimDiagramSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as HLSimDiagramSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateInstance(serializationContext, reader, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+	
+		/// <summary>
+		/// This method creates an instance of HLSimDiagram based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
+		/// to be pointed at a serialized instance of HLSimDiagram.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="partition">Partition in which new HLSimDiagram instance should be created.</param>	
+		/// <returns>Created HLSimDiagram instance.</returns>
+		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
+		{
+			string idStr = reader.GetAttribute ("Id");
+			try
+			{
+				global::System.Guid id;
+				if (string.IsNullOrEmpty(idStr))
+				{	// Create a default Id.
+					id = global::System.Guid.NewGuid();
+					HLSimSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
+				}
+				else
+				{
+					id = new global::System.Guid (idStr);
+				}
+				return new HLSimDiagram(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
+			}
+			catch (global::System.ArgumentNullException /* anEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			catch (global::System.OverflowException /* ofEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
+			}
+			return null;
+		}
+	
+		/// <summary>
+		/// Stores a mapping from XmlTagName to DomainClassInfo that derives from HLSimDiagram, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClasses;
+	
+		/// <summary>
+		/// Construct the apping from XmlTagName to DomainClassInfo that derives from HLSimDiagram.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); // Shouldn't construct the table more than once.
+			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(HLSimDiagram.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					global::System.Type descendentType = descendent.ImplementationClass;
+					if (!descendentType.IsAbstract)
+					{
+						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+						if (descendentSerializer != null)
+						{
+							string descendentXmlTagName = descendentSerializer.XmlTagName;
+							if (!string.IsNullOrEmpty (descendentXmlTagName))
+							{
+								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
+								this.derivedClasses.Add (descendentXmlTagName, descendent);
+							}
+						}
+					}
+					else
+					{   // Ignore abstract derived classes because they cannot be instantiated directly.
+					}
+				}
+			}
+		}
+		#endregion
+	
+		#region TryCreateMonikerInstance
+		/// <summary>
+		/// This method creates a Moniker of the correct derived (including HLSimDiagram itself) instance of HLSimDiagram based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		public override DslModeling::Moniker TryCreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException ("reader");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (partition != null);
+			if (partition == null)
+				throw new global::System.ArgumentNullException ("partition");
+			#endregion
+	
+			DslModeling::Moniker result = null;
+			if (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
+			{
+				string localName = reader.LocalName;
+				if (string.Compare (localName, this.MonikerTagName, global::System.StringComparison.CurrentCulture) == 0)
+				{	// New "HLSimDiagram" moniker instance.
+					result = this.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+				}
+				else
+				{	// Check for derived classes of "HLSimDiagram".
+					if (this.derivedClassMonikers == null)
+						this.ConstructDerivedClassMonikersLookupTable(serializationContext, partition.DomainDataDirectory);
+					global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers != null);
+					DslModeling::DomainClassInfo derivedClass = null;
+					if (this.derivedClassMonikers.TryGetValue (localName, out derivedClass) && derivedClass != null)
+					{	// New derived class moniker instance.
+						HLSimDiagramSerializer derivedSerializer = serializationContext.Directory.GetSerializer(derivedClass.Id) as HLSimDiagramSerializer;
+						global::System.Diagnostics.Debug.Assert(derivedSerializer != null, "Cannot find serializer for " + derivedClass.Name + "!");
+						result = derivedSerializer.CreateMonikerInstance(serializationContext, reader, sourceRolePlayer, relDomainClassId, partition);
+					}
+				}
+			}
+	
+			return result;
+		}
+		
+		/// <summary>
+		/// This method creates a Moniker of HLSimDiagram based on the tag currently pointed by the reader.
+		/// </summary>
+		/// <remarks>
+		/// The caller will guarantee that the reader is positioned at open XML tag of the next element being read. This method should
+		/// not move the reader; the reader should remain at the same position when this method returns.
+		/// </remarks>		
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="reader">XmlReader to read serialized data from.</param>
+		/// <param name="sourceRolePlayer">The source role-player instance from which the moniker being created is referenced.</param>
+		/// <param name="relDomainClassId">The DomainClass Id of the relationship that connects the sourceRolePlayer to the moniker being created.</param>
+		/// <param name="partition">The new Moniker should be created in the Store associated with this partition.</param>			
+		/// <returns>Created ModelRoot instance, or null if the reader is not pointing to a correct monikerized instance.</returns>
+		protected override DslModeling::Moniker CreateMonikerInstance (DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::ModelElement sourceRolePlayer, global::System.Guid relDomainClassId, DslModeling::Partition partition)
+		{
+			string monikerString = HLSimSerializationHelper.Instance.ReadAttribute(serializationContext, sourceRolePlayer, reader, this.MonikerAttributeName);
+	
+			if (string.IsNullOrEmpty(monikerString))
+			{	
+				HLSimSerializationBehaviorSerializationMessages.MissingMoniker(serializationContext, reader, this.MonikerAttributeName);
+				return null;
+			}
+			try
+			{	// Normalize the Id.
+				global::System.Guid id = new global::System.Guid(monikerString);
+				monikerString = id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+				DslModeling::Moniker result = new DslModeling::Moniker(new DslModeling::MonikerKey(monikerString, relDomainClassId, HLSimDiagram.DomainClassId, partition.Store), partition.Store);
+				// Set location info if possible.
+				result.Location = serializationContext.Location;
+				global::System.Xml.IXmlLineInfo xmlLineInfo = reader as global::System.Xml.IXmlLineInfo;
+				if (xmlLineInfo != null)
+				{
+					result.Line = xmlLineInfo.LineNumber;
+					result.Column = xmlLineInfo.LinePosition;
+				}
+				return result;
+			}
+			catch (global::System.FormatException /* fEx */)
+			{
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+			catch (global::System.OverflowException /* oEx */)
+			{	
+				HLSimSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, this.MonikerAttributeName, typeof(global::System.Guid), monikerString);
+				return null;
+			}
+		}
+	
+		/// <summary>
+		/// Stores a mapping from Moniker Xml tag name to DomainClassInfo that derives from HLSimDiagram, created on demand.
+		/// </summary>
+		private global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> derivedClassMonikers;
+	
+		/// <summary>
+		/// Construct the mapping from Moniker Xml tag name to DomainClassInfo that derives from HLSimDiagram.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
+		private void ConstructDerivedClassMonikersLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
+		{
+			global::System.Diagnostics.Debug.Assert(this.derivedClassMonikers == null); // Shouldn't construct the table more than once.
+			this.derivedClassMonikers = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
+	
+			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(HLSimDiagram.DomainClassId);
+			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
+	
+			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
+			if (descendents != null)
+			{
+				foreach (DslModeling::DomainClassInfo descendent in descendents)
+				{
+					DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
+					if (descendentSerializer != null)
+					{
+						string descendentMonikerTagName = descendentSerializer.MonikerTagName;
+						if (!string.IsNullOrEmpty (descendentMonikerTagName))
+						{
+							global::System.Diagnostics.Debug.Assert(!this.derivedClassMonikers.ContainsKey (descendentMonikerTagName));
+							this.derivedClassMonikers.Add (descendentMonikerTagName, descendent);
+						}
+					}
+				}
+			}
+		}
+		#endregion
+		#endregion
+	
+		#region Write Methods
+		/// <summary>
+		/// Public WriteMoniker() method that writes a monikerized HLSimDiagram instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">HLSimDiagram instance to be monikerized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="sourceRolePlayer">Source element that references the HLSimDiagram instance being monikerized.</param>
+		/// <param name="relSerializer">Serializer that handles the relationship connecting the source element to the HLSimDiagram instance being monikerized.</param>
+		public override void WriteMoniker(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::ModelElement sourceRolePlayer, DslModeling::DomainRelationshipXmlSerializer relSerializer)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			global::System.Diagnostics.Debug.Assert (sourceRolePlayer != null);
+			if (sourceRolePlayer == null)
+				throw new global::System.ArgumentNullException ("sourceRolePlayer");
+			global::System.Diagnostics.Debug.Assert (relSerializer != null);
+			if (relSerializer == null)
+				throw new global::System.ArgumentNullException ("relSerializer");
+			#endregion
+			
+			string monikerString = this.CalculateQualifiedName(serializationContext.Directory, element);
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerString));
+			writer.WriteStartElement(this.MonikerTagName);
+			HLSimSerializationHelper.Instance.WriteAttributeString(serializationContext, element, writer, this.MonikerAttributeName, monikerString);
+			writer.WriteEndElement();
+		}
+		
+		/// <summary>
+		/// Public Write() method that serializes one HLSimDiagram instance into XML.
+		/// </summary>
+		/// <param name="serializationContext">Serialization context.</param>
+		/// <param name="element">HLSimDiagram instance to be serialized.</param>
+		/// <param name="writer">XmlWriter to write serialized data to.</param>
+		/// <param name="rootElementSettings">
+		/// The root element settings if the passed in element is serialized as a root element in the XML. The root element contains additional
+		/// information like schema target namespace, version, etc.
+		/// This should only be passed for root-level elements. Null should be passed for rest elements (and ideally call the Write() method 
+		/// without this parameter).
+		/// </param>
+		public override void Write(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlWriter writer, DslModeling::RootElementSettings rootElementSettings)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException ("serializationContext");
+			global::System.Diagnostics.Debug.Assert (element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException ("element");
+			global::System.Diagnostics.Debug.Assert (writer != null);
+			if (writer == null)
+				throw new global::System.ArgumentNullException ("writer");
+			#endregion
+	
+			// Write start of element, including schema target namespace if specified.
+			if (rootElementSettings != null && !string.IsNullOrEmpty(rootElementSettings.SchemaTargetNamespace))
+			{
+				writer.WriteStartElement(this.XmlTagName, rootElementSettings.SchemaTargetNamespace);
+				DslModeling::SerializationUtilities.WriteDomainModelNamespaces(serializationContext.Directory, writer, rootElementSettings.SchemaTargetNamespace);
+			}
+			else
+			{
+				writer.WriteStartElement(this.XmlTagName);
+			}
+				
+			// Write version info (in the format 1.2.3.4), if necessary
+			if (rootElementSettings != null && rootElementSettings.Version != null)
+				writer.WriteAttributeString("dslVersion", rootElementSettings.Version.ToString(4));
+	
+			// Write out element Id.
+			writer.WriteAttributeString("Id", element.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture));
+	
+			base.WritePropertiesAsAttributes(serializationContext, element, writer);
+	
+			// Write out any extension data if this is the root element
+			if (rootElementSettings != null && !serializationContext.Result.Failed)
+			{
+				HLSimSerializationHelper.Instance.WriteExtensions(serializationContext, element, writer);
+			}
+	
+			if (!serializationContext.Result.Failed)
+			{
+				// Write 1) properties serialized as nested XML elements and 2) child model elements into XML.
+				base.WriteElements(serializationContext, element, writer);
+			}
+	
+			writer.WriteEndElement();
+		}
+		#endregion
+	
+		#region Moniker Support
+		/// <summary>
+		/// This method calculates a moniker to a given HLSimDiagram instance.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">HLSimDiagram instance to calculate qualified name for.</param>
+		/// <returns>A fully qualified string moniker to the HLSimDiagram instance.</returns>
+		public override string CalculateQualifiedName(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			HLSimDiagram instance = element as HLSimDiagram;
+			global::System.Diagnostics.Debug.Assert(instance != null, "Expecting an instance of HLSimDiagram!");
+	
+			return instance.Id.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture);
+		}
+	
+		/// <summary>
+		/// A domain class can be monikerized in different ways: standard /qualifier/key mechanism, custom moniker, or element ID. If the domain class is serialized
+		/// using standard /qualifier/key mechanism, this method returns the qualifier of the moniker; if the domain class uses other ways for monikerization, this method
+		/// returns empty string.
+		/// </summary>
+		/// <param name="directory">Directory to look up serializer based on model element type.</param>
+		/// <param name="element">HLSimDiagram instance to get moniker qualifier from.</param>
+		/// <returns>
+		/// Value of this element's moniker qualifier property, if it has one, or the value of the container's moniker qualifier property. Or empty string if this
+		/// element is not monikerized using standard /qualifier/key mechanism.
+		/// </returns>
+		public override string GetMonikerQualifier(DslModeling::DomainXmlSerializerDirectory directory, DslModeling::ModelElement element)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert (directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException ("directory");
+			global::System.Diagnostics.Debug.Assert(element != null);
+			if (element == null)
+				throw new global::System.ArgumentNullException("element");
+			#endregion	
+			
+			return string.Empty;
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// A DomainXmlSerializationBehavior implementation for defined behavior HLSimSerializationBehavior.
+	/// This is the abstract base of the double-derived implementation.
+	/// </summary>
+	[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]		
+	public abstract class HLSimSerializationBehaviorBase : DslModeling::DomainXmlSerializationBehavior
+	{
+		///<summary>
+		/// The xml namespace used by this domain model when serializing
+		///</summary>
+		public const string DomainModelXmlNamespace = @"http://schemas.microsoft.com/dsltools/HLSim";
+	
+		#region Member Variables
+		/// <summary>
+		/// A list of DomainClass Ids mapped to DomainClassXmlSerializer types.
+		/// </summary>
+		private static global::System.Collections.Generic.List<DslModeling::DomainXmlSerializerDirectoryEntry> serializerTypes;
+	
+		/// <summary>
+		/// A list of xml namespaces mapped to domain model types.
+		/// </summary>
+		private static global::System.Collections.Generic.List<DslModeling::DomainXmlSerializerNamespaceEntry> namespaceEntries;
+	
+		#endregion
+	
+		#region Constructor
+		/// <summary>
+		/// Protected constructor to prevent public instantiation.
+		/// </summary>
+		protected HLSimSerializationBehaviorBase() : base() { }
+		#endregion
+		
+		#region Protected Methods
+		/// <summary>
+		/// Allows custom serializers to be added.
+		/// Base implementation doesn't do anything.
+		/// </summary>
+		/// <returns>Custom serializer types, null or empty list if there's no custom serializer types.</returns>
+		[global::System.Diagnostics.DebuggerBrowsable(global::System.Diagnostics.DebuggerBrowsableState.Never)]
+		protected virtual global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainXmlSerializerDirectoryEntry> CustomSerializerTypes
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return null; }
+		}
+		#endregion
+	
+		#region Public Methods
+		/// <summary>
+		/// This provides a mapping from DomainClass Id to DomainXmlSerializer implementation types.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]	// Will trigger creation otherwise.
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]		
+		public override global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainXmlSerializerDirectoryEntry> AllSerializers
+		{
+			get
+			{
+				if (HLSimSerializationBehavior.serializerTypes == null)
+				{
+					global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainXmlSerializerDirectoryEntry> customSerializerTypes = this.CustomSerializerTypes;
+					int customSerializerCount = (customSerializerTypes == null ? 0 : customSerializerTypes.Count);
+					HLSimSerializationBehavior.serializerTypes = new global::System.Collections.Generic.List<DslModeling::DomainXmlSerializerDirectoryEntry>(12 + customSerializerCount);
+	
+					#region Serializers defined in this model
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(SimulationModel.DomainClassId, typeof(SimulationModelSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(Activity.DomainClassId, typeof(ActivitySerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(Action.DomainClassId, typeof(ActionSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(SimulationModelHasActivities.DomainClassId, typeof(SimulationModelHasActivitiesSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(SimulationModelHasActions.DomainClassId, typeof(SimulationModelHasActionsSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(ActivityReferencesTriggers.DomainClassId, typeof(ActivityReferencesTriggersSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(ActionReferencesListeners.DomainClassId, typeof(ActionReferencesListenersSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(ActivityShape.DomainClassId, typeof(ActivityShapeSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(ActionShape.DomainClassId, typeof(ActionShapeSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(Trigger.DomainClassId, typeof(TriggerSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(Listener.DomainClassId, typeof(ListenerSerializer)));
+					HLSimSerializationBehavior.serializerTypes.Add(new DslModeling::DomainXmlSerializerDirectoryEntry(HLSimDiagram.DomainClassId, typeof(HLSimDiagramSerializer)));
+					#endregion
+					
+					// Custom ones
+					if (customSerializerCount > 0)
+					{
+						HLSimSerializationBehavior.serializerTypes.AddRange(customSerializerTypes);
+					}
+				}
+				return HLSimSerializationBehavior.serializerTypes.AsReadOnly();
+			}
+		}
+		
+		/// <summary>
+		/// This provides a mapping from xml namespaces to domain model implementation types.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]	// Will trigger creation otherwise.
+		//[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]		
+		public override global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainXmlSerializerNamespaceEntry> AllNamespaces
+		{
+			get
+			{
+				if (HLSimSerializationBehavior.namespaceEntries == null)
+				{
+					HLSimSerializationBehavior.namespaceEntries = new global::System.Collections.Generic.List<DslModeling::DomainXmlSerializerNamespaceEntry>();
+					HLSimSerializationBehavior.namespaceEntries.Add(new DslModeling::DomainXmlSerializerNamespaceEntry(DomainModelXmlNamespace, typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel)));
+				}
+				return HLSimSerializationBehavior.namespaceEntries.AsReadOnly();
+			}
+		}
+		
+		#endregion
+	}
+	
+	/// <summary>
+	/// A DomainXmlSerializationBehavior implementation for defined behavior HLSimSerializationBehavior.
+	/// This is the concrete type of the double-derived implementation.
+	/// </summary>
+	public sealed partial class HLSimSerializationBehavior : HLSimSerializationBehaviorBase
+	{
+		#region Singleton Instance
+		/// <summary>
+		/// Singleton instance.
+		/// </summary>
+		private static HLSimSerializationBehavior instance;
+	
+		/// <summary>
+		/// Singleton instance.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]	// Will trigger creation otherwise.
+		public static HLSimSerializationBehavior Instance
+		{
+			get
+			{	// No need for synchronization. Most likely running in single-thread environment, and creating an extra instance
+				// doesn't really hurt.
+				if (HLSimSerializationBehavior.instance == null)
+					HLSimSerializationBehavior.instance = new HLSimSerializationBehavior ();
+				return HLSimSerializationBehavior.instance;
+			}
+		}
+	
+		/// <summary>
+		/// Private constructor to prevent public instantiation.
+		/// </summary>
+		private HLSimSerializationBehavior() : base() { }
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Moniker resolver for serialization behavior HLSimSerializationBehavior.
+	/// </summary>
+	public partial class HLSimSerializationBehaviorMonikerResolver : HLSimSerializationBehaviorMonikerResolverBase
+	{
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		/// <param name="store">Store for this moniker resolver.</param>
+		/// <param name="directory">Directory to used by this resolver to look up for serializers.</param>
+		public HLSimSerializationBehaviorMonikerResolver(DslModeling::Store store, DslModeling::DomainXmlSerializerDirectory directory)
+			: base(store,directory)
+		{
+		}
+	}
+	
+	/// <summary>
+	/// Base moniker resolver for serialization behavior HLSimSerializationBehavior.
+	/// </summary>
+	public partial class HLSimSerializationBehaviorMonikerResolverBase : DslModeling::SimpleMonikerResolver
+	{
+		#region Member Variables
+		/// <summary>
+		/// Look-up directory to find serializers for domain classes.
+		/// </summary>
+		private DslModeling::DomainXmlSerializerDirectory directory;
+		#endregion
+	
+		#region Constructor
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		/// <param name="store">Store for this moniker resolver.</param>
+		/// <param name="directory">Directory to used by this resolver to look up for serializers.</param>
+		public HLSimSerializationBehaviorMonikerResolverBase(DslModeling::Store store, DslModeling::DomainXmlSerializerDirectory directory)
+			: base (store)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(directory != null);
+			if (directory == null)
+				throw new global::System.ArgumentNullException("directory");
+			#endregion
+	
+			this.directory = directory;
+		}
+		#endregion
+	
+		#region Base Overrides
+		/// <summary>
+		/// Tells if a DomainClass can be monikerized or not.
+		/// </summary>
+		/// <param name="domainClassInfo">DomainClassInfo of the DomainClass to be checked.</param>
+		/// <returns>True if the DomainClass can be monikerized, false otherwise.</returns>
+		protected override bool CanBeMonikerized(DslModeling::DomainClassInfo domainClassInfo)
+		{
+			if (this.IsDisposed || this.directory == null || domainClassInfo == null)
+				return false;
+				
+			DslModeling::DomainClassXmlSerializer serializer = this.directory.GetSerializer(domainClassInfo.Id);
+			if (serializer != null)
+				return (!string.IsNullOrEmpty(serializer.MonikerTagName));
+			return false;
+		}
+			
+		/// <summary>
+		/// Calculate the fully qualified monikerized string of the given ModelElement.
+		/// </summary>
+		/// <param name="mel">ModelElement to get moniker from.</param>
+		/// <returns>Calculated moniker string, returns null or empty string is the given ModelElement cannot be monikerized.</returns>
+		protected override string CalculateQualifiedName(DslModeling::ModelElement mel)
+		{
+			if (this.IsDisposed || this.directory == null || mel == null)
+				return string.Empty;
+	
+			string result = string.Empty;
+			DslModeling::DomainClassXmlSerializer serializer = this.directory.GetSerializer(mel.GetDomainClass().Id);
+			if (serializer != null)
+				result = serializer.CalculateQualifiedName(this.directory, mel);
+			return result;
+		}
+		
+		/// <summary>
+		/// Called at the end of synchronization when they're unresolved monikers.
+		/// </summary>
+		/// <param name="serializationResult">SerializationResult to store error/warning messages.</param>
+		/// <param name="moniker">Unresolved moniker.</param>
+		protected override void OnUnresolvedMoniker(DslModeling::SerializationResult serializationResult, DslModeling::Moniker moniker)
+		{
+			if (serializationResult != null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.UnresolvedMoniker(serializationResult, moniker);
+			}
+		}
+		
+		/// <summary>
+		/// Called when resolving a moniker causes a duplicate link to be created.
+		/// </summary>
+		/// <param name="serializationResult">SerializationResult to store error/warning messages.</param>
+		/// <param name="moniker">Moniker that causes duplicate link to be created.</param>
+		protected override void OnMonikerResolvedToDuplicateLink(DslModeling::SerializationResult serializationResult, DslModeling::Moniker moniker)
+		{
+			if (serializationResult != null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.MonikerResolvedToDuplicateLink(serializationResult, moniker);
+			}
+			base.OnMonikerResolvedToDuplicateLink(serializationResult, moniker);
+		}
+		
+		/// <summary>
+		/// Called when two new elements are giving the same moniker, which will cause ambiguity during moniker resolution.
+		/// </summary>
+		/// <param name="context">SerializationContext to store error/warning messages.</param>
+		/// <param name="moniker">Moniker that both elements give.</param>
+		/// <param name="element1">The first element giving the moniker.</param>
+		/// <param name="element2">The second element giving the same moniker.</param>
+		protected override void OnAmbiguousMoniker(DslModeling::SerializationContext context, string moniker, DslModeling::ModelElement element1, DslModeling::ModelElement element2)
+		{
+			if (context != null)
+			{
+				HLSimSerializationBehaviorSerializationMessages.AmbiguousMoniker(context, moniker, element1, element2);
+			}
+			base.OnAmbiguousMoniker(context, moniker, element1, element2);
+		}
+		
+		/// <summary>
+		/// Error message for UnresolvedMonikerException.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerBrowsable(global::System.Diagnostics.DebuggerBrowsableState.Never)]
+		protected override string UnresolvedMonikerExceptionMessage
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return HLSimSerializationBehaviorSerializationMessages.ResourceManager.GetString("CannotOpenDocument"); }
+		}
+		#endregion
+	}
+}
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Utility class to provide serialization messages
+	/// </summary>
+	public static partial class HLSimSerializationBehaviorSerializationMessages
+	{
+		/// <summary>
+		/// ResourceManager to get serialization messages from.
+		/// </summary>
+		[global::System.Diagnostics.DebuggerBrowsable(global::System.Diagnostics.DebuggerBrowsableState.Never)] // Will trigger creation otherwise.
+		public static global::System.Resources.ResourceManager ResourceManager
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return HLSimDomainModel.SingletonResourceManager; }
+		}
+	
+		#region Warnings
+		/// <summary>
+		/// Add a warning for ambiguous schemas.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="targetNamespace">Target namespace to be resolved.</param>
+		/// <param name="schemaPath">The schema that is used to resolve the definition of the target namespace.</param>
+		public static void AmbiguousSchema(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string targetNamespace, string schemaPath)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(targetNamespace));
+			if (string.IsNullOrEmpty(targetNamespace))
+				throw new global::System.ArgumentNullException("targetNamespace");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(schemaPath));
+			if (string.IsNullOrEmpty(schemaPath))
+				throw new global::System.ArgumentNullException("schemaPath");
+			#endregion
+	
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("AmbiguousSchema"),
+					targetNamespace,
+					schemaPath
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add a warning when a full-form relationship seems to be serialized in short-form.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="relationshipType">Type of the relationship.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "This is the type of the relationship, making it MemberInfo only adds confusion.")]
+		public static void ExpectingFullFormRelationship(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, global::System.Type relationshipType)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(relationshipType != null);
+			if (relationshipType == null)
+				throw new global::System.ArgumentNullException("relationshipType");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("ExpectingFullFormRelationship"),
+					reader.Name,
+					relationshipType.Name
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add a warning when a short-form relationship seems to be serialized in full-form.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="relationshipType">Type of the relationship.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "This is the type of the relationship, making it MemberInfo only adds confusion.")]
+		public static void ExpectingShortFormRelationship(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, global::System.Type relationshipType)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(relationshipType != null);
+			if (relationshipType == null)
+				throw new global::System.ArgumentNullException("relationshipType");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("ExpectingShortFormRelationship"),
+					relationshipType.Name
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add a warning for invalid property value with the given type, which will be ignored.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="propertyName">Name of the property.</param>
+		/// <param name="propertyType">Type of the property.</param>
+		/// <param name="value">Invalid value that causes this warning.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "This is the type of the property, making it MemberInfo only adds confusion.")]
+		public static void IgnoredPropertyValue(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string propertyName, global::System.Type propertyType, string value)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(propertyType != null);
+			if (propertyType == null)
+				throw new global::System.ArgumentNullException("propertyType");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(propertyName));
+			if (string.IsNullOrEmpty(propertyName))
+				throw new global::System.ArgumentNullException("propertyName");
+			#endregion
+			
+			if (value == null)
+				value = "<null>";
+	
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("IgnoredPropertyValue"),
+					value,
+					propertyName,
+					propertyType.Name
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add a warning for missing "Id" property.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="newId">Auto-generated new Id.</param>
+		public static void MissingId(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, global::System.Guid newId)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("MissingId"),
+					newId.ToString("D", global::System.Globalization.CultureInfo.CurrentCulture)
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+			
+		/// <summary>
+		/// Add an warning for moniker resolved to duplicate link. The moniker will be ignored.
+		/// </summary>
+		/// <param name="serializationResult">SerializationResult to add the error message to.</param>
+		/// <param name="moniker">Offending moniker.</param>
+		public static void MonikerResolvedToDuplicateLink(DslModeling::SerializationResult serializationResult, DslModeling::Moniker moniker)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationResult != null);
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			global::System.Diagnostics.Debug.Assert(moniker != null);
+			if (moniker == null)
+				throw new global::System.ArgumentNullException("moniker");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationResult,
+				moniker.Location,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("MonikerResolvedToDuplicateLink"),
+					moniker.MonikerName
+				),
+				moniker.Line,
+				moniker.Column
+			);
+		}
+		
+		/// <summary>
+		/// Add a warning for no schema found for the given target namespace, schema validation will be skipped in this case.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="targetNamespace">Target namespace that cannot be resolved.</param>
+		public static void NoSchema(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string targetNamespace)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(targetNamespace));
+			if (string.IsNullOrEmpty(targetNamespace))
+				throw new global::System.ArgumentNullException("targetNamespace");
+			#endregion
+	
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("NoSchema"),
+					targetNamespace
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add a warning for schema validation error.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="message">Validation message reported from schema validation.</param>
+		public static void SchemaValidationError(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string message)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(message));
+			if (string.IsNullOrEmpty(message))
+				throw new global::System.ArgumentNullException("message");
+			#endregion
+	
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				message,
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add an warning for unexpected XML element.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the warning message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		public static void UnexpectedXmlElement(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			#endregion
+				
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Warning,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("UnexpectedXmlElement"),
+					reader.Name
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		#endregion
+	
+		#region Errors
+		/// <summary>
+		/// Add an error for ambiguous moniker.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the error message to.</param>
+		/// <param name="moniker">The ambiguous moniker string.</param>
+		/// <param name="element1">The first element using the given moniker.</param>
+		/// <param name="element2">The second element using the given moniker.</param>
+		public static void AmbiguousMoniker(DslModeling::SerializationContext serializationContext, string moniker, DslModeling::ModelElement element1, DslModeling::ModelElement element2)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(moniker != null);
+			if (moniker == null)
+				throw new global::System.ArgumentNullException("moniker");
+			global::System.Diagnostics.Debug.Assert(element1 != null);
+			if (element1 == null)
+				throw new global::System.ArgumentNullException("element1");
+			global::System.Diagnostics.Debug.Assert(element2 != null);
+			if (element2 == null)
+				throw new global::System.ArgumentNullException("element2");
+			#endregion
+	
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("AmbiguousMoniker"),
+					moniker,
+					DslModeling::SerializationUtilities.GetElementName(element1),
+					DslModeling::SerializationUtilities.GetElementName(element2)
+				),
+				null	// No location info available
+			);
+		}
+		
+		/// <summary>
+		/// Add an error for not able to monikerize an instance of the given DomainClass.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the error message to.</param>
+		/// <param name="domainClassName">Name of the DomainClass whose instance cannot be monikerized.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Generated code.")]	
+		public static void CannotMonikerizeElement(DslModeling::SerializationContext serializationContext, string domainClassName)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(domainClassName));
+			if (string.IsNullOrEmpty(domainClassName))
+				throw new global::System.ArgumentNullException("domainClassName");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext.Result,
+				null,	/* no location available for this error, because save failed. */
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("CannotMonikerizeElement"),
+					domainClassName
+				),
+				0,
+				0
+			);
+		}
+		
+		/// <summary>
+		/// Add an error for dangling relationship instance.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the error message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="relationshipType">Type name of the relationship.</param>
+		public static void DanglingRelationship(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string relationshipType)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(relationshipType));
+			if (string.IsNullOrEmpty(relationshipType))
+				throw new global::System.ArgumentNullException("relationshipType");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("DanglingRelationship"),
+					relationshipType
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add an error for invalid property value with given type.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the error message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="propertyName">Name of the property.</param>
+		/// <param name="propertyType">Type of the property.</param>
+		/// <param name="value">Invalid value that causes this error.</param>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "This is the type of the property, making it MemberInfo only adds confusion.")]
+		public static void InvalidPropertyValue(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string propertyName, global::System.Type propertyType, string value)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(propertyType != null);
+			if (propertyType == null)
+				throw new global::System.ArgumentNullException("propertyType");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(propertyName));
+			if (string.IsNullOrEmpty(propertyName))
+				throw new global::System.ArgumentNullException("propertyName");
+			#endregion
+			
+			if (value == null)
+				value = "<null>";
+	
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("InvalidPropertyValue"),
+					value,
+					propertyName,
+					propertyType.Name
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add an error for missing moniker.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the error message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="monikerAttributeName">Name of the attribute that should hold the moniker.</param>
+		public static void MissingMoniker(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, string monikerAttributeName)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(monikerAttributeName));
+			if (string.IsNullOrEmpty(monikerAttributeName))
+				throw new global::System.ArgumentNullException("monikerAttributeName");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("MissingMoniker"),
+					monikerAttributeName
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		
+		/// <summary>
+		/// Add an error for unresolved moniker.
+		/// </summary>
+		/// <param name="serializationResult">SerializationResult to add the error message to.</param>
+		/// <param name="moniker">Unresolved moniker.</param>
+		public static void UnresolvedMoniker(DslModeling::SerializationResult serializationResult, DslModeling::Moniker moniker)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationResult != null);
+			if (serializationResult == null)
+				throw new global::System.ArgumentNullException("serializationResult");
+			global::System.Diagnostics.Debug.Assert(moniker != null);
+			if (moniker == null)
+				throw new global::System.ArgumentNullException("moniker");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationResult,
+				moniker.Location,
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("UnresolvedMoniker"),
+					moniker.MonikerName
+				),
+				moniker.Line,
+				moniker.Column
+			);
+		}
+	
+		/// <summary>
+		/// Add an error for Version mismatch.
+		/// </summary>
+		/// <param name="serializationContext">SerializationContext to add the error message to.</param>
+		/// <param name="reader">The reader pointing to where the message is raised.</param>
+		/// <param name="expectedVersion">The version that's expected.</param>
+		/// <param name="actualVersion">Actual version from the file.</param>
+		public static void VersionMismatch(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, global::System.Version expectedVersion, global::System.Version actualVersion)
+		{
+			#region Check Parameters
+			global::System.Diagnostics.Debug.Assert(serializationContext != null);
+			if (serializationContext == null)
+				throw new global::System.ArgumentNullException("serializationContext");
+			global::System.Diagnostics.Debug.Assert(reader != null);
+			if (reader == null)
+				throw new global::System.ArgumentNullException("reader");
+			global::System.Diagnostics.Debug.Assert(expectedVersion != null);
+			if (expectedVersion == null)
+				throw new global::System.ArgumentNullException("expectedVersion");
+			global::System.Diagnostics.Debug.Assert(actualVersion != null);
+			if (actualVersion == null)
+				throw new global::System.ArgumentNullException("actualVersion");
+			#endregion
+			
+			DslModeling::SerializationUtilities.AddMessage(
+				serializationContext,
+				DslModeling::SerializationMessageKind.Error,
+				string.Format(
+					global::System.Globalization.CultureInfo.CurrentCulture,
+					ResourceManager.GetString("VersionMismatch"), 
+					actualVersion.ToString(4), 
+					expectedVersion.ToString(4)
+				),
+				reader as global::System.Xml.IXmlLineInfo
+			);
+		}
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Provides an implementation of the IDomainModelSerializer interface
+	/// that can be used to serialize / deserialize the HLSim domain model.
+	/// </summary>
+	/// <remarks>Double-derived class - the default implementation is in HLSimDomainModelSerializerBase.
+	/// This class exist so users can customize behavior easily.</remarks>
+	[global::System.ComponentModel.Composition.Export(typeof(DslModeling::IDomainModelSerializer))]
+	[DslModeling::DomainModelSerializer(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), global::HeuristicLab.SimulationCore.HLSimSerializationBehavior.DomainModelXmlNamespace, "hlsim")]
+	public partial class HLSimDomainModelSerializer : HLSimDomainModelSerializerBase
+	{
+	}
+	
+	
+	/// <summary>
+	/// Base class that implements IDomainModelSerializer
+	/// </summary>
+	public abstract partial class HLSimDomainModelSerializerBase : DslModeling::IDomainModelSerializer
+	{
+	
+		#region Public properties
+	
+		/// <summary>
+		/// The XML namespace used when serializing the domain model
+		/// </summary>
+		public virtual string DomainModelNamespace
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return global::HeuristicLab.SimulationCore.HLSimSerializationBehavior.DomainModelXmlNamespace; }
+		}
+	
+		/// <summary>
+		/// Returns true: this DSL can be serialized / deserialized directly.
+		/// </summary>
+		public virtual bool IsSerializable
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return true; }
+		}
+	
+		/// <summary>
+		/// The type of the domain model
+		/// </summary>
+		public virtual global::System.Type DomainModelType
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel); }
+		}
+	
+		/// <summary>
+		/// File extension used for model files of this kind of domain model
+		/// </summary>
+		/// <remarks>If a domain model type cannot be serialized independently, or cannot
+		/// be serialized to a file, it should return null or empty.</remarks>
+		public string ModelFileExtension
+		{
+			[global::System.Diagnostics.DebuggerStepThrough]
+			get { return "hlsim"; }
+		}
+	
+		#endregion
+		
+		
+		#region Load / Save model methods
+		
+		/// <summary>
+		/// Loads a SimulationModel instance and its associated diagram file.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
+		/// <param name="partition">Partition in which the new SimulationModel instance will be created.</param>
+		/// <param name="fileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="serializerLocator">Used to locate any additional domain model types required to load the model. Can be null.</param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		public virtual DslModeling::ModelElement LoadModel(DslModeling::SerializationResult serializationResult, 
+			DslModeling::Partition partition, 
+			string fileName, 
+			DslModeling::ISerializerLocator serializerLocator)
+		{
+			if (serializationResult == null) { throw new global::System.ArgumentNullException("serializationResult"); }
+			if (partition == null) { throw new global::System.ArgumentNullException("partition"); }
+			if (string.IsNullOrEmpty(fileName)) { throw new global::System.ArgumentNullException("fileName"); }
+	
+			return HLSimSerializationHelper.Instance.LoadModel(serializationResult, partition, fileName, null, null, serializerLocator);
+		}
+	
+		/// <summary>
+		/// Saves the given model root to the given file, with specified encoding.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="fileName">Name of the file in which the SimulationModel instance will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the SimulationModel instance.</param>
+		public void SaveModel(DslModeling::SerializationResult serializationResult, 
+			DslModeling::ModelElement modelRoot, 
+			string fileName, 
+			System.Text.Encoding encoding)
+		{
+			if (serializationResult == null) { throw new global::System.ArgumentNullException("serializationResult"); }
+			if (modelRoot == null) { throw new global::System.ArgumentNullException("modelRoot"); }
+			if (string.IsNullOrEmpty("fileName")) { throw new global::System.ArgumentNullException("fileName"); }
+	
+			global::HeuristicLab.SimulationCore.SimulationModel rootElement = modelRoot as global::HeuristicLab.SimulationCore.SimulationModel;
+			if (rootElement == null)
+			{
+				string errorMessage = string.Format(global::System.Globalization.CultureInfo.CurrentCulture,
+					global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("InvalidSaveRootElementType"),
+					modelRoot.GetType().ToString());
+	
+				throw new global::System.ArgumentException(errorMessage, "modelRoot");
+	
+			}
+	
+			HLSimSerializationHelper.Instance.SaveModel(serializationResult, rootElement, fileName,encoding, true);
+		}
+	
+		#endregion
+	
+		#region Load / Save model and diagram methods
+	
+		/// <summary>
+		/// Calculates and returns the name of the diagram file for the specified model file
+		/// </summary>
+		/// <param name="modelFileName">The relevant model file name</param>
+		/// <returns>Name of the associated diagram file</returns>
+		/// <remarks>There is no guarantee that either the model file or the calculated diagram file exist.</remarks>
+		public virtual string CalculateDiagramFileName(string modelFileName)
+		{
+			if (string.IsNullOrEmpty(modelFileName))
+			{
+				throw new global::System.ArgumentNullException("modelFileName");
+			}
+			return modelFileName + ".diagram";
+		}
+	
+		/// <summary>
+		/// Loads a SimulationModel instance and its associated diagram file.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
+		/// <param name="modelPartition">Partition in which the new SimulationModel instance will be created.</param>
+		/// <param name="modelFileName">Name of the file from which the SimulationModel instance will be deserialized.</param>
+		/// <param name="diagramPartition">Partition in which the new HLSimDiagram instance will be created.</param>
+		/// <param name="diagramFileName">Name of the file from which the HLSimDiagram instance will be deserialized.</param>
+		/// <param name="serializerLocator">Used to locate any additional domain model types required to load the model. Can be null.</param>
+		/// <returns>The loaded SimulationModel instance.</returns>
+		public DslModeling::ModelElement LoadModelAndDiagram(DslModeling::SerializationResult serializationResult, 
+			DslModeling::Partition modelPartition, 
+			string modelFileName, 
+			DslModeling::Partition diagramPartition, 
+			string diagramFileName, 
+			DslModeling::ISerializerLocator serializerLocator)
+		{
+			if (serializationResult == null) { throw new global::System.ArgumentNullException("serializationResult"); }
+			if (modelPartition == null) { throw new global::System.ArgumentNullException("modelPartition"); }
+			if (string.IsNullOrEmpty(modelFileName)) { throw new global::System.ArgumentNullException("modelFileName"); }
+			if (diagramPartition == null) { throw new global::System.ArgumentNullException("diagramPartition"); }
+			if (string.IsNullOrEmpty(diagramFileName)) { throw new global::System.ArgumentNullException("diagramFileName"); }
+	
+			return HLSimSerializationHelper.Instance.LoadModelAndDiagram(serializationResult, modelPartition, modelFileName, diagramPartition, diagramFileName, null, null, serializerLocator);
+		}
+	
+		/// <summary>
+		/// Saves the given SimulationModel and HLSimDiagram to the given files, with specified encoding.
+		/// </summary>
+		/// <param name="serializationResult">Stores serialization result from the save operation.</param>
+		/// <param name="modelRoot">SimulationModel instance to be saved.</param>
+		/// <param name="modelFileName">Name of the file in which the CanonicalSampleRoot instance will be saved.</param>
+		/// <param name="diagram">HLSimDiagram to be saved.</param>
+		/// <param name="diagramFileName">Name of the file in which the diagram will be saved.</param>
+		/// <param name="encoding">Encoding to use when saving the diagram.</param>
+		public void SaveModelAndDiagram(DslModeling::SerializationResult serializationResult, 
+			DslModeling::ModelElement modelRoot, 
+			string modelFileName, 
+			DslModeling::ModelElement diagram, 
+			string diagramFileName, 
+			System.Text.Encoding encoding)
+		{
+			if (serializationResult == null) { throw new global::System.ArgumentNullException("serializationResult"); }
+			if (modelRoot == null) { throw new global::System.ArgumentNullException("modelRoot"); }
+			if (string.IsNullOrEmpty("modelFileName")) { throw new global::System.ArgumentNullException("modelFileName"); }
+			if (diagram == null) { throw new global::System.ArgumentNullException("diagram"); }
+			if (string.IsNullOrEmpty("diagramFileName")) { throw new global::System.ArgumentNullException("diagramFileName"); }
+	
+			global::HeuristicLab.SimulationCore.SimulationModel typedRoot = modelRoot as global::HeuristicLab.SimulationCore.SimulationModel;
+			if (typedRoot == null)
+			{
+				string errorMessage = string.Format(global::System.Globalization.CultureInfo.CurrentCulture,
+					global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("InvalidSaveRootElementType"),
+					modelRoot.GetType().ToString());
+	
+				throw new global::System.ArgumentException(errorMessage, "modelRoot");
+			}
+			global::HeuristicLab.SimulationCore.HLSimDiagram typedDiagram = diagram as global::HeuristicLab.SimulationCore.HLSimDiagram;
+			if (typedDiagram == null)
+			{
+				string errorMessage = string.Format(global::System.Globalization.CultureInfo.CurrentCulture,
+					global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("InvalidSaveDiagramType"),
+					diagram.GetType().ToString());
+	
+				throw new global::System.ArgumentException(errorMessage, "diagram");
+			}
+	
+			HLSimSerializationHelper.Instance.SaveModelAndDiagram(serializationResult, typedRoot, modelFileName, typedDiagram, diagramFileName, encoding, true);
+		}
+	
+		#endregion
+		
+	}
+}
+
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Serializer.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Serializer.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Serializer.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ include file="Dsl\DomainSerializer.tt" #>
+<#@ Dsl processor="DslDirectiveProcessor"  requires="fileName='..\DslDefinition.dsl'" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.cs	(revision 10525)
@@ -0,0 +1,483 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass ActivityShape
+	/// Description for HeuristicLab.SimulationCore.ActivityShape
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActivityShape.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActivityShape.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainObjectId("9aa624f1-2625-4cc3-b759-7070505f1a8b")]
+	public partial class ActivityShape : DslDiagrams::NodeShape
+	{
+		#region DiagramElement boilerplate
+		private static DslDiagrams::StyleSet classStyleSet;
+		private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
+		private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;
+		
+		/// <summary>
+		/// Per-class style set for this shape.
+		/// </summary>
+		protected override DslDiagrams::StyleSet ClassStyleSet
+		{
+			get
+			{
+				if (classStyleSet == null)
+				{
+					classStyleSet = CreateClassStyleSet();
+				}
+				return classStyleSet;
+			}
+		}
+		
+		/// <summary>
+		/// Per-class ShapeFields for this shape.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
+		{
+			get
+			{
+				if (shapeFields == null)
+				{
+					shapeFields = CreateShapeFields();
+				}
+				return shapeFields;
+			}
+		}
+		
+		/// <summary>
+		/// Event fired when decorator initialization is complete for this shape type.
+		/// </summary>
+		public static event global::System.EventHandler DecoratorsInitialized;
+		
+		/// <summary>
+		/// List containing decorators used by this type.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
+		{
+			get 
+			{
+				if(decorators == null)
+				{
+					decorators = CreateDecorators();
+					
+					// fire this event to allow the diagram to initialize decorator mappings for this shape type.
+					if(DecoratorsInitialized != null)
+					{
+						DecoratorsInitialized(this, global::System.EventArgs.Empty);
+					}
+				}
+				
+				return decorators; 
+			}
+		}
+		
+		/// <summary>
+		/// Finds a decorator associated with ActivityShape.
+		/// </summary>
+		public static DslDiagrams::Decorator FindActivityShapeDecorator(string decoratorName)
+		{	
+			if(decorators == null) return null;
+			return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
+		}
+		
+		
+		/// <summary>
+		/// Shape instance initialization.
+		/// </summary>
+		public override void OnInitialize()
+		{
+			base.OnInitialize();
+			
+			// Create host shapes for outer decorators.
+			foreach(DslDiagrams::Decorator decorator in this.Decorators)
+			{
+				if(decorator.RequiresHost)
+				{
+					decorator.ConfigureHostShape(this);
+				}
+			}
+			
+		}
+		#endregion
+		#region Shape size
+		
+		/// <summary>
+		/// Default size for this shape.
+		/// </summary>
+		public override DslDiagrams::SizeD DefaultSize
+		{
+			get
+			{
+				return new DslDiagrams::SizeD(1.62, 1);
+			}
+		}
+		#endregion
+		#region Shape styles
+		/// <summary>
+		/// Initializes style set resources for this shape type
+		/// </summary>
+		/// <param name="classStyleSet">The style set for this shape class</param>
+		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.DarkKhaki);
+			classStyleSet.OverrideBrush(DslDiagrams::DiagramBrushes.ShapeBackground, backgroundBrush);
+		
+		}
+		
+		/// <summary>
+		/// Indicates whether this shape displays a background gradient.
+		/// </summary>
+		public override bool HasBackgroundGradient
+		{
+			get
+			{
+				return true;
+			}
+		}
+		
+		/// <summary>
+		/// Indicates the direction of the gradient.
+		/// </summary>
+		public override global::System.Drawing.Drawing2D.LinearGradientMode BackgroundGradientMode
+		{
+			get
+			{
+				return global::System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
+			}
+		}
+		/// <summary>
+		/// Specifies the geometry used by this shape
+		/// </summary>
+		public override DslDiagrams::ShapeGeometry ShapeGeometry
+		{
+			get
+			{
+				return DslDiagrams::ShapeGeometries.RoundedRectangle;
+			}
+		}
+		#endregion
+		#region Decorators
+		/// <summary>
+		/// Initialize the collection of shape fields associated with this shape type.
+		/// </summary>
+		protected override void InitializeShapeFields(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields)
+		{
+			base.InitializeShapeFields(shapeFields);
+			DslDiagrams::TextField field1 = new DslDiagrams::TextField("NameDecorator");
+			field1.DefaultText = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("ActivityShapeNameDecoratorDefaultText");
+			field1.DefaultFocusable = true;
+			field1.DefaultAutoSize = true;
+			field1.AnchoringBehavior.MinimumHeightInLines = 1;
+			field1.AnchoringBehavior.MinimumWidthInCharacters = 1;
+			field1.DefaultAccessibleState = global::System.Windows.Forms.AccessibleStates.Invisible;
+			shapeFields.Add(field1);
+			
+		}
+		
+		/// <summary>
+		/// Initialize the collection of decorators associated with this shape type.  This method also
+		/// creates shape fields for outer decorators, because these are not part of the shape fields collection
+		/// associated with the shape, so they must be created here rather than in InitializeShapeFields.
+		/// </summary>
+		protected override void InitializeDecorators(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields, global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators)
+		{
+			base.InitializeDecorators(shapeFields, decorators);
+			
+			DslDiagrams::ShapeField field1 = DslDiagrams::ShapeElement.FindShapeField(shapeFields, "NameDecorator");
+			DslDiagrams::Decorator decorator1 = new DslDiagrams::ShapeDecorator(field1, DslDiagrams::ShapeDecoratorPosition.InnerTopLeft, DslDiagrams::PointD.Empty);
+			decorators.Add(decorator1);
+				
+		}
+		
+		/// <summary>
+		/// Ensure outer decorators are placed appropriately.  This is called during view fixup,
+		/// after the shape has been associated with the model element.
+		/// </summary>
+		public override void OnBoundsFixup(DslDiagrams::BoundsFixupState fixupState, int iteration, bool createdDuringViewFixup)
+		{
+			base.OnBoundsFixup(fixupState, iteration, createdDuringViewFixup);
+			
+			if(iteration == 0)
+			{
+				foreach(DslDiagrams::Decorator decorator in this.Decorators)
+				{
+					if(decorator.RequiresHost)
+					{
+						decorator.RepositionHostShape(decorator.GetHostShape(this));
+					}
+				}
+			}
+		}
+		#endregion
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// ActivityShape domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x9aa624f1, 0x2625, 0x4cc3, 0xb7, 0x59, 0x70, 0x70, 0x50, 0x5f, 0x1a, 0x8b);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public ActivityShape(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public ActivityShape(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+	}
+}
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// DomainClass ActionShape
+	/// Description for HeuristicLab.SimulationCore.ActionShape
+	/// </summary>
+	[DslDesign::DisplayNameResource("HeuristicLab.SimulationCore.ActionShape.DisplayName", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslDesign::DescriptionResource("HeuristicLab.SimulationCore.ActionShape.Description", typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel), "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx")]
+	[DslModeling::DomainModelOwner(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel))]
+	[global::System.CLSCompliant(true)]
+	[DslModeling::DomainObjectId("25205757-e7e3-4310-b3c8-e4b85c91b152")]
+	public partial class ActionShape : DslDiagrams::NodeShape
+	{
+		#region DiagramElement boilerplate
+		private static DslDiagrams::StyleSet classStyleSet;
+		private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
+		private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;
+		
+		/// <summary>
+		/// Per-class style set for this shape.
+		/// </summary>
+		protected override DslDiagrams::StyleSet ClassStyleSet
+		{
+			get
+			{
+				if (classStyleSet == null)
+				{
+					classStyleSet = CreateClassStyleSet();
+				}
+				return classStyleSet;
+			}
+		}
+		
+		/// <summary>
+		/// Per-class ShapeFields for this shape.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
+		{
+			get
+			{
+				if (shapeFields == null)
+				{
+					shapeFields = CreateShapeFields();
+				}
+				return shapeFields;
+			}
+		}
+		
+		/// <summary>
+		/// Event fired when decorator initialization is complete for this shape type.
+		/// </summary>
+		public static event global::System.EventHandler DecoratorsInitialized;
+		
+		/// <summary>
+		/// List containing decorators used by this type.
+		/// </summary>
+		public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
+		{
+			get 
+			{
+				if(decorators == null)
+				{
+					decorators = CreateDecorators();
+					
+					// fire this event to allow the diagram to initialize decorator mappings for this shape type.
+					if(DecoratorsInitialized != null)
+					{
+						DecoratorsInitialized(this, global::System.EventArgs.Empty);
+					}
+				}
+				
+				return decorators; 
+			}
+		}
+		
+		/// <summary>
+		/// Finds a decorator associated with ActionShape.
+		/// </summary>
+		public static DslDiagrams::Decorator FindActionShapeDecorator(string decoratorName)
+		{	
+			if(decorators == null) return null;
+			return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
+		}
+		
+		
+		/// <summary>
+		/// Shape instance initialization.
+		/// </summary>
+		public override void OnInitialize()
+		{
+			base.OnInitialize();
+			
+			// Create host shapes for outer decorators.
+			foreach(DslDiagrams::Decorator decorator in this.Decorators)
+			{
+				if(decorator.RequiresHost)
+				{
+					decorator.ConfigureHostShape(this);
+				}
+			}
+			
+		}
+		#endregion
+		#region Shape size
+		
+		/// <summary>
+		/// Default size for this shape.
+		/// </summary>
+		public override DslDiagrams::SizeD DefaultSize
+		{
+			get
+			{
+				return new DslDiagrams::SizeD(0.75, 0.75);
+			}
+		}
+		#endregion
+		#region Shape styles
+		/// <summary>
+		/// Initializes style set resources for this shape type
+		/// </summary>
+		/// <param name="classStyleSet">The style set for this shape class</param>
+		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.IndianRed);
+			classStyleSet.OverrideBrush(DslDiagrams::DiagramBrushes.ShapeBackground, backgroundBrush);
+		
+		}
+		
+		/// <summary>
+		/// Specifies the geometry used by this shape
+		/// </summary>
+		public override DslDiagrams::ShapeGeometry ShapeGeometry
+		{
+			get
+			{
+				return DslDiagrams::ShapeGeometries.Circle;
+			}
+		}
+		#endregion
+		#region Decorators
+		/// <summary>
+		/// Initialize the collection of shape fields associated with this shape type.
+		/// </summary>
+		protected override void InitializeShapeFields(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields)
+		{
+			base.InitializeShapeFields(shapeFields);
+			DslDiagrams::TextField field1 = new DslDiagrams::TextField("NameDecorator");
+			field1.DefaultText = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("ActionShapeNameDecoratorDefaultText");
+			field1.DefaultFocusable = true;
+			field1.DefaultAutoSize = true;
+			field1.AnchoringBehavior.MinimumHeightInLines = 1;
+			field1.AnchoringBehavior.MinimumWidthInCharacters = 1;
+			field1.DefaultAccessibleState = global::System.Windows.Forms.AccessibleStates.Invisible;
+			shapeFields.Add(field1);
+			
+		}
+		
+		/// <summary>
+		/// Initialize the collection of decorators associated with this shape type.  This method also
+		/// creates shape fields for outer decorators, because these are not part of the shape fields collection
+		/// associated with the shape, so they must be created here rather than in InitializeShapeFields.
+		/// </summary>
+		protected override void InitializeDecorators(global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields, global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators)
+		{
+			base.InitializeDecorators(shapeFields, decorators);
+			
+			DslDiagrams::ShapeField field1 = DslDiagrams::ShapeElement.FindShapeField(shapeFields, "NameDecorator");
+			DslDiagrams::Decorator decorator1 = new DslDiagrams::ShapeDecorator(field1, DslDiagrams::ShapeDecoratorPosition.InnerTopLeft, DslDiagrams::PointD.Empty);
+			decorators.Add(decorator1);
+				
+		}
+		
+		/// <summary>
+		/// Ensure outer decorators are placed appropriately.  This is called during view fixup,
+		/// after the shape has been associated with the model element.
+		/// </summary>
+		public override void OnBoundsFixup(DslDiagrams::BoundsFixupState fixupState, int iteration, bool createdDuringViewFixup)
+		{
+			base.OnBoundsFixup(fixupState, iteration, createdDuringViewFixup);
+			
+			if(iteration == 0)
+			{
+				foreach(DslDiagrams::Decorator decorator in this.Decorators)
+				{
+					if(decorator.RequiresHost)
+					{
+						decorator.RepositionHostShape(decorator.GetHostShape(this));
+					}
+				}
+			}
+		}
+		#endregion
+		#region Constructors, domain class Id
+	
+		/// <summary>
+		/// ActionShape domain class Id.
+		/// </summary>
+		public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x25205757, 0xe7e3, 0x4310, 0xb3, 0xc8, 0xe4, 0xb8, 0x5c, 0x91, 0xb1, 0x52);
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="store">Store where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public ActionShape(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: this(store != null ? store.DefaultPartitionForClass(DomainClassId) : null, propertyAssignments)
+		{
+		}
+		
+		/// <summary>
+		/// Constructor
+		/// </summary>
+		/// <param name="partition">Partition where new element is to be created.</param>
+		/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
+		public ActionShape(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
+			: base(partition, propertyAssignments)
+		{
+		}
+		#endregion
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/Shapes.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\Shapes.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ToolboxHelper.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ToolboxHelper.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ToolboxHelper.cs	(revision 10525)
@@ -0,0 +1,322 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using System;
+using System.Diagnostics;
+using System.Drawing.Design;
+using System.Windows.Forms;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Helper class used to create and initialize toolbox items for this DSL.
+	/// </summary>
+	/// <remarks>
+	/// Double-derived class to allow easier code customization.
+	/// </remarks>
+	public partial class HLSimToolboxHelper : HLSimToolboxHelperBase 
+	{
+		/// <summary>
+		/// Constructs a new HLSimToolboxHelper.
+		/// </summary>
+		public HLSimToolboxHelper(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider) { }
+	}
+	
+	/// <summary>
+	/// Helper class used to create and initialize toolbox items for this DSL.
+	/// </summary>
+	
+	[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Justification = "The store is disposed on domain shut down")]
+	public abstract class HLSimToolboxHelperBase
+	{
+		/// <summary>
+		/// Toolbox item filter string used to identify HLSim toolbox items.  
+		/// </summary>
+		/// <remarks>
+		/// See the MSDN documentation for the ToolboxItemFilterAttribute class for more information on toolbox
+		/// item filters.
+		/// </remarks>
+		public const string ToolboxFilterString = "HLSim.1.0";
+		/// <summary>
+		/// Toolbox item filter string used to identify Trigger connector tool.
+		/// </summary>
+		public const string TriggerFilterString = "Trigger.1.0";
+		/// <summary>
+		/// Toolbox item filter string used to identify Listener connector tool.
+		/// </summary>
+		public const string ListenerFilterString = "Listener.1.0";
+
+	
+		private global::System.Collections.Generic.Dictionary<string, DslDesign::ModelingToolboxItem> toolboxItemCache = new global::System.Collections.Generic.Dictionary<string, DslDesign::ModelingToolboxItem>();
+		private DslModeling::Store toolboxStore;
+		
+		private global::System.IServiceProvider sp;
+		
+		/// <summary>
+		/// Constructs a new HLSimToolboxHelperBase.
+		/// </summary>
+		protected HLSimToolboxHelperBase(global::System.IServiceProvider serviceProvider)
+		{
+			if(serviceProvider == null) throw new global::System.ArgumentNullException("serviceProvider");
+			
+			this.sp = serviceProvider;
+		}
+		
+		/// <summary>
+		/// Serivce provider used to access services from the hosting environment.
+		/// </summary>
+		protected global::System.IServiceProvider ServiceProvider
+		{
+			get
+			{
+				return this.sp;
+			}
+		}
+
+		/// <summary>
+		/// Returns the display name of the tab that should be opened by default when the editor is opened.
+		/// </summary>
+		public static string DefaultToolboxTabName
+		{
+			get
+			{
+				return global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("HLSimToolboxTab", global::System.Globalization.CultureInfo.CurrentUICulture);
+			}
+		}
+		
+		
+		/// <summary>
+		/// Returns the toolbox items count in the default tool box tab.
+		/// </summary>
+		public static int DefaultToolboxTabToolboxItemsCount
+		{
+			get
+			{
+				return 4;
+			}
+		}
+		
+
+		/// <summary>
+		/// Returns a list of custom toolbox items to be added dynamically
+		/// </summary>
+		public virtual global::System.Collections.Generic.IList<DslDesign::ModelingToolboxItem> CreateToolboxItems()
+		{
+			global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem> toolboxItems = new global::System.Collections.Generic.List<DslDesign::ModelingToolboxItem>();
+			return toolboxItems;
+		}
+		
+		/// <summary>
+		/// Creates an ElementGroupPrototype for the element tool corresponding to the given domain class id.
+		/// Default behavior is to create a prototype containing an instance of the domain class.
+		/// Derived classes may override this to add additional information to the prototype.
+		/// </summary>
+		protected virtual DslModeling::ElementGroupPrototype CreateElementToolPrototype(DslModeling::Store store, global::System.Guid domainClassId)
+		{
+			DslModeling::ModelElement element = store.ElementFactory.CreateElement(domainClassId);
+			DslModeling::ElementGroup elementGroup = new DslModeling::ElementGroup(store.DefaultPartition);
+			elementGroup.AddGraph(element, true);
+			return elementGroup.CreatePrototype();
+		}
+
+		/// <summary>
+		/// Returns instance of ModelingToolboxItem based on specified name.
+		/// This method must be called from within a Transaction. Failure to do so will result in an exception
+		/// </summary>
+		/// <param name="itemId">unique name of desired ToolboxItem</param>
+		/// <param name="store">Store to perform the operation against</param>
+		/// <returns>An instance of ModelingToolboxItem if the itemId can be resolved, null otherwise</returns>
+		public virtual DslDesign::ModelingToolboxItem GetToolboxItem(string itemId, DslModeling::Store store)
+		{
+			DslDesign::ModelingToolboxItem result = null;
+			if (string.IsNullOrEmpty(itemId))
+			{
+				return null;
+			}
+			if (store == null)
+			{
+				return null;
+			}
+			global::System.Resources.ResourceManager resourceManager = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager;
+			global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;
+			switch(itemId)
+			{
+				case "HeuristicLab.SimulationCore.ActivityToolboxItem":
+					// Add Activity shape tool.
+					result = new DslDesign::ModelingToolboxItem(
+						"HeuristicLab.SimulationCore.ActivityToolboxItem", // Unique identifier (non-localized) for the toolbox item.
+						1, // Position relative to other items in the same toolbox tab.
+						resourceManager.GetString("ActivityToolboxItem", resourceCulture), // Localized display name for the item.
+						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ActivityToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
+						"HeuristicLab.SimulationCore.HLSimToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
+						resourceManager.GetString("HLSimToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
+						"Activity", // F1 help keyword for the toolbox item.
+						resourceManager.GetString("ActivityToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
+						CreateElementToolPrototype(store, global::HeuristicLab.SimulationCore.Activity.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
+						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
+						new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
+						});
+					break;
+				case "HeuristicLab.SimulationCore.ActionToolboxItem":
+					// Add Action shape tool.
+					result = new DslDesign::ModelingToolboxItem(
+						"HeuristicLab.SimulationCore.ActionToolboxItem", // Unique identifier (non-localized) for the toolbox item.
+						2, // Position relative to other items in the same toolbox tab.
+						resourceManager.GetString("ActionToolboxItem", resourceCulture), // Localized display name for the item.
+						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ActionToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.
+						"HeuristicLab.SimulationCore.HLSimToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
+						resourceManager.GetString("HLSimToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
+						"Action", // F1 help keyword for the toolbox item.
+						resourceManager.GetString("ActionToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
+						CreateElementToolPrototype(store, global::HeuristicLab.SimulationCore.Action.DomainClassId), // ElementGroupPrototype (data object) representing model element on the toolbox.
+						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
+						new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require) 
+						});
+					break;
+				case "HeuristicLab.SimulationCore.TriggerToolboxItem":
+
+					// Add Trigger connector tool.
+					result = new DslDesign::ModelingToolboxItem(
+						"HeuristicLab.SimulationCore.TriggerToolboxItem", // Unique identifier (non-localized) for the toolbox item.
+						3, // Position relative to other items in the same toolbox tab.
+						resourceManager.GetString("TriggerToolboxItem", resourceCulture), // Localized display name for the item.
+						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("TriggerToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
+						"HeuristicLab.SimulationCore.HLSimToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
+						resourceManager.GetString("HLSimToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
+						"Trigger", // F1 help keyword for the toolbox item.
+						resourceManager.GetString("TriggerToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
+						null, // Connector toolbox items do not have an underlying data object.
+						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
+							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
+							new global::System.ComponentModel.ToolboxItemFilterAttribute(TriggerFilterString)
+						});
+					break;
+				case "HeuristicLab.SimulationCore.ListenerToolboxItem":
+
+					// Add Listener connector tool.
+					result = new DslDesign::ModelingToolboxItem(
+						"HeuristicLab.SimulationCore.ListenerToolboxItem", // Unique identifier (non-localized) for the toolbox item.
+						4, // Position relative to other items in the same toolbox tab.
+						resourceManager.GetString("ListenerToolboxItem", resourceCulture), // Localized display name for the item.
+						(global::System.Drawing.Bitmap)DslDiagrams::ImageHelper.GetImage(resourceManager.GetObject("ListenerToolboxBitmap", resourceCulture)), // Image displayed next to the toolbox item.				
+						"HeuristicLab.SimulationCore.HLSimToolboxTab", // Unique identifier (non-localized) for the toolbox item tab.
+						resourceManager.GetString("HLSimToolboxTab", resourceCulture), // Localized display name for the toolbox tab.
+						"Listener", // F1 help keyword for the toolbox item.
+						resourceManager.GetString("ListenerToolboxTooltip", resourceCulture), // Localized tooltip text for the toolbox item.
+						null, // Connector toolbox items do not have an underlying data object.
+						new global::System.ComponentModel.ToolboxItemFilterAttribute[] { // Collection of ToolboxItemFilterAttribute objects that determine visibility of the toolbox item.
+							new global::System.ComponentModel.ToolboxItemFilterAttribute(ToolboxFilterString, global::System.ComponentModel.ToolboxItemFilterType.Require), 
+							new global::System.ComponentModel.ToolboxItemFilterAttribute(ListenerFilterString)
+						});
+					break;
+				default:
+					break;
+			} // end switch
+			
+			return result;
+		}
+		
+
+		/// <summary>
+		/// The store toe be used for all the toolbox item creation
+		/// </summary>
+		protected DslModeling::Store ToolboxStore
+		{
+			get
+			{ 
+				if (toolboxStore==null)
+				{
+					toolboxStore = new DslModeling::Store(this.ServiceProvider);
+					EventHandler StoreCleanUp = (o, e) =>
+					{
+						//Since Store implements IDisposable, we need to dispose it when we're finished
+						if (this.toolboxStore != null)
+						{
+							this.toolboxStore.Dispose();
+						}
+						this.toolboxStore = null;
+					};
+					//There is no DomainUnload event for the default AppDomain, so we listen for both ProcessExit and DomainUnload
+					AppDomain.CurrentDomain.ProcessExit += new EventHandler(StoreCleanUp);
+					AppDomain.CurrentDomain.DomainUnload += new EventHandler(StoreCleanUp);
+					
+					//load the domain model
+					toolboxStore.LoadDomainModels(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel));
+					
+				}
+				return toolboxStore;
+			}
+		}
+		
+		/// <summary>
+		/// Given a toolbox item "unique ID" returns the the toolbox item using cached dictionary
+		/// </summary>
+		/// <param name="itemId">The unique ToolboxItem to retrieve</param>
+		private DslDesign::ModelingToolboxItem GetToolboxItem(string itemId)
+		{
+			DslDesign::ModelingToolboxItem item = null;
+
+			if (!this.toolboxItemCache.TryGetValue(itemId, out item))
+			{
+				DslModeling::Store store = this.ToolboxStore;
+				
+				// Open transaction so we can create model elements corresponding to toolbox items.
+				using (DslModeling::Transaction t = store.TransactionManager.BeginTransaction("CreateToolboxItems"))
+				{
+					// Retrieve the specified ToolboxItem from the DSL
+					this.toolboxItemCache[itemId] = item = this.GetToolboxItem(itemId, store);
+				}
+			}
+
+			return item;
+		}
+		
+		/// <summary>
+		/// Given a toolbox item "unique ID" and a data format identifier, returns the content of
+		/// the data format. 
+		/// </summary>
+		/// <param name="itemId">The unique ToolboxItem to retrieve data for</param>
+		/// <param name="format">The desired format of the resulting data</param>
+		public virtual object GetToolboxItemData(string itemId, DataFormats.Format format)
+		{
+			DslDesign::ModelingToolboxItem item = null;
+
+			global::System.Resources.ResourceManager resourceManager = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager;
+			global::System.Globalization.CultureInfo resourceCulture = global::System.Globalization.CultureInfo.CurrentUICulture;
+
+			System.Windows.Forms.IDataObject tbxDataObj;
+
+			//get the toolbox item
+			item = GetToolboxItem(itemId);
+
+			if (item != null)
+			{
+				ToolboxItemContainer container = new ToolboxItemContainer(item);
+				tbxDataObj = container.ToolboxData;
+
+				if (tbxDataObj.GetDataPresent(format.Name))
+				{
+					return tbxDataObj.GetData(format.Name);
+				}
+				else 
+				{
+					string invalidFormatString = resourceManager.GetString("UnsupportedToolboxFormat", resourceCulture);
+					throw new InvalidOperationException(string.Format(resourceCulture, invalidFormatString, format.Name));
+				}
+			}
+
+			string errorFormatString = resourceManager.GetString("UnresolvedToolboxItem", resourceCulture);
+			throw new InvalidOperationException(string.Format(resourceCulture, errorFormatString, itemId));
+		}		
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ToolboxHelper.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ToolboxHelper.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GeneratedCode/ToolboxHelper.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\DslDefinition.dsl'" #>
+<#@ include file="Dsl\ToolboxHelper.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GlobalSuppressions.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GlobalSuppressions.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/GlobalSuppressions.cs	(revision 10525)
@@ -0,0 +1,11 @@
+// This file is used by Code Analysis to maintain SuppressMessage
+// attributes that are applied to this project. Project-level
+// suppressions either have no target or are given a specific target
+// and scoped to a namespace, type, member, etc.
+//
+// To add a suppression to this file, right-click the message in the
+// Error List, point to "Suppress Message(s)", and click "In Project
+// Suppression File". You do not need to add suppressions to this
+// file manually.
+
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "hlsim", Scope = "resource", Target = "HeuristicLab.SimulationCore.GeneratedCode.DomainModelResx.resources", Justification = "Designer file extension")]
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/Properties/AssemblyInfo.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/Properties/AssemblyInfo.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/Dsl/Properties/AssemblyInfo.cs	(revision 10525)
@@ -0,0 +1,45 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.ConstrainedExecution;
+
+#endregion
+
+//
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle(@"")]
+[assembly: AssemblyDescription(@"")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany(@"HEAL")]
+[assembly: AssemblyProduct(@"HeuristicLab")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: System.Resources.NeutralResourcesLanguage("en")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion(@"1.0.0.0")]
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(true)]
+[assembly: ReliabilityContract(Consistency.MayCorruptProcess, Cer.None)]
+
+//
+// Make the Dsl project internally visible to the DslPackage assembly
+//
+[assembly: InternalsVisibleTo(@"HeuristicLab.SimulationCore.DslPackage, PublicKey=002400000480000094000000060200000024000052534131000400000100010001A291ECF742F53C54309BBB35DB53E03D146648FA672611E0EB6B785FBE7FD08A71AC71B16BC4706D0F69A661A0EA3E34655E70395BD2183131EAFF086AF4EE4F80A95F9AACF644E2D837FE986A992E369AE1364F9019926B77F658063A690844979EC69854AAA115346C4BAB21EA1FC3B05B13E4FB0361F230A0D5EAB010B5")]
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/Commands.vsct
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/Commands.vsct	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/Commands.vsct	(revision 10525)
@@ -0,0 +1,18 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <!-- -->
+  <!-- This file contains custom command definitions. -->
+  <!-- -->
+  <!-- NOTE: Each time commands are added or changed, the "version" parameter to the -->
+  <!-- ProvideMenuResource attribute in Shell\Package.tt should be incremented. -->
+  <!-- This causes Visual Studio to re-merge the menu definitions for the package. -->
+  <!-- Otherwise, changes won't take effect until the next time devenv /setup is run. -->
+  <!-- -->
+  <Extern href="stdidcmd.h"/>
+  <Extern href="vsshlids.h"/>
+  <Extern href="virtkeys.h"/>
+  <Extern href="DSLToolsCmdID.h"/>
+  <Include href="GeneratedCode\GeneratedVsct.vsct"/>
+  <Commands package="guidPkg">
+  </Commands>
+</CommandTable>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/DslPackage.csproj
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/DslPackage.csproj	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/DslPackage.csproj	(revision 10525)
@@ -0,0 +1,245 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\DSLTools\Microsoft.DslTools.settings.targets" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.20723</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{FE73F7F2-756D-4831-9A6E-AF562A920EEA}</ProjectGuid>
+    <ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <ApplicationIcon>Resources\File.ico</ApplicationIcon>
+    <RootNamespace>HeuristicLab.SimulationCore</RootNamespace>
+    <AssemblyName>HeuristicLab.SimulationCore.DslPackage</AssemblyName>
+    <AssemblyOriginatorKeyFile>..\Key.snk</AssemblyOriginatorKeyFile>
+    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
+    <SignAssembly>true</SignAssembly>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <ClearToolboxCacheInExpHive>true</ClearToolboxCacheInExpHive>
+    <StartupObject>
+    </StartupObject>
+    <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <!-- Properties for VSSDK/DSL Targets: Must be defined before importing the targets -->
+  <PropertyGroup>
+    <RegisterOutputPackage>true</RegisterOutputPackage>
+    <RegisterWithCodebase>true</RegisterWithCodebase>
+    <GacTargetOutput>false</GacTargetOutput>
+    <TransformOnBuild>True</TransformOnBuild>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)'!=''" />
+  <Import Project="$(DslTargetsPath)\Microsoft.DSLTools.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.Modeling.Sdk$(DslToolsVersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.Modeling.Sdk.Diagrams$(DslToolsVersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.Modeling.Sdk.Shell$(DslToolsVersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.OLE.Interop" />
+    <Reference Include="Microsoft.VisualStudio.Shell$(MpfVersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Interop" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
+      <EmbedInteropTypes>true</EmbedInteropTypes>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.11.0" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating$(T4VersionSuffix)" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.VSHost$(T4VersionSuffix)" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xaml" />
+    <Reference Include="WindowsBase">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.10.0" />
+    <Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.12.0" />
+    <Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="GeneratedCode\CommandSet.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>CommandSet.tt</DependentUpon>
+    </Compile>
+    <None Include="source.extension.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>source.extension.vsixmanifest</LastGenOutput>
+    </None>
+    <None Include="source.extension.vsixmanifest">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>source.extension.tt</DependentUpon>
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="GeneratedCode\Constants.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Constants.cs</LastGenOutput>
+    </None>
+    <Compile Include="GeneratedCode\Constants.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Constants.tt</DependentUpon>
+    </Compile>
+    <None Include="GeneratedCode\DocData.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DocData.cs</LastGenOutput>
+    </None>
+    <Compile Include="GeneratedCode\DocData.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DocData.tt</DependentUpon>
+    </Compile>
+    <None Include="GeneratedCode\DocView.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>DocView.cs</LastGenOutput>
+    </None>
+    <Compile Include="GeneratedCode\DocView.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DocView.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\EditorFactory.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>EditorFactory.tt</DependentUpon>
+    </Compile>
+    <Compile Include="GeneratedCode\ModelExplorer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ModelExplorer.tt</DependentUpon>
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="GeneratedCode\ModelExplorerToolWindow.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ModelExplorerToolWindow.tt</DependentUpon>
+    </Compile>
+    <None Include="GeneratedCode\ModelExplorer.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>ModelExplorer.cs</LastGenOutput>
+    </None>
+    <Compile Include="GeneratedCode\Package.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Package.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="GeneratedCode\EditorFactory.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>EditorFactory.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\ModelExplorerToolWindow.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>ModelExplorerToolWindow.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\Package.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Package.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Dsl\Dsl.csproj">
+      <Project>{946658e8-06b1-4849-b14e-64721327c87f}</Project>
+      <Name>Dsl</Name>
+      <IncludeOutputGroupsInVSIX>
+        BuiltProjectOutputGroup;
+      </IncludeOutputGroupsInVSIX>
+      <IncludeOutputGroupsInVSIXLocalOnly>
+        DebugSymbolsProjectOutputGroup;
+      </IncludeOutputGroupsInVSIXLocalOnly>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4df5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="VSPackage.resx">
+      <SubType>Designer</SubType>
+      <MergeWithCTO>true</MergeWithCTO>
+      <ManifestResourceName>VSPackage</ManifestResourceName>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <VSItemTemplate Include="ProjectItemTemplates\CSharp.vstemplate">
+      <OutputName>HLSim</OutputName>
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>CSharp.tt</DependentUpon>
+    </VSItemTemplate>
+    <None Include="Resources\File.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\Key.snk">
+      <Link>Key.snk</Link>
+    </None>
+    <VSCTCompile Include="Commands.vsct">
+      <ResourceName>1000.ctmenu</ResourceName>
+    </VSCTCompile>
+    <None Include="GeneratedCode\CommandSet.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>CommandSet.cs</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\GeneratedVSCT.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>GeneratedVSCT.vsct</LastGenOutput>
+    </None>
+    <None Include="GeneratedCode\GeneratedVSCT.vsct">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>GeneratedVSCT.tt</DependentUpon>
+    </None>
+    <None Include="ProjectItemTemplates\CSharp.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>CSharp.vstemplate</LastGenOutput>
+    </None>
+    <None Include="ProjectItemTemplates\hlsim.hlsim" />
+    <None Include="ProjectItemTemplates\hlsim.diagram" />
+  </ItemGroup>
+  <PropertyGroup>
+    <StartProgram>$(DevEnvDir)\devenv.exe</StartProgram>
+    <StartAction>Program</StartAction>
+    <StartArguments>/rootsuffix Exp "..\..\..\Debugging\Debugging.sln"</StartArguments>
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDictionary Include="..\CodeAnalysisDictionary.xml">
+      <Link>CodeAnalysisDictionary.xml</Link>
+    </CodeAnalysisDictionary>
+    <Content Include="Resources\ModelExplorerToolWindowBitmaps.bmp" />
+  </ItemGroup>
+</Project>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/CommandSet.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/CommandSet.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/CommandSet.cs	(revision 10525)
@@ -0,0 +1,268 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+using VSShell = global::Microsoft.VisualStudio.Shell;
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+using DslValidation = global::Microsoft.VisualStudio.Modeling.Validation;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	internal partial class HLSimCommandSet : HLSimCommandSetBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimCommandSet.
+		/// </summary>
+		public HLSimCommandSet(global::System.IServiceProvider serviceProvider) 
+			: base(serviceProvider)
+		{
+		}
+	}
+
+	/// <summary>
+	/// Class containing handlers for commands supported by this DSL.
+	/// </summary>
+	internal abstract class HLSimCommandSetBase : DslShell::CommandSet
+	{
+		/// <summary>
+		/// Constructs a new HLSimCommandSetBase.
+		/// </summary>
+		protected HLSimCommandSetBase(global::System.IServiceProvider serviceProvider) : base(serviceProvider)
+		{
+		}
+
+		/// <summary>
+		/// Provide the menu commands that this command set handles
+		/// </summary>
+		protected override global::System.Collections.Generic.IList<global::System.ComponentModel.Design.MenuCommand> GetMenuCommands()
+		{
+			// Get the standard commands
+			global::System.Collections.Generic.IList<global::System.ComponentModel.Design.MenuCommand> commands = base.GetMenuCommands();
+
+			global::System.ComponentModel.Design.MenuCommand menuCommand;
+
+			// Add command handler for the "view explorer" command in the top-level menu.
+			// We use a ContextBoundMenuCommand because the visibility of this command is
+			// based on whether or not the command context of our DSL editor is active. 
+			menuCommand = new DslShell::CommandContextBoundMenuCommand(this.ServiceProvider,
+				new global::System.EventHandler(OnMenuViewModelExplorer),
+				Constants.ViewHLSimExplorerCommand,
+				typeof(HLSimEditorFactory).GUID);
+
+			commands.Add(menuCommand);
+
+			return commands;
+		}
+		/// <summary>
+		/// Command handler that shows the explorer tool window.
+		/// </summary>
+		internal virtual void OnMenuViewModelExplorer(object sender, global::System.EventArgs e)
+		{
+			HLSimExplorerToolWindow explorer = this.HLSimExplorerToolWindow;
+			if (explorer != null)
+			{
+				explorer.Show();
+			}
+		}
+
+
+		/// <summary>
+		/// Returns the currently focused document.
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+		protected HLSimDocData CurrentHLSimDocData
+		{
+			get
+			{
+				return this.MonitorSelection.CurrentDocument as HLSimDocData;
+			}
+		}
+
+		/// <summary>
+		/// Returns the currently focused document view.
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+		protected HLSimDocView CurrentHLSimDocView
+		{
+			get
+			{
+				return this.MonitorSelection.CurrentDocumentView as HLSimDocView;
+			}
+		}
+
+		/// <summary>
+		/// Returns the explorer tool window.
+		/// </summary>
+		protected HLSimExplorerToolWindow HLSimExplorerToolWindow
+		{
+			get
+			{
+				HLSimExplorerToolWindow explorerWindow = null;
+				DslShell::ModelingPackage package = this.ServiceProvider.GetService(typeof(VSShell::Package)) as DslShell::ModelingPackage;
+
+				if (package != null)
+				{
+					explorerWindow = package.GetToolWindow(typeof(HLSimExplorerToolWindow), true) as HLSimExplorerToolWindow;
+				}
+
+				return explorerWindow;
+			}
+		}
+
+		/// <summary>
+		/// Returns the currently selected object in the model explorer.
+		/// </summary>
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+		protected object ExplorerSelection
+		{
+			get
+			{
+				object selection = null;
+				HLSimExplorerToolWindow explorerWindow = this.HLSimExplorerToolWindow;
+				
+				if(explorerWindow != null)
+				{
+					foreach (object o in explorerWindow.GetSelectedComponents())
+					{
+						selection = o;
+						break;
+					}
+				}
+
+				return selection;
+			}
+		}
+	}
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	internal partial class HLSimClipboardCommandSet : HLSimClipboardCommandSetBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimClipboardCommandSet.
+		/// </summary>
+		public HLSimClipboardCommandSet(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider)
+		{
+		}
+	}
+
+	/// <summary>
+	/// Class containing handlers for cut/copy/paste commands supported by this DSL.
+	/// </summary>
+	internal abstract partial class HLSimClipboardCommandSetBase : DslShell::ClipboardCommandSet
+	{
+		/// <summary>
+		/// Constructs a new HLSimClipboardCommandSetBase.
+		/// </summary>
+		protected HLSimClipboardCommandSetBase(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider)
+		{
+		}
+
+		/// <summary>
+		/// Provide the menu commands that this command set handles
+		/// </summary>
+		protected override global::System.Collections.Generic.IList<global::System.ComponentModel.Design.MenuCommand> GetMenuCommands()
+		{
+			// Get the standard commands
+			var commands = new global::System.Collections.Generic.List<global::System.ComponentModel.Design.MenuCommand>(3);
+
+			global::System.ComponentModel.Design.MenuCommand menuCommand;
+
+			menuCommand = new DslShell::DynamicStatusMenuCommand(
+				new global::System.EventHandler(this.OnStatusCut),
+				new global::System.EventHandler(this.OnMenuCut),
+				global::System.ComponentModel.Design.StandardCommands.Cut);
+			commands.Add(menuCommand);
+
+			menuCommand = new DslShell::DynamicStatusMenuCommand(
+				new global::System.EventHandler(this.OnStatusCopy),
+				new global::System.EventHandler(this.OnMenuCopy),
+				global::System.ComponentModel.Design.StandardCommands.Copy);
+			commands.Add(menuCommand);
+
+			menuCommand = new DslShell::DynamicStatusMenuCommand(
+				new global::System.EventHandler(this.OnStatusPaste),
+				new global::System.EventHandler(this.OnMenuPaste),
+				global::System.ComponentModel.Design.StandardCommands.Paste);
+			commands.Add(menuCommand);
+
+			return commands;
+		}
+
+		/// <summary>
+		/// Determines whether Cut menu item should be visible and if so, enabled.
+		/// </summary>
+		/// <param name="sender">The sender of the message</param>
+		/// <param name="args">empty</param>
+		private void OnStatusCut(object sender, global::System.EventArgs args)
+		{
+			System.ComponentModel.Design.MenuCommand cmd = sender as System.ComponentModel.Design.MenuCommand;
+			this.ProcessOnStatusCutCommand(cmd);
+		}
+
+		/// <summary>
+		/// Determines whether Copy menu item should be visible and if so, enabled.
+		/// </summary>
+		/// <param name="sender">The sender of the message</param>
+		/// <param name="args">empty</param>
+		private void OnStatusCopy(object sender, global::System.EventArgs args)
+		{
+			System.ComponentModel.Design.MenuCommand cmd = sender as System.ComponentModel.Design.MenuCommand;
+			this.ProcessOnStatusCopyCommand(cmd);
+		}
+
+		/// <summary>
+		/// Updates the UI for the Paste command
+		/// </summary>
+		/// <param name="sender">The sender of the message</param>
+		/// <param name="args">Message parameters</param>
+		private void OnStatusPaste(object sender, global::System.EventArgs args)
+		{
+			System.ComponentModel.Design.MenuCommand cmd = sender as System.ComponentModel.Design.MenuCommand;
+			this.ProcessOnStatusPasteCommand(cmd);
+		}
+
+		/// <summary>
+		/// Event handler to cut the selected objects to the clipboard then delete the original.
+		/// </summary>
+		/// <param name="sender">The MenuCommand selected.</param>
+		/// <param name="args">not used</param>
+		private void OnMenuCut(object sender, global::System.EventArgs args)
+		{
+			this.ProcessOnMenuCutCommand();
+		}
+
+		/// <summary>
+		/// Event handler to copy the selected objects to the clipboard.
+		/// </summary>
+		/// <param name="sender">The MenuCommand selected.</param>
+		/// <param name="args">not used</param>
+		private void OnMenuCopy(object sender, global::System.EventArgs args)
+		{
+			this.ProcessOnMenuCopyCommand();
+		}
+
+		/// <summary>
+		/// Event handler to paste a copy of the object on the clipboard.
+		/// </summary>
+		/// <param name="sender">The MenuCommand selected.</param>
+		/// <param name="args">not used</param>
+		private void OnMenuPaste(object sender, global::System.EventArgs args)
+		{
+			this.ProcessOnMenuPasteCommand();
+		}
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/CommandSet.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/CommandSet.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/CommandSet.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\CommandSet.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Constants.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Constants.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Constants.cs	(revision 10525)
@@ -0,0 +1,52 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.SimulationCore
+{
+	internal static partial class Constants
+	{
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+		public const string DesignerFileExtension = "hlsim";
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+		public const string ProductName = @"HeuristicLab";
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+		public const string CompanyName = @"HEAL";
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+		public const string ProductVersion = "1.0.0.0";
+
+		// Menu definitions
+		public static readonly global::System.ComponentModel.Design.CommandID HLSimDiagramMenu = new global::System.ComponentModel.Design.CommandID(new global::System.Guid(HLSimCommandSetId), 0x10000);
+		public static readonly global::System.ComponentModel.Design.CommandID HLSimExplorerMenu = new global::System.ComponentModel.Design.CommandID(new global::System.Guid(HLSimCommandSetId), 0x10001);
+
+		// Command definitions
+		public static readonly global::System.ComponentModel.Design.CommandID ViewHLSimExplorerCommand = new global::System.ComponentModel.Design.CommandID(new global::System.Guid(HLSimCommandSetId), 0x0001);
+	
+		// Package identifier
+		public const string HLSimPackageId = "fab8f4d5-e0e8-4756-917b-6979bfd5ce3a";
+		
+		// Editor factory identifier
+		public const string HLSimEditorFactoryId = "c6d92072-93cd-4652-9e26-052db3ad40ce";
+		
+		public const string DefaultDiagramExtension = ".diagram";
+		
+		// Model explorer tool window identifier
+		public const string HLSimModelExplorerToolWindowId = "8ed281ac-3dd2-4c07-a131-eb7845494b19";
+	}
+}
+//
+// Constants not generated from values in DesignerDefinition.dsl are defined below
+//
+namespace HeuristicLab.SimulationCore
+{
+	internal static partial class Constants
+	{
+		// Menu identifier
+		public const string HLSimCommandSetId = "2260428b-8eff-48ef-b0cd-7fbed9a201c2";
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Constants.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Constants.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Constants.tt	(revision 10525)
@@ -0,0 +1,13 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\Constants.tt" #>
+//
+// Constants not generated from values in DesignerDefinition.dsl are defined below
+//
+namespace <#= CodeGenerationUtilities.GetPackageNamespace(this.Dsl) #>
+{
+	internal static partial class Constants
+	{
+		// Menu identifier
+		public const string <#= dslName #>CommandSetId = "2260428b-8eff-48ef-b0cd-7fbed9a201c2";
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocData.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocData.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocData.cs	(revision 10525)
@@ -0,0 +1,610 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslValidation = global::Microsoft.VisualStudio.Modeling.Validation;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+using VSShellInterop = global::Microsoft.VisualStudio.Shell.Interop;
+using global::System.Linq;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	internal partial class HLSimDocData : HLSimDocDataBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimDocData.
+		/// </summary>
+		public HLSimDocData(global::System.IServiceProvider serviceProvider, global::System.Guid editorFactoryId) 
+			: base(serviceProvider, editorFactoryId)
+		{
+		}
+	}
+
+	/// <summary>
+	/// Class which represents a HLSim document in memory.
+	/// </summary>
+	internal abstract partial class HLSimDocDataBase : DslShell::ModelingDocData
+	{
+		/// <summary>
+		/// Document lock holder registered for the subordinate .diagram file.
+		/// </summary>
+		protected DslShell::SubordinateDocumentLockHolder diagramDocumentLockHolder;
+
+		/// <summary>
+		/// Constructs a new HLSimDocDataBase.
+		/// </summary>
+		protected HLSimDocDataBase(global::System.IServiceProvider serviceProvider, global::System.Guid editorFactoryId) : base(serviceProvider, editorFactoryId)
+		{
+		}
+
+		/// <summary>
+		/// Returns a list of file format specifiers for the Save dialog box.
+		/// </summary>
+		protected override string FormatList
+		{
+			get
+			{
+				return global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("FormatList"); 
+			}
+		}
+
+		#region Composition container
+
+		/// <summary>
+		/// Create and return a new store
+		/// </summary>
+		/// <remarks>
+		/// Override the default behaviour to put the doc data's composition container into the store's property bag.
+		/// By default, the runtime will add the CompositionService from the DslShell ModelingCompositionContainer
+		/// if the property has not already been set.
+		/// </remarks>
+		protected override DslModeling::Store CreateStore()
+		{
+			DslModeling::Store store = base.CreateStore();
+
+			global::System.ComponentModel.Composition.ICompositionService compositionService = this.CompositionService;
+			// Add the composition container to the property bag even if it is null. This will prevent the runtime from
+			// adding the shared ModelingCompositionContainer.CompositionService.
+			store.PropertyBag.Add(DslModeling::ExtensionEnablement.ExtensionEnablementConstants.ContainerId, compositionService);
+
+			return store;
+		}
+
+		/// <summary>
+		/// Initialize the doc data
+		/// </summary>
+		public override void Initialize(DslModeling::Store sharedStore)
+		{
+			this.InitializeComposition();
+			base.Initialize(sharedStore);
+		}
+				
+		/// <summary>
+		/// The MEF composition container used by the doc data.
+		/// </summary>
+		/// <remarks>Can be null. Returns the shared modeling composition service by default.</remarks>
+		protected virtual global::System.ComponentModel.Composition.ICompositionService CompositionService
+		{
+			get
+			{
+				return DslShell::ModelingCompositionContainer.CompositionService;
+			}
+		}
+
+		/// <summary>
+		/// The MEF Export Provider used by the doc data.
+		/// </summary>
+		/// <remarks>Can be null. Returns the shared modeling export provider by default</remarks>
+		protected virtual global::System.ComponentModel.Composition.Hosting.ExportProvider ExportProvider
+		{
+			get
+			{
+				return DslShell::ModelingCompositionContainer.ExportProvider;
+			}		
+		}
+
+		/// <summary>
+		/// Satisfy Imports in DocData object
+		/// </summary>		
+		protected virtual void InitializeComposition()
+		{
+			global::System.ComponentModel.Composition.ICompositionService compositionService = this.CompositionService;
+			if (compositionService != null)
+			{		
+				try
+				{
+					compositionService.SatisfyImportsOnce(global::System.ComponentModel.Composition.AttributedModelServices.CreatePart(this));
+				}
+				catch (global::System.Exception ex)
+				{
+					// Handle binding failures
+					if (!HandleBindingFailure(ex))
+					{
+						throw;
+					}
+				}
+			}
+		}
+
+		/// <summary>
+		/// Handles exceptions that occurred during binding.
+		/// </summary>
+		/// <param name="exception">The exception that occured</param>
+		/// <returns>A flag indicating whether the exception was handled or not.</returns>
+		/// <remarks>If the exception is not handled (i.e. the method returns false), it will be re-thrown
+		/// by the calling method.
+		/// This method will be called for all types of exception.</remarks>
+		protected virtual bool HandleBindingFailure(global::System.Exception exception)
+		{
+			// Log and suppress all binding failure exceptions.
+			string errorMessage = string.Format(global::System.Globalization.CultureInfo.CurrentCulture,
+				global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("BindingErrorOccurred"),
+				exception.ToString());
+			
+			this.AddErrorListItem(new DslShell::SimpleErrorListItem(errorMessage, this.FileName, global::Microsoft.VisualStudio.Shell.TaskPriority.Normal, global::Microsoft.VisualStudio.Shell.TaskErrorCategory.Warning));
+			return true;
+		}
+
+		#endregion // CompositionContainer
+
+		#region SerializerLocator
+
+		/// <summary>
+		/// Resolves the xml namespaces to domain model types
+		/// </summary>
+		private DslModeling::ISerializerLocator serializerLocator;
+
+		/// <summary>
+		/// The domain model resolver used during serialization.
+		/// </summary>
+		protected DslModeling::ISerializerLocator SerializerLocator
+		{
+			get
+			{
+				if (this.serializerLocator == null)
+				{
+					this.serializerLocator = CreateSerializerLocator();
+				}
+				return this.serializerLocator;
+			}
+		}
+
+		/// <summary>
+		/// Factory method to create a SerializerLocator.
+		/// </summary>
+		protected virtual DslModeling::ISerializerLocator CreateSerializerLocator()
+		{
+			// If we don't have a MEF ExportProvider, we won't be able to resolve
+			// any namespaces.
+			if (this.ExportProvider == null)
+			{
+				return null;
+			}
+
+			return new DslModeling::StandardSerializerLocator(this.ExportProvider);
+		}
+
+		#endregion // SerializerLocator
+		
+		#region ExtensionLocator
+
+		/// <summary>
+		/// Used to locate domain model extensions
+		/// </summary>
+		private DslModeling::IExtensionLocator extensionLocator;
+
+		/// <summary>
+		/// The locator used to find domain model extensions.
+		/// </summary>
+		protected DslModeling::IExtensionLocator ExtensionLocator
+		{
+			get
+			{
+				if (this.extensionLocator == null)
+				{
+					this.extensionLocator = CreateExtensionLocator();
+				}
+				return this.extensionLocator;
+			}
+		}
+
+		/// <summary>
+		/// Factory method to create an ExtensionLocator.
+		/// </summary>
+		protected virtual DslModeling::IExtensionLocator CreateExtensionLocator()
+		{
+			// If we don't have an MEF ExportProvider, we won't be able to locate
+			// any extensions
+			if (this.ExportProvider == null)
+			{
+				return null;
+			}
+
+			return new DslModeling::StandardExtensionLocator(this.ExportProvider);
+		}
+
+		#endregion // ExtensionLocator
+
+
+		/// <summary>
+		/// When the doc data is closed, make sure we reset the valiation messages 
+		/// (if there's any) from the ErrorList window.
+		/// </summary>
+		/// <param name="disposing"></param>
+		protected override void Dispose(bool disposing)
+		{
+			try
+			{
+				if (this.diagramDocumentLockHolder != null)
+				{
+					this.diagramDocumentLockHolder.Dispose();
+					this.diagramDocumentLockHolder = null;
+				}
+				this.diagramPartitionId = global::System.Guid.Empty;
+			}
+			finally
+			{
+				base.Dispose(disposing);
+			}
+		}
+
+		/// <summary>
+		/// Returns a collection of domain models to load into the store.
+		/// </summary>
+		/// <remarks>The default implementation includes any extension domain models returned by the call to GetExtensionDomainModels().</remarks>
+		protected override global::System.Collections.Generic.IList<global::System.Type> GetDomainModels()
+		{
+			global::System.Collections.Generic.List<global::System.Type> allTypes = new System.Collections.Generic.List<System.Type>();
+
+			// In the type of our base domain model
+			allTypes.Add(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel));
+
+			// Add in any extension domain models
+			global::System.Collections.Generic.IEnumerable<global::System.Type> extensionTypes = this.GetExtensionDomainModels();
+			if (extensionTypes != null && extensionTypes.Count() > 0)
+			{
+				allTypes.AddRange(extensionTypes);
+			}
+
+			return allTypes;
+		}
+
+		/// <summary>
+		/// Returns the list of extension domain models to be loaded
+		/// </summary>
+		/// <returns>A list of domain model types. Can be empty.</returns>
+		/// <remarks>This method is called by "GetDomainModels", which aggregates the returned lists.</remarks>
+		protected virtual global::System.Collections.Generic.IEnumerable<global::System.Type> GetExtensionDomainModels()
+		{
+			if (this.ExtensionLocator == null)
+			{
+				return null;
+			}
+
+			global::System.Collections.Generic.IEnumerable<global::System.Type> extensionDomainModels = this.ExtensionLocator.GetExtendingDomainModels(typeof(global::HeuristicLab.SimulationCore.HLSimDomainModel));
+
+			return extensionDomainModels;
+		}
+
+
+
+
+		/// <summary>
+		/// Loads the given file.
+		/// </summary>
+		protected override void Load(string fileName, bool isReload)
+		{
+			DslModeling::SerializationResult serializationResult = new DslModeling::SerializationResult();
+			global::HeuristicLab.SimulationCore.SimulationModel modelRoot = null;
+			DslModeling::ISchemaResolver schemaResolver = new DslShell::ModelingSchemaResolver(this.ServiceProvider);
+			//clear the current root element
+			this.SetRootElement(null);
+			// Enable diagram fixup rules in our store, because we will load diagram data.
+			global::HeuristicLab.SimulationCore.HLSimDomainModel.EnableDiagramRules(this.Store);
+			string diagramFileName = fileName + this.DiagramExtension;
+			
+			modelRoot = global::HeuristicLab.SimulationCore.HLSimSerializationHelper.Instance.LoadModelAndDiagram(serializationResult, this.GetModelPartition(), fileName, this.GetDiagramPartition(), diagramFileName, schemaResolver, null /* no load-time validation */, this.SerializerLocator);
+
+			// Report serialization messages.
+			this.SuspendErrorListRefresh();
+			try
+			{
+				foreach (DslModeling::SerializationMessage serializationMessage in serializationResult)
+				{
+					this.AddErrorListItem(new DslShell::SerializationErrorListItem(this.ServiceProvider, serializationMessage));
+				}
+			}
+			finally
+			{
+				this.ResumeErrorListRefresh();
+			}
+
+			if (serializationResult.Failed)
+			{	
+				// Load failed, can't open the file.
+				throw new global::System.InvalidOperationException(global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("CannotOpenDocument"));
+			}
+			else
+			{
+				this.SetRootElement(modelRoot);
+				
+				// Attempt to set the encoding
+				if (serializationResult.Encoding != null)
+				{
+					this.ModelingDocStore.SetEncoding(serializationResult.Encoding);
+					global::Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(this.SetDocDataDirty(0)); // Setting the encoding will mark the document as dirty, so clear the dirty flag.
+				}
+				
+				if (this.Hierarchy != null && global::System.IO.File.Exists(diagramFileName))
+				{
+					// Add a lock to the subordinate diagram file.
+					if (this.diagramDocumentLockHolder == null)
+					{
+						uint itemId = DslShell::SubordinateFileHelper.GetChildProjectItemId(this.Hierarchy, this.ItemId, this.DiagramExtension);
+						if (itemId != global::Microsoft.VisualStudio.VSConstants.VSITEMID_NIL)
+						{
+							this.diagramDocumentLockHolder = DslShell::SubordinateFileHelper.LockSubordinateDocument(this.ServiceProvider, this, diagramFileName, itemId);
+							if (this.diagramDocumentLockHolder == null)
+							{
+								throw new global::System.InvalidOperationException(string.Format(global::System.Globalization.CultureInfo.CurrentCulture,
+													global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("CannotCloseExistingDiagramDocument"),
+													diagramFileName));
+							}
+						}
+					}
+				}
+			}
+		}
+
+
+			
+		/// <summary>
+		/// Handle when document has been saved
+		/// </summary>
+		/// <param name="e"></param>
+		protected override void OnDocumentSaved(global::System.EventArgs e)
+		{
+			base.OnDocumentSaved(e);
+
+			// Notify the Running Document Table that the subordinate has been saved
+			// If this was a SaveAs, then let the subordinate document do this notification itself.
+			// Otherwise VS will never ask the subordinate to save itself.
+			DslShell::DocumentSavedEventArgs savedEventArgs = e as DslShell::DocumentSavedEventArgs;
+			if (savedEventArgs != null && this.ServiceProvider != null)
+			{
+				this.NotifySubordinateDocumentSaved(savedEventArgs.OldFileName, savedEventArgs.NewFileName);
+			}
+		}
+
+		/// <summary>
+		/// Notify the RDT that the sub-ordinate document has been saved, assuming saved to the same file as registered in the RDT
+		/// </summary>
+		protected virtual void NotifySubordinateDocumentSaved(string oldFileName, string newFileName)
+		{
+			if (this.ServiceProvider != null)
+			{
+				if (global::System.StringComparer.OrdinalIgnoreCase.Compare(oldFileName, newFileName) == 0)
+				{
+					VSShellInterop::IVsRunningDocumentTable rdt = (VSShellInterop.IVsRunningDocumentTable)this.ServiceProvider.GetService(typeof(VSShellInterop::SVsRunningDocumentTable));
+					if (rdt != null && this.diagramDocumentLockHolder != null && this.diagramDocumentLockHolder.SubordinateDocData != null)
+					{
+						global::Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(rdt.NotifyOnAfterSave(this.diagramDocumentLockHolder.SubordinateDocData.Cookie));
+					}
+				}
+			}
+		}
+
+		/// <summary>
+		/// Saves the given file.
+		/// </summary>
+		protected override void Save(string fileName)
+		{
+			DslModeling::SerializationResult serializationResult = new DslModeling::SerializationResult();
+			global::HeuristicLab.SimulationCore.SimulationModel modelRoot = (global::HeuristicLab.SimulationCore.SimulationModel)this.RootElement;
+
+			
+			// Only save the diagrams if
+			// a) There are any to save
+			// b) This is NOT a SaveAs operation.  SaveAs should allow the subordinate document to control the save of its data as it is writing a new file.
+			//    Except DO save the diagram on SaveAs if there isn't currently a diagram as there won't be a subordinate document yet to save it.
+
+			bool saveAs = global::System.StringComparer.OrdinalIgnoreCase.Compare(fileName, this.FileName) != 0;
+
+			global::System.Collections.Generic.IList<DslDiagrams::PresentationElement> diagrams = DslDiagrams::PresentationViewsSubject.GetPresentation(this.RootElement);
+			if (diagrams.Count > 0 && (!saveAs || this.diagramDocumentLockHolder == null))
+			{
+				global::HeuristicLab.SimulationCore.HLSimDiagram diagram = diagrams[0] as global::HeuristicLab.SimulationCore.HLSimDiagram;
+				if (diagram != null)
+				{
+					string diagramFileName = fileName + this.DiagramExtension;
+					try
+					{
+						this.SuspendFileChangeNotification(diagramFileName);
+						
+						global::HeuristicLab.SimulationCore.HLSimSerializationHelper.Instance.SaveModelAndDiagram(serializationResult, modelRoot, fileName, diagram, diagramFileName, this.Encoding, false);
+					}
+					finally
+					{
+						this.ResumeFileChangeNotification(diagramFileName);
+					}
+				}
+			}
+			else
+			{
+				global::HeuristicLab.SimulationCore.HLSimSerializationHelper.Instance.SaveModel(serializationResult, modelRoot, fileName, this.Encoding, false);
+			}
+			// Report serialization messages.
+			this.SuspendErrorListRefresh();
+			try
+			{
+				foreach (DslModeling::SerializationMessage serializationMessage in serializationResult)
+				{
+					this.AddErrorListItem(new DslShell::SerializationErrorListItem(this.ServiceProvider, serializationMessage));
+				}
+			}
+			finally
+			{
+				this.ResumeErrorListRefresh();
+			}
+
+			if (serializationResult.Failed)
+			{	// Save failed.
+				throw new global::System.InvalidOperationException(global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("CannotSaveDocument"));
+			}
+		}
+		/// <summary>
+		/// Mark that the document has changed and thus a new backup should be created
+		/// </summary>
+		/// <remarks>
+		/// Call this method when you change the document's content
+		/// </remarks>
+		public override void MarkDocumentChangedForBackup()
+		{
+			base.MarkDocumentChangedForBackup();
+
+			// Also mark the subordinate document as changed
+			if (this.diagramDocumentLockHolder != null &&
+				this.diagramDocumentLockHolder.SubordinateDocData != null)
+			{
+				this.diagramDocumentLockHolder.SubordinateDocData.MarkDocumentChangedForBackup();
+			}
+		}
+		
+		#region Diagram file management
+		
+		/// <summary>
+		/// Save the given document that is subordinate to this document.
+		/// </summary>
+		/// <param name="subordinateDocument"></param>
+		/// <param name="fileName"></param>
+		protected override void SaveSubordinateFile(DslShell::DocData subordinateDocument, string fileName)
+		{
+			// In this case, the only subordinate is the diagram.
+			DslModeling::SerializationResult serializationResult = new DslModeling::SerializationResult();
+
+			global::System.Collections.Generic.IList<DslDiagrams::PresentationElement> diagrams = DslDiagrams::PresentationViewsSubject.GetPresentation(this.RootElement);
+			if (diagrams.Count > 0)
+			{
+				global::HeuristicLab.SimulationCore.HLSimDiagram diagram = diagrams[0] as global::HeuristicLab.SimulationCore.HLSimDiagram;
+				if (diagram != null)
+				{
+					try
+					{
+						this.SuspendFileChangeNotification(fileName);
+						
+						global::HeuristicLab.SimulationCore.HLSimSerializationHelper.Instance.SaveDiagram(serializationResult, diagram, fileName, this.Encoding, false);
+					}
+					finally
+					{
+						this.ResumeFileChangeNotification(fileName);
+					}
+				}
+			}
+			// Report serialization messages.
+			this.SuspendErrorListRefresh();
+			try
+			{
+				foreach (DslModeling::SerializationMessage serializationMessage in serializationResult)
+				{
+					this.AddErrorListItem(new DslShell::SerializationErrorListItem(this.ServiceProvider, serializationMessage));
+				}
+			}
+			finally
+			{
+				this.ResumeErrorListRefresh();
+			}
+			
+			if (!serializationResult.Failed)
+			{
+				this.NotifySubordinateDocumentSaved(subordinateDocument.FileName, fileName);
+			}
+			else
+			{	
+				// Save failed.
+				throw new global::System.InvalidOperationException(global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager.GetString("CannotSaveDocument"));
+			}						
+		}
+		
+		/// <summary>
+		/// Provide a suffix for the diagram file
+		/// </summary>
+		protected virtual string DiagramExtension
+		{
+			get
+			{
+				return Constants.DefaultDiagramExtension;
+			}
+		}
+		#endregion
+		
+		#region Base virtual overrides
+		
+		/// <summary>
+		/// Return the model in XML format
+		/// </summary>
+		protected override string SerializedModel
+		{
+			get
+			{
+				global::HeuristicLab.SimulationCore.SimulationModel modelRoot = this.RootElement as global::HeuristicLab.SimulationCore.SimulationModel;
+				string modelFile = string.Empty;
+				if (modelRoot != null)
+				{
+					modelFile = global::HeuristicLab.SimulationCore.HLSimSerializationHelper.Instance.GetSerializedModelString(modelRoot, this.Encoding);
+				}
+				return modelFile;
+			}
+		}
+		#endregion
+
+		#region Partition Support
+		/// <summary>
+		/// Get the Partition where model data will be loaded into.
+		/// Base implementation returns the default partition of the store.
+		/// </summary>
+		protected internal virtual DslModeling::Partition GetModelPartition()
+		{
+			if (this.Store != null)
+			{
+				return this.Store.DefaultPartition;
+			}
+			
+			return null;
+		}
+
+		/// <summary>
+		/// Id of the partition that contains diagram elements.
+		/// </summary>
+		protected global::System.Guid diagramPartitionId = global::System.Guid.Empty;
+		
+		/// <summary>
+		/// Get the Partition where diagram data will be loaded into.
+		/// Base implementation returns the default partition of the store.
+		/// </summary>
+		protected internal virtual DslModeling::Partition GetDiagramPartition()
+		{
+			DslModeling::Partition result = null;
+			if (this.Store != null)
+			{
+				if (this.diagramPartitionId == global::System.Guid.Empty || !this.Store.Partitions.TryGetValue(this.diagramPartitionId, out result))
+				{
+					result = new DslModeling::Partition(this.Store);
+					this.diagramPartitionId = result.Id;
+				}
+			}
+			
+			return result;
+		}
+		#endregion
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocData.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocData.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocData.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\DocData.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocView.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocView.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocView.cs	(revision 10525)
@@ -0,0 +1,162 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	internal partial class HLSimDocView : HLSimDocViewBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimDocView.
+		/// </summary>
+		public HLSimDocView(DslShell::ModelingDocData docData, global::System.IServiceProvider serviceProvider)
+			: base(docData, serviceProvider)
+		{
+		}
+	}
+
+	/// <summary>
+	/// Class that hosts the diagram surface in the Visual Studio document area.
+	/// </summary>
+	internal abstract class HLSimDocViewBase : DslShell::SingleDiagramDocView
+	{
+		/// <summary>
+		/// Constructs a new HLSimDocView.
+		/// </summary>
+		protected HLSimDocViewBase(DslShell::ModelingDocData docData, global::System.IServiceProvider serviceProvider) : base(docData, serviceProvider)
+		{
+		}
+
+		/// <summary>
+		/// Called to initialize the view after the corresponding document has been loaded.
+		/// </summary>
+		protected override bool LoadView()
+		{
+			base.LoadView();
+
+			global::System.Diagnostics.Debug.Assert(this.DocData.RootElement!=null);
+			if (this.DocData.RootElement == null)
+			{
+				return false;
+			}
+
+			// The diagram should exist in the diagram partition by now, just need to find it and connect it to this view.
+			HLSimDocDataBase docData = this.DocData as HLSimDocDataBase;
+			global::System.Diagnostics.Debug.Assert(docData != null, "DocData for HLSimDocViewBase should be an HLSimDocDataBase!");
+			DslModeling::Partition diagramPartition = docData.GetDiagramPartition();
+			if (diagramPartition != null)
+			{
+				global::System.Collections.ObjectModel.ReadOnlyCollection<global::HeuristicLab.SimulationCore.HLSimDiagram> diagrams = docData.GetDiagramPartition().ElementDirectory.FindElements<global::HeuristicLab.SimulationCore.HLSimDiagram>();
+				if (diagrams.Count > 0)
+				{
+					global::System.Diagnostics.Debug.Assert(diagrams.Count == 1, "Found more than one diagram, using the first one found.");
+					this.Diagram = (DslDiagrams::Diagram)diagrams[0];
+				}
+				else
+				{
+					return false;
+				}
+			}
+			else
+			{
+				return false;
+			}
+
+			return true;
+		}
+
+		/// <summary>
+		/// Name of the toolbox tab that should be displayed when the diagram is opened.
+		/// </summary>
+		protected override string DefaultToolboxTabName
+		{
+			get
+			{
+				return global::HeuristicLab.SimulationCore.HLSimToolboxHelper.DefaultToolboxTabName;
+			}
+		}
+		
+		/// <summary>
+		/// Returns the toolbox items count in the default tool box tab.
+		/// </summary>
+		protected override int DefaultToolboxTabToolboxItemsCount
+		{
+			get
+			{
+				return global::HeuristicLab.SimulationCore.HLSimToolboxHelper.DefaultToolboxTabToolboxItemsCount;			
+			}
+		}
+		
+		
+		/// <summary>
+		/// Context menu displayed when the user right-clicks on the design surface.
+		/// </summary>
+		protected override global::System.ComponentModel.Design.CommandID ContextMenuId
+		{
+			get
+			{
+				return Constants.HLSimDiagramMenu;
+			}
+		}
+			
+		/// <summary>
+		/// Called when selection changes in this window.
+		/// </summary>
+		/// <remarks>
+		/// Overriden to update the F1 help keyword for the selection.
+		/// </remarks>
+		/// <param name="e"></param>
+		protected override void OnSelectionChanged(global::System.EventArgs e)
+		{
+			base.OnSelectionChanged(e);
+
+			if(global::HeuristicLab.SimulationCore.HLSimHelpKeywordHelper.Instance != null)
+			{
+				DslModeling::ModelElement selectedElement = this.PrimarySelection as DslModeling::ModelElement;
+				if(selectedElement != null)
+				{
+					string f1Keyword = global::HeuristicLab.SimulationCore.HLSimHelpKeywordHelper.Instance.GetHelpKeyword(selectedElement);
+
+					// If this is a presentation element, check the underlying model element for a help keyword
+					DslDiagrams::PresentationElement presentationElement = this.PrimarySelection as DslDiagrams::PresentationElement;
+					if(presentationElement != null)
+					{
+						selectedElement = presentationElement.ModelElement;
+						if(selectedElement != null)
+						{
+							string modelElementKeyword = global::HeuristicLab.SimulationCore.HLSimHelpKeywordHelper.Instance.GetHelpKeyword(selectedElement);
+							if(string.IsNullOrEmpty(f1Keyword))
+							{
+								// Presentation element does not have an F1 keyword, so push the keyword from the model element as an F1 keyword.
+								f1Keyword = modelElementKeyword;
+							}
+							else if (!string.IsNullOrEmpty(modelElementKeyword) && this.SelectionHelpService != null)
+							{
+								// Presentation element has an F1 keyword, so push model element keyword as a general dynamic help keyword (non-F1).
+								this.SelectionHelpService.AddContextAttribute(string.Empty, modelElementKeyword, global::System.ComponentModel.Design.HelpKeywordType.GeneralKeyword);
+							}
+						}
+					}
+					
+					if(!string.IsNullOrEmpty(f1Keyword) && this.SelectionHelpService != null)
+					{
+						this.SelectionHelpService.AddContextAttribute(string.Empty, f1Keyword, global::System.ComponentModel.Design.HelpKeywordType.F1Keyword);
+					}
+				}
+			}
+		}
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocView.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocView.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/DocView.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\DocView.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/EditorFactory.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/EditorFactory.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/EditorFactory.cs	(revision 10525)
@@ -0,0 +1,63 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using VSShellInterop = global::Microsoft.VisualStudio.Shell.Interop;
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	[global::System.Runtime.InteropServices.Guid(Constants.HLSimEditorFactoryId)]
+	internal partial class HLSimEditorFactory : HLSimEditorFactoryBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimEditorFactory.
+		/// </summary>
+		public HLSimEditorFactory(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider)
+		{
+		}
+	}
+
+	/// <summary>
+	/// Factory for creating our editors
+	/// </summary>
+	internal abstract class HLSimEditorFactoryBase : DslShell::ModelingEditorFactory
+	{
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		/// <param name="serviceProvider">Service provider used to access VS services.</param>
+		protected HLSimEditorFactoryBase(global::System.IServiceProvider serviceProvider) : base(serviceProvider)
+		{
+		}
+
+		/// <summary>
+		/// Called by the shell to ask the editor to create a new document object.
+		/// </summary>
+		public override DslShell::ModelingDocData CreateDocData(string fileName, VSShellInterop::IVsHierarchy hierarchy, uint itemId)
+		{
+			// Create the document type supported by this editor.
+			return new HLSimDocData(this.ServiceProvider, typeof(HLSimEditorFactory).GUID);
+		}
+
+		/// <summary>
+		/// Called by the shell to ask the editor to create a new view object.
+		/// </summary>
+		protected override DslShell::ModelingDocView CreateDocView(DslShell::ModelingDocData docData, string physicalView, out string editorCaption)
+		{
+			// Create the view type supported by this editor.
+			editorCaption = string.Empty;
+			return new HLSimDocView(docData, this.ServiceProvider);
+		}
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/EditorFactory.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/EditorFactory.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/EditorFactory.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\EditorFactory.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/GeneratedVSCT.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/GeneratedVSCT.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/GeneratedVSCT.tt	(revision 10525)
@@ -0,0 +1,7 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#
+	// CmdSet Guid must be defined before master template is included
+	// This Guid must be kept synchronized with the CommandSetId Guid in Constants.tt
+	Guid guidCmdSet = new Guid ("2260428b-8eff-48ef-b0cd-7fbed9a201c2");
+#>
+<#@ include file="DslPackage\GeneratedVSCT.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/GeneratedVSCT.vsct
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/GeneratedVSCT.vsct	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/GeneratedVSCT.vsct	(revision 10525)
@@ -0,0 +1,117 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<!-- <auto-generated>                                                          -->
+<!-- This code was generated by a tool.                                        -->
+<!--                                                                           -->
+<!--     Changes to this file may cause incorrect behavior and will be lost if -->
+<!--     the code is regenerated.                                              -->
+<!-- </auto-generated>                                                         -->
+<!--                                                                           -->
+<!-- This file contains generated default command definitions.                 -->
+<!-- Additional command definitions should be added to Commands.vsct.          -->
+<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<Commands package="guidPkg">
+  <Menus>
+    <Menu guid="guidCmdSet" id="menuidContext" priority="0x0000" type="Context">
+      <Parent guid="guidCmdSet" id="menuidContext" />
+      <CommandFlag>AlwaysCreate</CommandFlag>
+      <Strings>
+        <CanonicalName>HLSim Designer Context Menu</CanonicalName>
+        <ButtonText>HLSim Context</ButtonText>
+      </Strings>
+    </Menu>
+    <Menu guid="guidCmdSet" id="menuidExplorer" priority="0x0000" type="Context">
+      <Parent guid="guidCmdSet" id="menuidExplorer" />
+      <CommandFlag>AlwaysCreate</CommandFlag>
+      <Strings>
+        <CanonicalName>HLSim Explorer Context Menu</CanonicalName>
+        <ButtonText>HLSim Explorer</ButtonText>
+      </Strings>
+    </Menu>
+  </Menus>
+  <Groups>
+    <Group guid="guidCmdSet" id="grpidContextMain" priority="0x0010">
+      <Parent guid="guidCmdSet" id="grpidContextMain"/>
+    </Group>
+    <Group guid="guidCmdSet" id="grpidExplorerCopyPaste" priority="0x0010">
+      <Parent guid="guidCmdSet" id="grpidExplorerCopyPaste"/>
+    </Group>
+  </Groups>
+  <Buttons>
+        <Button guid="guidCmdSet" id="cmdidViewExplorer" priority="0x0100" type="Button">
+            <Parent guid="guidSHLMainMenu" id="IDG_VS_WNDO_OTRWNDWS1"/>
+            <CommandFlag>DefaultDisabled</CommandFlag>
+            <CommandFlag>DefaultInvisible</CommandFlag>
+            <CommandFlag>DynamicVisibility</CommandFlag>
+            <Strings>
+                <ButtonText>HLSim Explorer</ButtonText>
+            </Strings>
+        </Button>
+    </Buttons>
+</Commands>
+<CommandPlacements>
+  <CommandPlacement guid="guidVSStd97" id="cmdidDelete" priority="0x0500" >
+    <Parent guid="guidCmdSet" id="grpidContextMain"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLUTION_PROPERTIES" priority="0x0500" >
+    <Parent guid="guidCmdSet" id="menuidContext"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCmdSet" id="grpidContextMain" priority="0x0010" >
+    <Parent guid="guidCmdSet" id="menuidContext"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCommonModelingMenu" id="grpidCompartmentShapeMenuGroup" priority="0x0008" >
+    <Parent guid="guidCmdSet" id="menuidContext"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCommonModelingMenu" id="grpidSwimlaneShapeMenuGroup" priority="0x0008" >
+    <Parent guid="guidCmdSet" id="menuidContext"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCommonModelingMenu" id="grpidValidateCommands" priority="0x0020" >
+    <Parent guid="guidCmdSet" id="menuidContext"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCommonModelingMenu" id="grpidLayoutMenuGroup" priority="0x0030" >
+    <Parent guid="guidCmdSet" id="menuidContext"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidVSStd97" id="cmdidCut" priority="0x0020">
+    <Parent guid="guidCmdSet" id="grpidContextMain" />
+  </CommandPlacement>
+  <CommandPlacement guid="guidVSStd97" id="cmdidCopy" priority="0x0030">
+    <Parent guid="guidCmdSet" id="grpidContextMain" />
+  </CommandPlacement>
+  <CommandPlacement guid="guidVSStd97" id="cmdidPaste" priority="0x0040">
+    <Parent guid="guidCmdSet" id="grpidContextMain" />
+  </CommandPlacement>
+  <!-- Due to a known issue in the DSL runtime, the Cut command does not work correctly from the Model Explorer, so it is deliberately omitted -->
+  <CommandPlacement guid="guidVSStd97" id="cmdidCopy" priority="0x0030">
+    <Parent guid="guidCmdSet" id="grpidExplorerCopyPaste" />
+  </CommandPlacement>
+  <CommandPlacement guid="guidVSStd97" id="cmdidPaste" priority="0x0040">
+    <Parent guid="guidCmdSet" id="grpidExplorerCopyPaste" />
+  </CommandPlacement>
+  <CommandPlacement guid="guidCmdSet" id="grpidExplorerCopyPaste" priority="0x0011" >
+    <Parent guid="guidCmdSet" id="menuidExplorer"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCommonModelingMenu" id="grpidExplorerMenuGroup" priority="0x0010" >
+    <Parent guid="guidCmdSet" id="menuidExplorer"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLUTION_PROPERTIES" priority="0x0020" >
+    <Parent guid="guidCmdSet" id="menuidExplorer"/>
+  </CommandPlacement>
+  <CommandPlacement guid="guidCommonModelingMenu" id="grpidValidateCommands" priority="0x0030" >
+    <Parent guid="guidCmdSet" id="menuidExplorer"/>
+  </CommandPlacement>
+</CommandPlacements>
+<VisibilityConstraints>
+  <VisibilityItem guid="guidCmdSet" id="cmdidViewExplorer" context="guidEditor" />
+</VisibilityConstraints>
+<Symbols>
+  <GuidSymbol name="guidPkg" value="{fab8f4d5-e0e8-4756-917b-6979bfd5ce3a}" />
+  <GuidSymbol name="guidCmdSet" value="{2260428b-8eff-48ef-b0cd-7fbed9a201c2}" >
+    <IDSymbol name="menuidContext" value="0x10000"/>
+    <IDSymbol name="grpidContextMain" value="0x20000"/>
+    <IDSymbol name="grpidExplorerCopyPaste" value="0x30000"/>
+    <IDSymbol name="menuidExplorer" value="0x10001"/>
+    <IDSymbol name="cmdidViewExplorer" value="0x0001"/>
+  </GuidSymbol>
+  <GuidSymbol name="guidEditor" value="{c6d92072-93cd-4652-9e26-052db3ad40ce}" />
+</Symbols>
+</CommandTable>
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorer.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorer.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorer.cs	(revision 10525)
@@ -0,0 +1,84 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//	 This code was generated by a tool.
+//
+//	 Changes to this file may cause incorrect behavior and will be lost if
+//	 the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	internal partial class HLSimExplorer : HLSimExplorerBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimExplorer.
+		/// </summary>
+		public HLSimExplorer(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider)
+		{
+		}
+	}
+	
+	/// <summary>
+	/// Control hosted in the HLSimExplorerToolWindow.
+	/// </summary>
+	internal abstract class HLSimExplorerBase : DslShell::ModelExplorerTreeContainer
+	{
+		/// <summary>
+		/// Constructs a new HLSimExplorerBase.
+		/// </summary>
+		protected HLSimExplorerBase(global::System.IServiceProvider serviceProvider) : base(serviceProvider)
+		{
+			
+		}
+	
+	
+	
+		/// <summary>
+		/// Create IElementVisitor
+		/// </summary>
+		/// <returns>IElementVisitor</returns>
+		protected override DslModeling::IElementVisitor CreateElementVisitor()
+		{
+			return new DslShell::ExplorerElementVisitor(this);
+		}
+	
+		/// <summary>
+		/// Specifies the context menu that should be shown for the model explorer.
+		///</summary>
+		protected override global::System.ComponentModel.Design.CommandID ContextMenuCommandId
+		{
+			get
+			{
+				return Constants.HLSimExplorerMenu;
+			}
+		}
+		
+		/// <summary>
+		/// Returns the root elements domain class Id. The is the very top level tree node in the TreeView
+		///</summary>
+		protected override global::System.Guid RootElementDomainClassId
+		{
+			get { return global::HeuristicLab.SimulationCore.SimulationModel.DomainClassId; }
+		}
+		
+		/// <summary>
+		/// Returns the root elements to be displayed in the explorer.
+		///</summary>
+		protected override global::System.Collections.IList FindRootElements(DslModeling::Store store)
+		{
+			return store.ElementDirectory.FindElements( this.RootElementDomainClassId);
+		}
+	}
+}
+	
+
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorer.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorer.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorer.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\ModelExplorer.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorerToolWindow.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorerToolWindow.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorerToolWindow.cs	(revision 10525)
@@ -0,0 +1,109 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	[global::System.Runtime.InteropServices.Guid(Constants.HLSimModelExplorerToolWindowId)]
+	internal partial class HLSimExplorerToolWindow : HLSimExplorerToolWindowBase
+	{
+		/// <summary>
+		/// Constructs a new HLSimExplorerToolWindow.
+		/// </summary>
+		public HLSimExplorerToolWindow(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider)
+		{
+		}
+	}
+
+	/// <summary>
+	/// Model explorer tool window class.
+	/// </summary>
+	internal abstract class HLSimExplorerToolWindowBase : DslShell::ModelExplorerToolWindow
+	{
+		/// <summary>
+		/// Constructor.
+		/// </summary>
+		/// <param name="serviceProvider">Service provider.</param>
+		protected HLSimExplorerToolWindowBase(global::System.IServiceProvider serviceProvider)
+			: base(serviceProvider)
+		{
+		}
+
+		/// <summary>
+		/// Specifies a resource string that appears on the tool window title bar.
+		/// </summary>
+		public override string WindowTitle
+		{
+			get
+			{
+				global::System.Resources.ResourceManager resourceManager = global::HeuristicLab.SimulationCore.HLSimDomainModel.SingletonResourceManager;
+				return resourceManager.GetString("ModelExplorerTitle");
+			}
+		}
+		
+		/// <summary>
+		/// Resource ID from VSPackage.resx containing the Model Explorer icon.
+		/// </summary>
+		protected override int BitmapResource
+		{
+			get
+			{
+				return 104;
+			}
+		}
+
+		/// <summary>
+		/// Index of tool window icon in BitmapResource.
+		/// </summary>
+		protected override int BitmapIndex
+		{
+			get { return 0; }
+		}
+		
+		/// <summary>
+		/// Creates the model explorer to be hosted in the window.
+		/// </summary>
+		/// <returns>ModelExplorerTreeContainer</returns>
+		protected override DslShell::ModelExplorerTreeContainer CreateTreeContainer()
+		{
+			return new HLSimExplorer(this);
+		}
+		
+		/// <summary>
+		/// Called when selection changes in this window.
+		/// </summary>
+		/// <remarks>
+		/// Overriden to update the F1 help keyword for the selection.
+		/// </remarks>
+		/// <param name="e"></param>
+		protected override void OnSelectionChanged(global::System.EventArgs e)
+		{
+			base.OnSelectionChanged(e);
+
+			if(global::HeuristicLab.SimulationCore.HLSimHelpKeywordHelper.Instance != null)
+			{
+				DslModeling::ModelElement selectedElement = this.PrimarySelection as DslModeling::ModelElement;
+				if(selectedElement != null)
+				{
+					string f1Keyword = global::HeuristicLab.SimulationCore.HLSimHelpKeywordHelper.Instance.GetHelpKeyword(selectedElement);
+					if (!string.IsNullOrEmpty(f1Keyword) && this.SelectionHelpService != null)
+					{
+						this.SelectionHelpService.AddContextAttribute(string.Empty, f1Keyword, global::System.ComponentModel.Design.HelpKeywordType.F1Keyword);
+					}
+				}
+			}
+		}
+	}
+}
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorerToolWindow.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorerToolWindow.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/ModelExplorerToolWindow.tt	(revision 10525)
@@ -0,0 +1,2 @@
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#@ include file="DslPackage\ModelExplorerToolWindow.tt" #>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Package.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Package.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Package.cs	(revision 10525)
@@ -0,0 +1,169 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using VSShellInterop = global::Microsoft.VisualStudio.Shell.Interop;
+using VSShell = global::Microsoft.VisualStudio.Shell;
+using DslShell = global::Microsoft.VisualStudio.Modeling.Shell;
+using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
+using DslModeling = global::Microsoft.VisualStudio.Modeling;
+using System;
+using System.Diagnostics;
+using System.Drawing.Design;
+using System.Linq;
+using System.Windows.Forms;
+	
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// This class implements the VS package that integrates this DSL into Visual Studio.
+	/// </summary>
+	[VSShell::DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\12.0")]
+	[VSShell::PackageRegistration(RegisterUsing = VSShell::RegistrationMethod.Assembly, UseManagedResourcesOnly = true)]
+	[VSShell::ProvideToolWindow(typeof(HLSimExplorerToolWindow), MultiInstances = false, Style = VSShell::VsDockStyle.Tabbed, Orientation = VSShell::ToolWindowOrientation.Right, Window = "{3AE79031-E1BC-11D0-8F78-00A0C9110057}")]
+	[VSShell::ProvideToolWindowVisibility(typeof(HLSimExplorerToolWindow), Constants.HLSimEditorFactoryId)]
+	[VSShell::ProvideStaticToolboxGroup("@HLSimToolboxTab;HeuristicLab.SimulationCore.Dsl.dll", "HeuristicLab.SimulationCore.HLSimToolboxTab")]
+	[VSShell::ProvideStaticToolboxItem("HeuristicLab.SimulationCore.HLSimToolboxTab",
+					"@ActivityToolboxItem;HeuristicLab.SimulationCore.Dsl.dll", 
+					"HeuristicLab.SimulationCore.ActivityToolboxItem", 
+					"CF_TOOLBOXITEMCONTAINER,CF_TOOLBOXITEMCONTAINER_HASH,CF_TOOLBOXITEMCONTAINER_CONTENTS", 
+					"Activity", 
+					"@ActivityToolboxBitmap;HeuristicLab.SimulationCore.Dsl.dll", 
+					0xff00ff,
+					Index = 0)]
+	[VSShell::ProvideStaticToolboxItem("HeuristicLab.SimulationCore.HLSimToolboxTab",
+					"@ActionToolboxItem;HeuristicLab.SimulationCore.Dsl.dll", 
+					"HeuristicLab.SimulationCore.ActionToolboxItem", 
+					"CF_TOOLBOXITEMCONTAINER,CF_TOOLBOXITEMCONTAINER_HASH,CF_TOOLBOXITEMCONTAINER_CONTENTS", 
+					"Action", 
+					"@ActionToolboxBitmap;HeuristicLab.SimulationCore.Dsl.dll", 
+					0xff00ff,
+					Index = 1)]
+	[VSShell::ProvideStaticToolboxItem("HeuristicLab.SimulationCore.HLSimToolboxTab",
+					"@TriggerToolboxItem;HeuristicLab.SimulationCore.Dsl.dll", 
+					"HeuristicLab.SimulationCore.TriggerToolboxItem", 
+					"CF_TOOLBOXITEMCONTAINER,CF_TOOLBOXITEMCONTAINER_HASH,CF_TOOLBOXITEMCONTAINER_CONTENTS", 
+					"Trigger", 
+					"@TriggerToolboxBitmap;HeuristicLab.SimulationCore.Dsl.dll", 
+					0xff00ff,
+					Index = 2)]
+	[VSShell::ProvideStaticToolboxItem("HeuristicLab.SimulationCore.HLSimToolboxTab",
+					"@ListenerToolboxItem;HeuristicLab.SimulationCore.Dsl.dll", 
+					"HeuristicLab.SimulationCore.ListenerToolboxItem", 
+					"CF_TOOLBOXITEMCONTAINER,CF_TOOLBOXITEMCONTAINER_HASH,CF_TOOLBOXITEMCONTAINER_CONTENTS", 
+					"Listener", 
+					"@ListenerToolboxBitmap;HeuristicLab.SimulationCore.Dsl.dll", 
+					0xff00ff,
+					Index = 3)]
+	[VSShell::ProvideEditorFactory(typeof(HLSimEditorFactory), 103, TrustLevel = VSShellInterop::__VSEDITORTRUSTLEVEL.ETL_AlwaysTrusted)]
+	[VSShell::ProvideEditorExtension(typeof(HLSimEditorFactory), "." + Constants.DesignerFileExtension, 50)]
+	[VSShell::ProvideEditorLogicalView(typeof(HLSimEditorFactory), "{7651A702-06E5-11D1-8EBD-00A0C90F26EA}")] // Designer logical view GUID i.e. VSConstants.LOGVIEWID_Designer
+	[DslShell::ProvideRelatedFile("." + Constants.DesignerFileExtension, Constants.DefaultDiagramExtension,
+		ProjectSystem = DslShell::ProvideRelatedFileAttribute.CSharpProjectGuid,
+		FileOptions = DslShell::RelatedFileType.FileName)]
+	[DslShell::ProvideRelatedFile("." + Constants.DesignerFileExtension, Constants.DefaultDiagramExtension,
+		ProjectSystem = DslShell::ProvideRelatedFileAttribute.VisualBasicProjectGuid,
+		FileOptions = DslShell::RelatedFileType.FileName)]
+	[DslShell::RegisterAsDslToolsEditor]
+	[global::System.Runtime.InteropServices.ComVisible(true)]
+	[DslShell::ProvideBindingPath]
+	[DslShell::ProvideXmlEditorChooserBlockSxSWithXmlEditor(@"HLSim", typeof(HLSimEditorFactory))]
+
+	internal abstract partial class HLSimPackageBase : DslShell::ModelingPackage
+	{
+		protected global::HeuristicLab.SimulationCore.HLSimToolboxHelper toolboxHelper;	
+		
+		/// <summary>
+		/// Initialization method called by the package base class when this package is loaded.
+		/// </summary>
+		protected override void Initialize()
+		{
+			base.Initialize();
+
+			// Register the editor factory used to create the DSL editor.
+			this.RegisterEditorFactory(new HLSimEditorFactory(this));
+			
+			// Initialize the toolbox helper
+			toolboxHelper = new global::HeuristicLab.SimulationCore.HLSimToolboxHelper(this);
+
+			// Create the command set that handles menu commands provided by this package.
+			HLSimCommandSet commandSet = new HLSimCommandSet(this);
+			commandSet.Initialize();
+			
+			// Create the command set that handles cut/copy/paste commands provided by this package.
+			HLSimClipboardCommandSet clipboardCommandSet = new HLSimClipboardCommandSet(this);
+			clipboardCommandSet.Initialize();
+			
+			// Register the model explorer tool window for this DSL.
+			this.AddToolWindow(typeof(HLSimExplorerToolWindow));
+
+			// Initialize Extension Registars
+			// this is a partial method call
+			this.InitializeExtensions();
+
+			// Add dynamic toolbox items
+			this.SetupDynamicToolbox();
+		}
+
+		/// <summary>
+		/// Partial method to initialize ExtensionRegistrars (if any) in the DslPackage
+		/// </summary>
+		partial void InitializeExtensions();
+		
+		/// <summary>
+		/// Returns any dynamic tool items for the designer
+		/// </summary>
+		/// <remarks>The default implementation is to return the list of items from the generated toolbox helper.</remarks>
+		protected override global::System.Collections.Generic.IList<DslDesign::ModelingToolboxItem> CreateToolboxItems()
+		{
+			try
+			{
+				Debug.Assert(toolboxHelper != null, "Toolbox helper is not initialized");
+				return toolboxHelper.CreateToolboxItems();
+			}
+			catch(global::System.Exception e)
+			{
+				global::System.Diagnostics.Debug.Fail("Exception thrown during toolbox item creation.  This may result in Package Load Failure:\r\n\r\n" + e);
+				throw;
+			}
+		}
+		
+		
+		/// <summary>
+		/// Given a toolbox item "unique ID" and a data format identifier, returns the content of
+		/// the data format. 
+		/// </summary>
+		/// <param name="itemId">The unique ToolboxItem to retrieve data for</param>
+		/// <param name="format">The desired format of the resulting data</param>
+		protected override object GetToolboxItemData(string itemId, DataFormats.Format format)
+		{
+			Debug.Assert(toolboxHelper != null, "Toolbox helper is not initialized");
+		
+			// Retrieve the specified ToolboxItem from the DSL
+			return toolboxHelper.GetToolboxItemData(itemId, format);
+		}
+	}
+
+}
+
+//
+// Package attributes which may need to change are placed on the partial class below, rather than in the main include file.
+//
+namespace HeuristicLab.SimulationCore
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	[VSShell::ProvideMenuResource("1000.ctmenu", 1)]
+	[VSShell::ProvideToolboxItems(1)]
+	[global::Microsoft.VisualStudio.TextTemplating.VSHost.ProvideDirectiveProcessor(typeof(global::HeuristicLab.SimulationCore.HLSimDirectiveProcessor), global::HeuristicLab.SimulationCore.HLSimDirectiveProcessor.HLSimDirectiveProcessorName, "A directive processor that provides access to HLSim files")]
+	[global::System.Runtime.InteropServices.Guid(Constants.HLSimPackageId)]
+	internal sealed partial class HLSimPackage : HLSimPackageBase
+	{
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Package.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Package.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/GeneratedCode/Package.tt	(revision 10525)
@@ -0,0 +1,35 @@
+<#
+/***************************************************************************
+         Copyright (c) Microsoft Corporation, All rights reserved.             
+    This code sample is provided "AS IS" without warranty of any kind, 
+    it is not recommended for use in a production environment.
+***************************************************************************/
+#>
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<#
+	//DSL assembly name - used for toolbox item registration. 
+	//This value is initially set to the default AssemblyName of the Dsl.csproj 
+	//If you update the DSL Assembly name, please update the following string value to the new name.
+	//Failure to do so may result in your Toolbox items not appearing correctly.
+	string dslAssembly = "HeuristicLab.SimulationCore.Dsl.dll";
+#>
+<#@ include file="DslPackage\Package.tt" #>
+<#
+	string directiveName = this.Dsl.Name;
+#>
+//
+// Package attributes which may need to change are placed on the partial class below, rather than in the main include file.
+//
+namespace <#= CodeGenerationUtilities.GetPackageNamespace(this.Dsl) #>
+{
+	/// <summary>
+	/// Double-derived class to allow easier code customization.
+	/// </summary>
+	[VSShell::ProvideMenuResource("1000.ctmenu", 1)]
+	[VSShell::ProvideToolboxItems(1)]
+	[global::Microsoft.VisualStudio.TextTemplating.VSHost.ProvideDirectiveProcessor(typeof(global::<#= this.Dsl.Namespace #>.<#= directiveName #>DirectiveProcessor), global::<#= this.Dsl.Namespace #>.<#= directiveName #>DirectiveProcessor.<#= directiveName #>DirectiveProcessorName, "A directive processor that provides access to <#= directiveName #> files")]
+	[global::System.Runtime.InteropServices.Guid(Constants.<#= dslName #>PackageId)]
+	internal sealed partial class <#= dslName #>Package : <#= dslName #>PackageBase
+	{
+	}
+}
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/CSharp.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/CSharp.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/CSharp.tt	(revision 10525)
@@ -0,0 +1,20 @@
+<#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" #>
+<#@ output extension=".vstemplate" #>
+<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\..\Dsl\DslDefinition.dsl'" #>
+<!--DSL Tools Language Template-->
+<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<TemplateData>
+		<TemplateID>{c2145997-1751-4c11-8cf6-a724b6a496d1}</TemplateID>
+		<Name Package="{<#= this.Dsl.PackageGuid #>}" ID="103"/>
+		<Description Package="{<#= this.Dsl.PackageGuid #>}" ID="102"/>
+		<Icon Package="{<#= this.Dsl.PackageGuid #>}" ID="201" />
+		<ProjectType>CSharp</ProjectType>
+		<SortOrder>360</SortOrder>
+		<DefaultName><#=  this.Dsl.Name #>.<#=this.Dsl.Editor.FileExtension#></DefaultName>
+	</TemplateData>
+	<TemplateContent>
+		<ProjectItem TargetFileName="$fileinputname$.<#=this.Dsl.Editor.FileExtension#>"><#=this.Dsl.Editor.FileExtension#>.<#=this.Dsl.Editor.FileExtension#></ProjectItem>
+		<ProjectItem TargetFileName="$fileinputname$.<#=this.Dsl.Editor.FileExtension#>.diagram"><#=this.Dsl.Editor.FileExtension#>.diagram</ProjectItem>
+	</TemplateContent>
+</VSTemplate>
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/CSharp.vstemplate
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/CSharp.vstemplate	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/CSharp.vstemplate	(revision 10525)
@@ -0,0 +1,17 @@
+﻿<!--DSL Tools Language Template-->
+<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<TemplateData>
+		<TemplateID>{c2145997-1751-4c11-8cf6-a724b6a496d1}</TemplateID>
+		<Name Package="{fab8f4d5-e0e8-4756-917b-6979bfd5ce3a}" ID="103"/>
+		<Description Package="{fab8f4d5-e0e8-4756-917b-6979bfd5ce3a}" ID="102"/>
+		<Icon Package="{fab8f4d5-e0e8-4756-917b-6979bfd5ce3a}" ID="201" />
+		<ProjectType>CSharp</ProjectType>
+		<SortOrder>360</SortOrder>
+		<DefaultName>HLSim.hlsim</DefaultName>
+	</TemplateData>
+	<TemplateContent>
+		<ProjectItem TargetFileName="$fileinputname$.hlsim">hlsim.hlsim</ProjectItem>
+		<ProjectItem TargetFileName="$fileinputname$.hlsim.diagram">hlsim.diagram</ProjectItem>
+	</TemplateContent>
+</VSTemplate>
+
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/hlsim.diagram
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/hlsim.diagram	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/hlsim.diagram	(revision 10525)
@@ -0,0 +1,1 @@
+﻿ 
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/hlsim.hlsim
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/hlsim.hlsim	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/ProjectItemTemplates/hlsim.hlsim	(revision 10525)
@@ -0,0 +1,1 @@
+﻿ 
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/Properties/AssemblyInfo.cs
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/Properties/AssemblyInfo.cs	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/Properties/AssemblyInfo.cs	(revision 10525)
@@ -0,0 +1,40 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.ConstrainedExecution;
+
+#endregion
+
+//
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle(@"")]
+[assembly: AssemblyDescription(@"")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany(@"HEAL")]
+[assembly: AssemblyProduct(@"HeuristicLab")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: System.Resources.NeutralResourcesLanguage("en")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion(@"1.0.0.0")]
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+[assembly: ReliabilityContract(Consistency.MayCorruptProcess, Cer.None)]
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/VSPackage.resx
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/VSPackage.resx	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/VSPackage.resx	(revision 10525)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="101" xml:space="preserve">
+    <value>HLSim</value>
+  </data>
+  <data name="102" xml:space="preserve">
+    <value>Adds a HeuristicLab file to the project.</value>
+  </data>
+  <data name="103" xml:space="preserve">
+    <value>HeuristicLab</value>
+  </data>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="104" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>Resources\ModelExplorerToolWindowBitmaps.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="201" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>Resources\File.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/source.extension.tt
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/source.extension.tt	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/source.extension.tt	(revision 10525)
@@ -0,0 +1,43 @@
+﻿<#@ Dsl processor="DslDirectiveProcessor" requires="fileName='..\Dsl\DslDefinition.dsl'" #>
+<#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" #>
+<#@ output extension=".vsixmanifest" #>
+<#
+/***************************************************************************
+	Rather than following the normal DSL practice of including most of the
+	template from a common include file, this template is deliberately inlined 
+	in the DslPackage project to make it easier to customise. 
+	
+	If you wish to edit the vsix manifest with its designer, then simply copy 
+	the current content of the generated manifest, delete this template from
+	the project, and add back the copied source.extension.vsixmanifest. Note
+	that if you do this you will lose automatic tracking of certain properties
+	of the DSL such as the name, description and version, and will have to 
+	edit these in your custom manifest as well should you wish to change them.
+***************************************************************************/
+
+  // The name of the Dsl Project - Must be updated if the project is renamed.
+  string dslProjectName = "Dsl";
+
+  string language = "en-US";
+#>
+<?xml version="1.0" encoding="utf-8"?>
+<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
+  <Metadata>
+    <Identity Id="<#= this.Dsl.PackageGuid #>" Version="<#= this.Dsl.MajorVersion #>.<#= this.Dsl.MinorVersion #>.<#= this.Dsl.Build #>.<#= this.Dsl.Revision #>" Language="<#= language #>" Publisher="<#= string.IsNullOrEmpty(this.Dsl.CompanyName) ? "Anon" : this.Dsl.CompanyName #>" />
+    <DisplayName><#= this.Dsl.DisplayName #></DisplayName>
+    <Description><#= this.Dsl.Description #></Description>
+  </Metadata>
+  <Installation InstalledByMsi="false">
+    <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="12.0" />
+  </Installation>
+  <Dependencies>
+    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.5" />
+    <Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="11.0" />
+  </Dependencies>
+  <Assets>
+    <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
+    <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
+    <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="<#= dslProjectName #>" Path="|<#= dslProjectName #>|" />
+    <Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="%CurrentProject%" d:TargetPath="|%CurrentProject%;TemplateProjectOutputGroup|" Path="ItemTemplates" d:VsixSubPath="ItemTemplates" />
+  </Assets>
+</PackageManifest>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/source.extension.vsixmanifest
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/source.extension.vsixmanifest	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/DslPackage/source.extension.vsixmanifest	(revision 10525)
@@ -0,0 +1,21 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
+  <Metadata>
+    <Identity Id="fab8f4d5-e0e8-4756-917b-6979bfd5ce3a" Version="1.0.0.0" Language="en-US" Publisher="HEAL" />
+    <DisplayName>HLSim</DisplayName>
+    <Description>Description for HeuristicLab.SimulationCore.HLSim</Description>
+  </Metadata>
+  <Installation InstalledByMsi="false">
+    <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="12.0" />
+  </Installation>
+  <Dependencies>
+    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.5" />
+    <Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="11.0" />
+  </Dependencies>
+  <Assets>
+    <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
+    <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
+    <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="Dsl" Path="|Dsl|" />
+    <Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="%CurrentProject%" d:TargetPath="|%CurrentProject%;TemplateProjectOutputGroup|" Path="ItemTemplates" d:VsixSubPath="ItemTemplates" />
+  </Assets>
+</PackageManifest>
Index: /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/HeuristicLab.SimulationCore.Dsl.sln
===================================================================
--- /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/HeuristicLab.SimulationCore.Dsl.sln	(revision 10525)
+++ /branches/SimulationCore/HeuristicLab.SimulationCore.Dsl/HeuristicLab.SimulationCore.Dsl.sln	(revision 10525)
@@ -0,0 +1,28 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dsl", "Dsl\Dsl.csproj", "{946658E8-06B1-4849-B14E-64721327C87F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DslPackage", "DslPackage\DslPackage.csproj", "{FE73F7F2-756D-4831-9A6E-AF562A920EEA}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{946658E8-06B1-4849-B14E-64721327C87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{946658E8-06B1-4849-B14E-64721327C87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{946658E8-06B1-4849-B14E-64721327C87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{946658E8-06B1-4849-B14E-64721327C87F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{FE73F7F2-756D-4831-9A6E-AF562A920EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FE73F7F2-756D-4831-9A6E-AF562A920EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FE73F7F2-756D-4831-9A6E-AF562A920EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FE73F7F2-756D-4831-9A6E-AF562A920EEA}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/HeuristicLab.Simulation.csproj
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/HeuristicLab.Simulation.csproj	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/HeuristicLab.Simulation.csproj	(revision 10525)
@@ -0,0 +1,87 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{BC47F1A9-FDCD-4A8A-9868-71B034CF5C80}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Simulation</RootNamespace>
+    <AssemblyName>HeuristicLab.Simulation</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.SimulationCore-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.SimulationCore-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Model.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Model.tt</DependentUpon>
+    </Compile>
+    <Compile Include="ModelImpl.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Model.hlsim" />
+    <None Include="Model.hlsim.diagram">
+      <DependentUpon>Model.hlsim</DependentUpon>
+    </None>
+    <None Include="Model.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>Model.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.cs
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.cs	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.cs	(revision 10525)
@@ -0,0 +1,142 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.SimulationCore;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Simulation {
+  [StorableClass]
+  partial class Model1 : IModel {
+    [Storable]
+    public double CurrentTime { get; set; }
+
+    private Model1(Model1 original, Cloner cloner) {
+      cloner.RegisterClonedObject(original, this);
+      CurrentTime = original.CurrentTime;
+    }
+    public Model1() { }
+
+    public object Clone() { return Clone(new Cloner()); }
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new Model1(this, cloner);
+    }
+  }
+
+  [StorableClass]
+  partial class Activity1 : HeuristicLab.SimulationCore.Activity<Model1> {
+    public override IEnumerable<Type> MonitoredActions {
+      get { return new[] { typeof(Action4) }; }
+    }
+
+    [StorableConstructor]
+    private Activity1(bool deserializing) : base(deserializing) { }
+    private Activity1(Activity1 original, Cloner cloner) : base(original, cloner) { }
+    public Activity1() : base(new SortedListEventQueue<Model1>()) { }
+
+    public override void ManageEvents(Model1 model, IAction<Model1> lastAction) {
+      if (lastAction is Action4) ProcessAction4(model, (Action4)lastAction);
+    }
+
+    private void EnqueueAction1(double time, Action1 action) {
+      EventQueue.Push(time, action);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Activity1(this, cloner);
+    }
+  }
+
+  [StorableClass]
+  partial class Activity2 : HeuristicLab.SimulationCore.Activity<Model1> {
+    public override IEnumerable<Type> MonitoredActions {
+      get { return new[] { typeof(Action1) }; }
+    }
+
+    [StorableConstructor]
+    private Activity2(bool deserializing) : base(deserializing) { }
+    private Activity2(Activity2 original, Cloner cloner) : base(original, cloner) { }
+    public Activity2() : base(new SortedListEventQueue<Model1>()) { }
+
+    public override void ManageEvents(Model1 model, IAction<Model1> lastAction) {
+      if (lastAction is Action1) ProcessAction1(model, (Action1)lastAction);
+    }
+
+    private void EnqueueAction2(double time, Action2 action) {
+      EventQueue.Push(time, action);
+    }
+    private void EnqueueAction3(double time, Action3 action) {
+      EventQueue.Push(time, action);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Activity2(this, cloner);
+    }
+  }
+
+  [StorableClass]
+  partial class Activity3 : HeuristicLab.SimulationCore.Activity<Model1> {
+    public override IEnumerable<Type> MonitoredActions {
+      get { return new[] { typeof(Action1), typeof(Action2) }; }
+    }
+
+    [StorableConstructor]
+    private Activity3(bool deserializing) : base(deserializing) { }
+    private Activity3(Activity3 original, Cloner cloner) : base(original, cloner) { }
+    public Activity3() : base(new SortedListEventQueue<Model1>()) { }
+
+    public override void ManageEvents(Model1 model, IAction<Model1> lastAction) {
+      if (lastAction is Action1) ProcessAction1(model, (Action1)lastAction);
+      if (lastAction is Action2) ProcessAction2(model, (Action2)lastAction);
+    }
+
+    private void EnqueueAction4(double time, Action4 action) {
+      EventQueue.Push(time, action);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Activity3(this, cloner);
+    }
+  }
+
+  [StorableClass]
+  partial class Action1 : HeuristicLab.SimulationCore.Action<Model1> {
+
+    private Action1(Action1 original, Cloner cloner) : base(original, cloner) { }
+    public Action1() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Action1(this, cloner);
+    }
+  }
+  [StorableClass]
+  partial class Action2 : HeuristicLab.SimulationCore.Action<Model1> {
+
+    private Action2(Action2 original, Cloner cloner) : base(original, cloner) { }
+    public Action2() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Action2(this, cloner);
+    }
+  }
+  [StorableClass]
+  partial class Action3 : HeuristicLab.SimulationCore.Action<Model1> {
+
+    private Action3(Action3 original, Cloner cloner) : base(original, cloner) { }
+    public Action3() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Action3(this, cloner);
+    }
+  }
+  [StorableClass]
+  partial class Action4 : HeuristicLab.SimulationCore.Action<Model1> {
+
+    private Action4(Action4 original, Cloner cloner) : base(original, cloner) { }
+    public Action4() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Action4(this, cloner);
+    }
+  }
+}
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.hlsim
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.hlsim	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.hlsim	(revision 10525)
@@ -0,0 +1,70 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<simulationModel xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="665fc0ee-977e-4b4b-8026-c7f8c749d6f6" modelType="Model1" xmlns="http://schemas.microsoft.com/dsltools/HLSim">
+  <activities>
+    <simulationModelHasActivities Id="0725ab4d-5364-40d2-bbc3-cd11cc5acefb">
+      <activity Id="682817c7-aaca-445a-9344-2f8b3428af08" name="Activity1">
+        <triggers>
+          <activityReferencesTriggers Id="bba04966-e003-4002-b4e5-1c8619c8d305">
+            <actionMoniker Id="ab164a10-f2c3-46a4-a872-158d907e491a" />
+          </activityReferencesTriggers>
+        </triggers>
+      </activity>
+    </simulationModelHasActivities>
+    <simulationModelHasActivities Id="0795c578-a0ce-4bac-a8dd-1a541c41ecb7">
+      <activity Id="61b860b3-349d-4c7e-bdc5-6430d810269a" name="Activity2">
+        <triggers>
+          <activityReferencesTriggers Id="f3d279ea-89e8-43ff-b89d-e035709d7cfc">
+            <actionMoniker Id="2b23d6ce-df70-4844-8b25-08e662ff3735" />
+          </activityReferencesTriggers>
+          <activityReferencesTriggers Id="1492e08e-90c8-4910-86ec-2b6de251a7d0">
+            <actionMoniker Id="99334b5f-db0c-4370-8e8e-875fc0f1c8ba" />
+          </activityReferencesTriggers>
+        </triggers>
+      </activity>
+    </simulationModelHasActivities>
+    <simulationModelHasActivities Id="093037c6-be13-4c4b-b227-d9737d5039f1">
+      <activity Id="b836c4d5-32d0-42fb-a723-92713cd57a6c" name="Activity3">
+        <triggers>
+          <activityReferencesTriggers Id="7b989248-f0f8-4d5a-97d3-25b6f237a2ab">
+            <actionMoniker Id="8c780b19-4c86-4cc4-9b75-10ca335a6898" />
+          </activityReferencesTriggers>
+        </triggers>
+      </activity>
+    </simulationModelHasActivities>
+  </activities>
+  <actions>
+    <simulationModelHasActions Id="28ff1c36-e9d2-420e-90df-086f00d6ff49">
+      <action Id="ab164a10-f2c3-46a4-a872-158d907e491a" name="Action1">
+        <listeners>
+          <actionReferencesListeners Id="80e451f3-3028-44fc-8eff-acaecfe637c3">
+            <activityMoniker Id="61b860b3-349d-4c7e-bdc5-6430d810269a" />
+          </actionReferencesListeners>
+          <actionReferencesListeners Id="e6715647-3e5e-40b7-a398-65c9557e0ab5">
+            <activityMoniker Id="b836c4d5-32d0-42fb-a723-92713cd57a6c" />
+          </actionReferencesListeners>
+        </listeners>
+      </action>
+    </simulationModelHasActions>
+    <simulationModelHasActions Id="d0dda0cc-6d0d-4e48-b41f-884f47f439c6">
+      <action Id="2b23d6ce-df70-4844-8b25-08e662ff3735" name="Action2">
+        <listeners>
+          <actionReferencesListeners Id="18ad93a7-83c3-4562-ac94-e32cd9c0b736">
+            <activityMoniker Id="b836c4d5-32d0-42fb-a723-92713cd57a6c" />
+          </actionReferencesListeners>
+        </listeners>
+      </action>
+    </simulationModelHasActions>
+    <simulationModelHasActions Id="4cbee59b-3dc5-48be-b2fc-9972a06b25f2">
+      <action Id="99334b5f-db0c-4370-8e8e-875fc0f1c8ba" name="Action3" />
+    </simulationModelHasActions>
+    <simulationModelHasActions Id="8d979b7e-cba0-4fd9-8aff-221afe88a0db">
+      <action Id="8c780b19-4c86-4cc4-9b75-10ca335a6898" name="Action4">
+        <listeners>
+          <actionReferencesListeners Id="7af3513a-2f3d-4f61-8f72-159e299f8806">
+            <activityMoniker Id="682817c7-aaca-445a-9344-2f8b3428af08" />
+          </actionReferencesListeners>
+        </listeners>
+      </action>
+    </simulationModelHasActions>
+  </actions>
+</simulationModel>
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.hlsim.diagram
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.hlsim.diagram	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.hlsim.diagram	(revision 10525)
@@ -0,0 +1,83 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<hLSimDiagram dslVersion="1.0.0.0" Id="b9d05686-efdb-4ab4-adfa-efff5fd075d7" absoluteBounds="0, 0, 11, 8.5" name="Model">
+  <simulationModelMoniker Id="665fc0ee-977e-4b4b-8026-c7f8c749d6f6" />
+  <nestedChildShapes>
+    <actionShape Id="18a2454e-e9e8-4937-9ed0-f4091e5ce293" absoluteBounds="5, 2.125, 0.75, 0.75">
+      <actionMoniker Id="ab164a10-f2c3-46a4-a872-158d907e491a" />
+    </actionShape>
+    <activityShape Id="65df2eeb-9816-414c-8003-96d05e7fb46e" absoluteBounds="2.25, 1.375, 1.625, 1">
+      <activityMoniker Id="682817c7-aaca-445a-9344-2f8b3428af08" />
+    </activityShape>
+    <activityShape Id="e9c1de6e-0859-4f76-b7c8-1fe316289e8f" absoluteBounds="1.25, 3, 1.625, 1">
+      <activityMoniker Id="61b860b3-349d-4c7e-bdc5-6430d810269a" />
+    </activityShape>
+    <actionShape Id="37be178b-1a6d-4642-b7a0-40a9953a0b77" absoluteBounds="3.75, 4.5, 0.75, 0.75">
+      <actionMoniker Id="2b23d6ce-df70-4844-8b25-08e662ff3735" />
+    </actionShape>
+    <actionShape Id="a27553f8-1e8d-4b50-ad02-c031875bb9b8" absoluteBounds="1.625, 4.625, 0.75, 0.75">
+      <actionMoniker Id="99334b5f-db0c-4370-8e8e-875fc0f1c8ba" />
+    </actionShape>
+    <activityShape Id="490b2c70-a899-421c-ba79-f7455e883ade" absoluteBounds="6, 4.75, 1.625, 1">
+      <activityMoniker Id="b836c4d5-32d0-42fb-a723-92713cd57a6c" />
+    </activityShape>
+    <actionShape Id="63751aca-f6b7-48e8-9f86-fa9fc56a772a" absoluteBounds="6.375, 2.75, 0.75, 0.75">
+      <actionMoniker Id="8c780b19-4c86-4cc4-9b75-10ca335a6898" />
+    </actionShape>
+    <trigger Id="2292af8a-a19b-433a-a9ca-51e903170446" edgePoints="[(3.875 : 2.25); (5.09549150281253 : 2.25)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <activityReferencesTriggersMoniker Id="bba04966-e003-4002-b4e5-1c8619c8d305" />
+      <nodes>
+        <activityShapeMoniker Id="65df2eeb-9816-414c-8003-96d05e7fb46e" />
+        <actionShapeMoniker Id="18a2454e-e9e8-4937-9ed0-f4091e5ce293" />
+      </nodes>
+    </trigger>
+    <listener Id="97a3814f-4444-45f9-a3a4-b63669ff4ddd" edgePoints="[(5.03410274641763 : 2.65625); (1.71875 : 2.65625); (1.71875 : 3)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <actionReferencesListenersMoniker Id="80e451f3-3028-44fc-8eff-acaecfe637c3" />
+      <nodes>
+        <actionShapeMoniker Id="18a2454e-e9e8-4937-9ed0-f4091e5ce293" />
+        <activityShapeMoniker Id="e9c1de6e-0859-4f76-b7c8-1fe316289e8f" />
+      </nodes>
+    </listener>
+    <listener Id="4067fcb9-3a04-469c-97e2-294ce91f3f77" edgePoints="[(5.375 : 2.875); (5.375 : 4.87582236842105); (6 : 4.87582236842105)]" fixedFrom="Algorithm" fixedTo="Caller">
+      <actionReferencesListenersMoniker Id="e6715647-3e5e-40b7-a398-65c9557e0ab5" />
+      <nodes>
+        <actionShapeMoniker Id="18a2454e-e9e8-4937-9ed0-f4091e5ce293" />
+        <activityShapeMoniker Id="490b2c70-a899-421c-ba79-f7455e883ade" />
+      </nodes>
+    </listener>
+    <trigger Id="11c479cb-8214-4f42-abf0-3adbaa762d09" edgePoints="[(2.875 : 3.5); (4.125 : 3.5); (4.125 : 4.5)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <activityReferencesTriggersMoniker Id="f3d279ea-89e8-43ff-b89d-e035709d7cfc" />
+      <nodes>
+        <activityShapeMoniker Id="e9c1de6e-0859-4f76-b7c8-1fe316289e8f" />
+        <actionShapeMoniker Id="37be178b-1a6d-4642-b7a0-40a9953a0b77" />
+      </nodes>
+    </trigger>
+    <trigger Id="1689d13d-8786-4dc8-aa3f-d3e3aaac1ce7" edgePoints="[(2 : 4); (2 : 4.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <activityReferencesTriggersMoniker Id="1492e08e-90c8-4910-86ec-2b6de251a7d0" />
+      <nodes>
+        <activityShapeMoniker Id="e9c1de6e-0859-4f76-b7c8-1fe316289e8f" />
+        <actionShapeMoniker Id="a27553f8-1e8d-4b50-ad02-c031875bb9b8" />
+      </nodes>
+    </trigger>
+    <listener Id="07e3e07a-7f88-4227-8f62-033041f822db" edgePoints="[(4.5 : 4.875); (4.875 : 4.875); (4.875 : 5.36171875); (6 : 5.36171875)]" fixedFrom="Algorithm" fixedTo="Caller">
+      <actionReferencesListenersMoniker Id="18ad93a7-83c3-4562-ac94-e32cd9c0b736" />
+      <nodes>
+        <actionShapeMoniker Id="37be178b-1a6d-4642-b7a0-40a9953a0b77" />
+        <activityShapeMoniker Id="490b2c70-a899-421c-ba79-f7455e883ade" />
+      </nodes>
+    </listener>
+    <trigger Id="fb3de26f-9170-409b-bb98-e1a0da63ec69" edgePoints="[(6.890625 : 4.75); (6.890625 : 3.47263430408261)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <activityReferencesTriggersMoniker Id="7b989248-f0f8-4d5a-97d3-25b6f237a2ab" />
+      <nodes>
+        <activityShapeMoniker Id="490b2c70-a899-421c-ba79-f7455e883ade" />
+        <actionShapeMoniker Id="63751aca-f6b7-48e8-9f86-fa9fc56a772a" />
+      </nodes>
+    </trigger>
+    <listener Id="f474528f-9a15-461c-961d-dd94b5379d7a" edgePoints="[(6.75 : 2.75); (6.75 : 1.71875); (3.875 : 1.71875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <actionReferencesListenersMoniker Id="7af3513a-2f3d-4f61-8f72-159e299f8806" />
+      <nodes>
+        <actionShapeMoniker Id="63751aca-f6b7-48e8-9f86-fa9fc56a772a" />
+        <activityShapeMoniker Id="65df2eeb-9816-414c-8003-96d05e7fb46e" />
+      </nodes>
+    </listener>
+  </nestedChildShapes>
+</hLSimDiagram>
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.tt
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.tt	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Model.tt	(revision 10525)
@@ -0,0 +1,94 @@
+﻿<#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" #>
+<#@ output extension=".cs" #>
+<#@ assembly name="System.Core" #>
+<#@ import namespace="System.Linq" #>
+<#@ HLSim processor="HLSimDirectiveProcessor" requires="fileName='Model.hlsim'" #>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.SimulationCore;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Simulation {
+  [StorableClass]
+  partial class <#=this.SimulationModel.ModelType#> : IModel {
+    [Storable]
+    public double CurrentTime { get; set; }
+
+    private <#=this.SimulationModel.ModelType#>(<#=this.SimulationModel.ModelType#> original, Cloner cloner) {
+      cloner.RegisterClonedObject(original, this);
+      CurrentTime = original.CurrentTime;
+    }
+    public <#=this.SimulationModel.ModelType#>() { }
+
+    public object Clone() { return Clone(new Cloner()); }
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new <#=this.SimulationModel.ModelType#>(this, cloner);
+    }
+  }
+
+<#
+  // When you change the DSL Definition, some of the code below may not work.
+
+  foreach (var activity in this.SimulationModel.Activities)
+  {
+#>
+  [StorableClass]
+  partial class <#=activity.Name#> : HeuristicLab.SimulationCore.Activity<<#=this.SimulationModel.ModelType#>> {
+    public override IEnumerable<Type> MonitoredActions {
+      get { return new[] { <#=string.Join(", ", activity.Actions.Select(x => "typeof(" + x.Name + ")"))#> }; }
+    }
+
+    [StorableConstructor]
+    private <#=activity.Name#>(bool deserializing) : base(deserializing) { }
+    private <#=activity.Name#>(<#=activity.Name#> original, Cloner cloner) : base(original, cloner) { }
+    public <#=activity.Name#>() : base(new SortedListEventQueue<<#=this.SimulationModel.ModelType#>>()) { }
+
+    public override void ManageEvents(<#=this.SimulationModel.ModelType#> model, IAction<<#=this.SimulationModel.ModelType#>> lastAction) {
+<#
+    foreach (var action in activity.Actions)
+	{
+#>
+      if (lastAction is <#=action.Name#>) Process<#=action.Name#>(model, (<#=action.Name#>)lastAction);
+<#
+    }
+#>
+    }
+
+<#
+    foreach (var action in activity.Triggers)
+	{
+#>
+    private void Enqueue<#=action.Name#>(double time, <#=action.Name#> action) {
+      EventQueue.Push(time, action);
+    }
+<#
+    }
+#>
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new <#=activity.Name#>(this, cloner);
+    }
+  }
+
+<#    
+  }
+
+  foreach (var action in this.SimulationModel.Actions)
+  {
+#>
+  [StorableClass]
+  partial class <#=action.Name#> : HeuristicLab.SimulationCore.Action<<#=this.SimulationModel.ModelType#>> {
+
+    private <#=action.Name#>(<#=action.Name#> original, Cloner cloner) : base(original, cloner) { }
+    public <#=action.Name#>() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new <#=action.Name#>(this, cloner);
+    }
+  }
+<#    
+  }
+#>
+}
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/ModelImpl.cs
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/ModelImpl.cs	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/ModelImpl.cs	(revision 10525)
@@ -0,0 +1,55 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.SimulationCore;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Simulation {
+    partial class Activity1 {
+        private void ProcessAction4(Model1 model, Action4 lastAction) {
+            EnqueueAction1(model.CurrentTime + 1, new Action1());
+        }
+    }
+
+    partial class Activity2 {
+        private void ProcessAction1(Model1 model, Action1 lastAction) {
+            if (model.CurrentTime < 10) EnqueueAction2(model.CurrentTime + 1, new Action2());
+            else EnqueueAction3(model.CurrentTime + 1, new Action3());
+        }
+    }
+
+    partial class Activity3 {
+        private void ProcessAction1(Model1 model, Action1 lastAction) {
+            EnqueueAction4(model.CurrentTime + 1, new Action4());
+        }
+
+        private void ProcessAction2(Model1 model, Action2 lastAction) {
+            EnqueueAction4(model.CurrentTime + 1, new Action4());
+        }
+    }
+
+    partial class Action1 {
+        public override void Execute(Model1 model) {
+
+        }
+    }
+
+    partial class Action2 {
+        public override void Execute(Model1 model) {
+
+        }
+    }
+
+    partial class Action3 {
+        public override void Execute(Model1 model) {
+
+        }
+    }
+
+    partial class Action4 {
+        public override void Execute(Model1 model) {
+
+        }
+    }
+}
Index: /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Properties/AssemblyInfo.cs
===================================================================
--- /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Properties/AssemblyInfo.cs	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/HeuristicLab.Simulation/Properties/AssemblyInfo.cs	(revision 10525)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Simulation")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("FH-Hagenberg")]
+[assembly: AssemblyProduct("HeuristicLab.Simulation")]
+[assembly: AssemblyCopyright("Copyright © FH-Hagenberg 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c1575573-7c52-4832-8ffb-9a2f1e1dfd73")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /branches/SimulationCore/SimulationSolution/SimulationSolution.sln
===================================================================
--- /branches/SimulationCore/SimulationSolution/SimulationSolution.sln	(revision 10525)
+++ /branches/SimulationCore/SimulationSolution/SimulationSolution.sln	(revision 10525)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Simulation", "HeuristicLab.Simulation\HeuristicLab.Simulation.csproj", "{BC47F1A9-FDCD-4A8A-9868-71B034CF5C80}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{BC47F1A9-FDCD-4A8A-9868-71B034CF5C80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BC47F1A9-FDCD-4A8A-9868-71B034CF5C80}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BC47F1A9-FDCD-4A8A-9868-71B034CF5C80}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BC47F1A9-FDCD-4A8A-9868-71B034CF5C80}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
