Click here to Skip to main content
15,884,176 members
Articles / Programming Languages / C#

Xmi CodeDom Library, Part 2 - Using dynamic types to increase performance

Rate me:
Please Sign up or sign in to vote.
4.11/5 (5 votes)
30 May 2006CPOL10 min read 42.4K   543   18  
A .Net 2.0 library that converts XMI into CodeDom. Part 2 shows how CodeDom was used to create dynamic types to outperform the reflection-based parsing.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{ED6448FB-25B2-4846-80CB-16EE4438DA59}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>XmiCodeDomLib</RootNamespace>
    <AssemblyName>XmiCodeDomLib</AssemblyName>
    <SignAssembly>True</SignAssembly>
    <AssemblyOriginatorKeyFile>XmiCodeDomLib.snk</AssemblyOriginatorKeyFile>
    <DelaySign>False</DelaySign>
    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
  </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="CppCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
    <Reference Include="Microsoft.JScript" />
    <Reference Include="Microsoft.VisualBasic" />
    <Reference Include="Microsoft.VisualC.VSCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="VJSharpCodeProvider" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="ICodeModel.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Version1_0\IFoundationCoreClassifier.cs" />
    <Compile Include="Version1_0\IFoundationCoreGeneralizableElement.cs" />
    <Compile Include="Version1_0\IFoundationCoreModelElement.cs" />
    <Compile Include="Version1_0\IFoundationCoreNamespace.cs" />
    <Compile Include="Version1_0\XmiAttribute.cs" />
    <Compile Include="Version1_0\XmiBaseClass.cs" />
    <Compile Include="Version1_0\XmiClass.cs" />
    <Compile Include="Version1_0\XmiModel.cs" />
    <Compile Include="XmiRoot.cs" />
    <Compile Include="ReflectionXmiParser.cs" />
    <Compile Include="XmiParserAttribute.cs" />
    <Compile Include="Version1_0\XmiDataType.cs" />
    <Compile Include="Version1_0\CodeDomHelper.cs" />
    <Compile Include="Version1_0\IFoundationCoreStructuralFeature.cs" />
    <Compile Include="Version1_0\XmiOperation.cs" />
    <Compile Include="Version1_0\XmiOperationParameter.cs" />
    <Compile Include="Version1_0\IFoundationCoreBehavioralFeature.cs" />
    <Compile Include="Version1_0\XmiGeneralization.cs" />
    <Compile Include="Version1_0\XmiMultRange.cs" />
    <Compile Include="Version1_0\XmiMult.cs" />
    <Compile Include="Version1_0\XmiAssociationEnd.cs" />
    <Compile Include="Version1_0\XmiAssociation.cs" />
    <Compile Include="Version1_2\XmiBaseClass.cs" />
    <Compile Include="Version1_2\IGeneralizableElement.cs" />
    <Compile Include="Version1_2\IModelElement.cs" />
    <Compile Include="Version1_2\XmiModel.cs" />
    <Compile Include="Version1_2\INamespace.cs" />
    <Compile Include="Version1_2\XmiClass.cs" />
    <Compile Include="Version1_2\IClassifier.cs" />
    <Compile Include="Version1_2\CodeDomHelper.cs" />
    <Compile Include="Version1_2\XmiAttribute.cs" />
    <Compile Include="Version1_2\IStructuralFeature.cs" />
    <Compile Include="Version1_2\XmiDataType.cs" />
    <Compile Include="Version1_2\XmiGeneralization.cs" />
    <Compile Include="Version1_2\IBehavioralFeature.cs" />
    <Compile Include="Version1_2\XmiOperationParameter.cs" />
    <Compile Include="Version1_2\XmiOperation.cs" />
    <Compile Include="Version1_2\IFeature.cs" />
    <Compile Include="Version1_2\XmiMultRange.cs" />
    <Compile Include="Version1_2\XmiMult.cs" />
    <Compile Include="Version1_2\XmiAssociationEnd.cs" />
    <Compile Include="Version1_2\XmiAssociation.cs" />
    <Compile Include="IXmiParser.cs" />
    <Compile Include="XmiParserFactory.cs" />
    <Compile Include="CodeDomXmiParser.cs" />
    <Compile Include="CodeDomSwitchXmiParser.cs" />
    <Compile Include="CodeDomOptimizedXmiParser.cs" />
    <Compile Include="XmiAttributeAttribute.cs" />
    <Compile Include="Version1_0\XmiInterface.cs" />
    <Compile Include="Version1_0\XmiAbstraction.cs" />
    <Compile Include="Version1_0\IFoundationCoreDependency.cs" />
    <Compile Include="XmiIgnoreAttribute.cs" />
    <Compile Include="Version1_0\IFoundationCoreFeature.cs" />
    <Compile Include="Version1_2\XmiInterface.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Version1_2" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions