From: Chris M. <cm...@us...> - 2006-07-12 09:15:29
|
User: cmicali Date: 06/07/12 02:15:28 Modified: etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn AddInSettings.cs AndroMDA.VS80AddIn.csproj etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands CreateEntityVOConvertorCommand.cs PropertyMapperCommand.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs PropertyMapperDialog.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Utils AddInUtils.cs CodeModelUtils.cs Added: etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn ConversionCodeGenerator.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Controls MDAProjectSetupControl.cs MDAProjectSetupControl.designer.cs MDAProjectSetupControl.resx ScrollableListView.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/OptionsPages AboutOptionsPage.cs AboutOptionsPage.designer.cs AboutOptionsPage.resx ExternalToolsOptionsPage.cs ExternalToolsOptionsPage.designer.cs ExternalToolsOptionsPage.resx GeneralOptionsPage.Designer.cs GeneralOptionsPage.cs GeneralOptionsPage.resx MDAOptionPageProperties.cs SolutionExplorerOptionsPage.Designer.cs SolutionExplorerOptionsPage.cs SolutionExplorerOptionsPage.resx etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Resources link_break.gif etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Wizards MDASolutionWizard.cs MDASolutionWizard.designer.cs MDASolutionWizard.resx WelcomeWizard.Designer.cs WelcomeWizard.cs WelcomeWizard.resx etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Wizards/Support Header.cs Header.resx HeaderDesigner.cs InfoContainer.cs InfoContainer.resx InfoContainerDesigner.cs InfoPage.cs InfoPage.resx InfoPageDesigner.cs PageCollection.cs PageEventHandler.cs Wizard.bmp Wizard.cs Wizard.resx WizardDesigner.cs WizardPage.cs WizardPage.resx WizardPageDesigner.cs wizBigOnlineFolder.gif Removed: etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs AboutOptionsPage.cs AboutOptionsPage.designer.cs AboutOptionsPage.resx ExternalToolsOptionsPage.cs ExternalToolsOptionsPage.designer.cs ExternalToolsOptionsPage.resx GeneralOptionsPage.Designer.cs GeneralOptionsPage.cs GeneralOptionsPage.resx MDAOptionPageProperties.cs MDAProjectSetupControl.cs MDAProjectSetupControl.designer.cs MDAProjectSetupControl.resx MDASolutionWizard.cs MDASolutionWizard.designer.cs MDASolutionWizard.resx ScrollableListView.cs SolutionExplorerOptionsPage.Designer.cs SolutionExplorerOptionsPage.cs SolutionExplorerOptionsPage.resx WelcomeWizard.Designer.cs WelcomeWizard.cs WelcomeWizard.resx etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Wizard Header.cs Header.resx HeaderDesigner.cs InfoContainer.cs InfoContainer.resx InfoContainerDesigner.cs InfoPage.cs InfoPage.resx InfoPageDesigner.cs PageCollection.cs PageEventHandler.cs Wizard.bmp Wizard.cs Wizard.resx WizardDesigner.cs WizardPage.cs WizardPage.resx WizardPageDesigner.cs wizBigOnlineFolder.gif Log: - Reorganized files to make source folder divisions much cleaner - Updates to propertymapper Revision Changes Path 1.11 +10 -0 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AddInSettings.cs Index: AddInSettings.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AddInSettings.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- AddInSettings.cs 11 Jul 2006 13:45:33 -0000 1.10 +++ AddInSettings.cs 12 Jul 2006 09:14:57 -0000 1.11 @@ -282,6 +282,16 @@ #endregion + #region Property mapper settings + + public bool PropertyMapperAutoMapOnOpen + { + get { return m_settings.GetBool("AMDAPMAMOO", false); } + set { m_settings.SetBool("AMDAPMAMOO", value); } + } + + #endregion + #region Helper methods public bool IsInIgnoreList(string fileToTest) 1.17 +82 -81 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn.csproj Index: AndroMDA.VS80AddIn.csproj =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn.csproj,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -r1.16 -r1.17 --- AndroMDA.VS80AddIn.csproj 11 Jul 2006 13:45:33 -0000 1.16 +++ AndroMDA.VS80AddIn.csproj 12 Jul 2006 09:14:57 -0000 1.17 @@ -67,72 +67,61 @@ <Compile Include="Commands\StopCommand.cs" /> <Compile Include="ConfigFile.cs" /> <Compile Include="Connect.cs" /> + <Compile Include="Controls\MDAProjectSetupControl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="Controls\MDAProjectSetupControl.designer.cs"> + <DependentUpon>MDAProjectSetupControl.cs</DependentUpon> + </Compile> + <Compile Include="Controls\ScrollableListView.cs"> + <SubType>Component</SubType> + </Compile> + <Compile Include="ConversionCodeGenerator.cs" /> <Compile Include="Dialogs\AboutDialog.cs"> <SubType>Form</SubType> </Compile> <Compile Include="Dialogs\AboutDialog.designer.cs"> <DependentUpon>AboutDialog.cs</DependentUpon> </Compile> - <Compile Include="Dialogs\AboutOptionsPage.cs"> - <SubType>UserControl</SubType> + <Compile Include="Dialogs\PropertyMapperDialog.cs"> + <SubType>Form</SubType> </Compile> - <Compile Include="Dialogs\AboutOptionsPage.designer.cs"> - <DependentUpon>AboutOptionsPage.cs</DependentUpon> + <Compile Include="Dialogs\PropertyMapperDialog.Designer.cs"> + <DependentUpon>PropertyMapperDialog.cs</DependentUpon> </Compile> - <Compile Include="Dialogs\GeneralOptionsPage.cs"> + <Compile Include="MavenProxy.cs" /> + <Compile Include="MDAProject.cs" /> + <Compile Include="MDASolutionManager.cs" /> + <None Include="Resources\Membership\DomainMembershipProvider.cs" /> + <None Include="Resources\Membership\DomainMembershipUser.cs" /> + <None Include="Resources\Membership\DomainRoleProvider.cs" /> + <None Include="Resources\Membership\MembershipServiceImpl.cs" /> + <None Include="Resources\Membership\UserDaoImpl.cs" /> + <Compile Include="OptionsPages\AboutOptionsPage.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Dialogs\GeneralOptionsPage.Designer.cs"> - <DependentUpon>GeneralOptionsPage.cs</DependentUpon> + <Compile Include="OptionsPages\AboutOptionsPage.designer.cs"> + <DependentUpon>AboutOptionsPage.cs</DependentUpon> </Compile> - <Compile Include="Dialogs\MDAOptionPageProperties.cs" /> - <Compile Include="Dialogs\ExternalToolsOptionsPage.cs"> + <Compile Include="OptionsPages\ExternalToolsOptionsPage.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Dialogs\ExternalToolsOptionsPage.designer.cs"> + <Compile Include="OptionsPages\ExternalToolsOptionsPage.designer.cs"> <DependentUpon>ExternalToolsOptionsPage.cs</DependentUpon> </Compile> - <Compile Include="Dialogs\MDAProjectSetupControl.cs"> + <Compile Include="OptionsPages\GeneralOptionsPage.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Dialogs\MDAProjectSetupControl.designer.cs"> - <DependentUpon>MDAProjectSetupControl.cs</DependentUpon> - </Compile> - <Compile Include="Dialogs\MDASolutionWizard.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Dialogs\MDASolutionWizard.designer.cs"> - <DependentUpon>MDASolutionWizard.cs</DependentUpon> - </Compile> - <Compile Include="Dialogs\PropertyMapperDialog.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Dialogs\PropertyMapperDialog.Designer.cs"> - <DependentUpon>PropertyMapperDialog.cs</DependentUpon> - </Compile> - <Compile Include="Dialogs\ScrollableListView.cs"> - <SubType>Component</SubType> + <Compile Include="OptionsPages\GeneralOptionsPage.designer.cs"> + <DependentUpon>GeneralOptionsPage.cs</DependentUpon> </Compile> - <Compile Include="Dialogs\SolutionExplorerOptionsPage.cs"> + <Compile Include="OptionsPages\MDAOptionPageProperties.cs" /> + <Compile Include="OptionsPages\SolutionExplorerOptionsPage.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Dialogs\SolutionExplorerOptionsPage.Designer.cs"> + <Compile Include="OptionsPages\SolutionExplorerOptionsPage.designer.cs"> <DependentUpon>SolutionExplorerOptionsPage.cs</DependentUpon> </Compile> - <Compile Include="Dialogs\WelcomeWizard.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Dialogs\WelcomeWizard.Designer.cs"> - <DependentUpon>WelcomeWizard.cs</DependentUpon> - </Compile> - <Compile Include="MavenProxy.cs" /> - <Compile Include="MDAProject.cs" /> - <Compile Include="MDASolutionManager.cs" /> - <None Include="Resources\Membership\DomainMembershipProvider.cs" /> - <None Include="Resources\Membership\DomainMembershipUser.cs" /> - <None Include="Resources\Membership\DomainRoleProvider.cs" /> - <None Include="Resources\Membership\MembershipServiceImpl.cs" /> - <None Include="Resources\Membership\UserDaoImpl.cs" /> <Compile Include="Utils\CodeModelUtils.cs" /> <Compile Include="WizardSolutionProcessor.cs" /> <Compile Include="AddInSettings.cs" /> @@ -181,28 +170,40 @@ <Compile Include="Utils\VSExternalToolProxy.cs" /> <Compile Include="Utils\VSSolutionUtils.cs" /> <Compile Include="VS80AddIn.cs" /> - <Compile Include="Wizard\Header.cs"> + <Compile Include="Wizards\MDASolutionWizard.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Wizards\MDASolutionWizard.designer.cs"> + <DependentUpon>MDASolutionWizard.cs</DependentUpon> + </Compile> + <Compile Include="Wizards\Support\Header.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Wizard\HeaderDesigner.cs" /> - <Compile Include="Wizard\InfoContainer.cs"> + <Compile Include="Wizards\Support\HeaderDesigner.cs" /> + <Compile Include="Wizards\Support\InfoContainer.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Wizard\InfoContainerDesigner.cs" /> - <Compile Include="Wizard\InfoPage.cs"> + <Compile Include="Wizards\Support\InfoContainerDesigner.cs" /> + <Compile Include="Wizards\Support\InfoPage.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Wizard\InfoPageDesigner.cs" /> - <Compile Include="Wizard\PageCollection.cs" /> - <Compile Include="Wizard\PageEventHandler.cs" /> - <Compile Include="Wizard\Wizard.cs"> + <Compile Include="Wizards\Support\InfoPageDesigner.cs" /> + <Compile Include="Wizards\Support\PageCollection.cs" /> + <Compile Include="Wizards\Support\PageEventHandler.cs" /> + <Compile Include="Wizards\Support\Wizard.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Wizard\WizardDesigner.cs" /> - <Compile Include="Wizard\WizardPage.cs"> + <Compile Include="Wizards\Support\WizardDesigner.cs" /> + <Compile Include="Wizards\Support\WizardPage.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Wizard\WizardPageDesigner.cs" /> + <Compile Include="Wizards\Support\WizardPageDesigner.cs" /> + <Compile Include="Wizards\WelcomeWizard.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Wizards\WelcomeWizard.designer.cs"> + <DependentUpon>WelcomeWizard.cs</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <COMReference Include="EnvDTE"> @@ -239,67 +240,67 @@ </COMReference> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="Controls\MDAProjectSetupControl.resx"> + <DependentUpon>MDAProjectSetupControl.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="Dialogs\AboutDialog.resx"> <DependentUpon>AboutDialog.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Dialogs\AboutOptionsPage.resx"> - <DependentUpon>AboutOptionsPage.cs</DependentUpon> + <EmbeddedResource Include="Dialogs\PropertyMapperDialog.resx"> <SubType>Designer</SubType> + <DependentUpon>PropertyMapperDialog.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Dialogs\GeneralOptionsPage.resx"> + <EmbeddedResource Include="OptionsPages\AboutOptionsPage.resx"> + <DependentUpon>AboutOptionsPage.cs</DependentUpon> <SubType>Designer</SubType> - <DependentUpon>GeneralOptionsPage.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Dialogs\ExternalToolsOptionsPage.resx"> + <EmbeddedResource Include="OptionsPages\ExternalToolsOptionsPage.resx"> <DependentUpon>ExternalToolsOptionsPage.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Dialogs\MDAProjectSetupControl.resx"> - <DependentUpon>MDAProjectSetupControl.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - <EmbeddedResource Include="Dialogs\MDASolutionWizard.resx"> - <DependentUpon>MDASolutionWizard.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - <EmbeddedResource Include="Dialogs\PropertyMapperDialog.resx"> + <EmbeddedResource Include="OptionsPages\GeneralOptionsPage.resx"> + <DependentUpon>GeneralOptionsPage.cs</DependentUpon> <SubType>Designer</SubType> - <DependentUpon>PropertyMapperDialog.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Dialogs\SolutionExplorerOptionsPage.resx"> - <SubType>Designer</SubType> + <EmbeddedResource Include="OptionsPages\SolutionExplorerOptionsPage.resx"> <DependentUpon>SolutionExplorerOptionsPage.cs</DependentUpon> - </EmbeddedResource> - <EmbeddedResource Include="Dialogs\WelcomeWizard.resx"> <SubType>Designer</SubType> - <DependentUpon>WelcomeWizard.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="Resource1.resx"> <SubType>Designer</SubType> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resource1.Designer.cs</LastGenOutput> </EmbeddedResource> - <EmbeddedResource Include="Wizard\Header.resx"> + <EmbeddedResource Include="Wizards\MDASolutionWizard.resx"> + <DependentUpon>MDASolutionWizard.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="Wizards\Support\Header.resx"> <DependentUpon>Header.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Wizard\InfoContainer.resx"> + <EmbeddedResource Include="Wizards\Support\InfoContainer.resx"> <DependentUpon>InfoContainer.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Wizard\InfoPage.resx"> + <EmbeddedResource Include="Wizards\Support\InfoPage.resx"> <DependentUpon>InfoPage.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Wizard\Wizard.resx"> + <EmbeddedResource Include="Wizards\Support\Wizard.resx"> <DependentUpon>Wizard.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="Wizard\WizardPage.resx"> + <EmbeddedResource Include="Wizards\Support\WizardPage.resx"> <DependentUpon>WizardPage.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="Wizards\WelcomeWizard.resx"> + <DependentUpon>WelcomeWizard.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> </ItemGroup> <ItemGroup> <Content Include="AndroMDA.VS80AddIn.AddIn"> 1.1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/ConversionCodeGenerator.cs Index: ConversionCodeGenerator.cs =================================================================== // AndroMDA Visual Studio 2005 Add-In // (c)2006 AndroMDA.org #region Using statements using System; using System.Collections; using System.Text; using EnvDTE80; using EnvDTE; #endregion namespace AndroMDA.VS80AddIn { public class ConversionCodeGenerator { #region Property class public class Property { private string m_name; private string m_type; private Property m_sourceProperty; public Property() { m_name = string.Empty; m_type = string.Empty; m_sourceProperty = null; } public Property(string name, string type) { m_name = name; m_type = type; m_sourceProperty = null; } public string Name { get { return m_name; } set { m_name = value; } } public string Type { get { return m_type; } set { m_type = value; } } public Property SourceProperty { get { return m_sourceProperty; } set { m_sourceProperty = value; } } public bool IsNullableType { get { return m_type.EndsWith("?"); } } } #endregion private ArrayList m_properties; public ArrayList Properties { get { return m_properties; } set { m_properties = value; } } public ConversionCodeGenerator() { m_properties = new ArrayList(); ; } public ConversionCodeGenerator(ArrayList properties) { m_properties = properties; } public string GenerateCode(CodeFunction2 method) { CodeParameter2 param = method.Parameters.Item(1) as CodeParameter2; CodeClass2 containingClass = method.Parent as CodeClass2; string returnType = method.Type.AsFullName; string paramType = param.Type.AsFullName; string paramName = param.Name; string returnVariableName = string.Empty; string codeToInsert = string.Empty; bool convertingToEntity = CodeModelUtils.IsEntityClass(method.Type.CodeType); // If we are converting to an entity if (convertingToEntity) { returnVariableName = "entity"; codeToInsert += "// VO to entity conversion\n"; // Add code to create a new entity with the Factory.newInstance() method codeToInsert += returnType + " " + returnVariableName + " = " + returnType + ".Factory.newInstance();\n\n"; } else { returnVariableName = "valueObject"; codeToInsert += "// Entity to VO conversion\n\n"; // Add code to create a new VO with a new statement codeToInsert += returnType + " " + returnVariableName + " = new " + returnType + "();\n\n"; } ArrayList unmappedProperties = new ArrayList(); foreach (Property prop in m_properties) { if (prop.SourceProperty != null) { if (prop.IsNullableType) { codeToInsert += "if (" + paramName + "." +prop.Name + ".HasValue)\n{\n"; codeToInsert += returnVariableName + "." + prop.Name + " = " + paramName + "." + prop.SourceProperty.Name + ".Value;\n}\n"; } else { codeToInsert += returnVariableName + "." + prop.Name + " = " + paramName + "." + prop.SourceProperty.Name + ";\n"; } } else { unmappedProperties.Add(prop); } } foreach (Property unmappedProp in unmappedProperties) { codeToInsert += "// " + returnVariableName + "." + unmappedProp.Name + "\n"; } // Add the return statement codeToInsert += "\nreturn " + returnVariableName + ";\n\n"; return codeToInsert; } public void AddProperty(string toName, string toType) { m_properties.Add(CreateProperty(toName, toType)); } public void AddProperty(string toName, string toType, string fromName, string fromType) { m_properties.Add(CreateProperty(toName, toType, fromName, fromType)); } public static Property CreateProperty(string toName, string toType) { return new Property(toName, toType); } public static Property CreateProperty(string toName, string toType, string fromName, string fromType) { Property prop = new Property(toName, toType); prop.SourceProperty = new Property(fromName, fromType); return prop; } } } 1.5 +34 -92 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/CreateEntityVOConvertorCommand.cs Index: CreateEntityVOConvertorCommand.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/CreateEntityVOConvertorCommand.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- CreateEntityVOConvertorCommand.cs 11 Jul 2006 13:45:34 -0000 1.4 +++ CreateEntityVOConvertorCommand.cs 12 Jul 2006 09:14:57 -0000 1.5 @@ -31,101 +31,43 @@ CodeFunction2 currentMethod = CodeModelUtils.GetCurrentMethod(m_application); if (IsCommandAvailable(currentMethod)) { - CodeParameter2 param = currentMethod.Parameters.Item(1) as CodeParameter2; - CodeClass2 containingClass = currentMethod.Parent as CodeClass2; - bool isEntity = false; - string returnType = currentMethod.Type.AsFullName; - string paramType = param.Type.AsFullName; - string returnVariableName = string.Empty; - string codeToInsert = string.Empty; - - // Search for a Factory property in the return type to see if - // we are converting from entity to vo or vo to entity - foreach (CodeElement2 prop in currentMethod.Type.CodeType.Members) - { - if (prop.Kind == vsCMElement.vsCMElementClass && - prop.Name == "Factory" - ) - { - isEntity = true; - break; - } - } - // If we are converting to an entity - if (isEntity) - { - returnVariableName = "entity"; - codeToInsert += "// VO to entity conversion\n"; - // Add code to create a new entity with the Factory.newInstance() method - codeToInsert += returnType + " " + returnVariableName + " = " + returnType + ".Factory.newInstance();\n\n"; - } - else - { - returnVariableName = "valueObject"; - codeToInsert += "// Entity to VO conversion\n\n"; - // Add code to create a new VO with a new statement - codeToInsert += returnType + " " + returnVariableName + " = new " + returnType + "();\n\n"; - } + ConversionCodeGenerator codeGenerator = new ConversionCodeGenerator(); - ArrayList uncopiedProperties = new ArrayList(); - ArrayList unmatchedProperties = new ArrayList(); + CodeParameter2 param = currentMethod.Parameters.Item(1) as CodeParameter2; + ArrayList toProperties = CodeModelUtils.GetPropertiesFromType(currentMethod.Type.CodeType); + ArrayList fromProperties = CodeModelUtils.GetPropertiesFromType(param.Type.CodeType); - // Iterate through each property of the return type - foreach (CodeElement2 dstProp in currentMethod.Type.CodeType.Members) - { - if (dstProp.Kind == vsCMElement.vsCMElementProperty) + foreach(CodeProperty toProperty in toProperties) { - bool propertyExists = false; - bool propertyCopied = false; - // Iterate through each property of the parameter type to find a match - foreach (CodeElement2 srcProp in param.Type.CodeType.Members) - { - // If we found a property of the same name - if (dstProp.Kind == vsCMElement.vsCMElementProperty && - dstProp.Name == srcProp.Name) + bool mapped = false; + string toName = toProperty.Name; + string toNameNoDots = toName.Replace(".", string.Empty); + string toType = toProperty.Type.AsFullName; + + foreach (CodeProperty fromProperty in fromProperties) { - // Mark that we found the property - propertyExists = true; - CodeProperty srcProperty = srcProp as CodeProperty; - CodeProperty dstProperty = dstProp as CodeProperty; - if (dstProperty.Type.AsString == srcProperty.Type.AsString) + string fromName = fromProperty.Name; + string fromNameNoDots = fromName.Replace(".", string.Empty); + if (fromName == toName || fromName == toNameNoDots || fromNameNoDots == toNameNoDots) { - // Insert simple copy code - codeToInsert += returnVariableName + "." + dstProp.Name + " = " + param.Name + "." + dstProp.Name + ";\n"; - // Mark that we have copied the property - propertyCopied = true; - } - } - } - // If the property exists in both the entity and the vo - // but the types differ - if (propertyExists && !propertyCopied) + string fromType = fromProperty.Type.AsFullName; + if (fromType.Replace("?", string.Empty) == toType.Replace("?", string.Empty)) { - // Add it to the uncopied properties list - uncopiedProperties.Add(dstProp.Name); - } - else if (!propertyExists) - { - unmatchedProperties.Add(dstProp.Name); + codeGenerator.AddProperty(toName, toType, fromName, fromType); + mapped = true; + break; } } } - foreach (string uncopiedProperty in uncopiedProperties) + + if (!mapped) { - codeToInsert += "// " + returnVariableName + "." + uncopiedProperty + " = " + param.Name + "." + uncopiedProperty + ";\n"; + codeGenerator.AddProperty(toName, toType); } - foreach (string unmatchedProperty in unmatchedProperties) - { - codeToInsert += "// " + returnVariableName + "." + unmatchedProperty + "\n"; } - // Add the return statement - codeToInsert += "\nreturn " + returnVariableName + ";\n\n"; - // Batch insert the new code so it can be undone in 1 call to undo - EditPoint pnt = currentMethod.GetStartPoint(vsCMPart.vsCMPartBody).CreateEditPoint(); - pnt.Insert(codeToInsert); - // Format the code (indent it properly) - pnt.SmartFormat(currentMethod.GetStartPoint(vsCMPart.vsCMPartBody)); + AddInUtils.InsertCodeInMethod(currentMethod, codeGenerator.GenerateCode(currentMethod)); + m_application.StatusBar.Text = "AndroMDA: Code inserted"; } else 1.3 +3 -2 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/PropertyMapperCommand.cs Index: PropertyMapperCommand.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/PropertyMapperCommand.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- PropertyMapperCommand.cs 11 Jul 2006 13:45:34 -0000 1.2 +++ PropertyMapperCommand.cs 12 Jul 2006 09:14:57 -0000 1.3 @@ -33,14 +33,15 @@ CodeFunction2 currentMethod = CodeModelUtils.GetCurrentMethod(m_application); if (IsCommandAvailable(currentMethod)) { - AndroMDA.VS80AddIn.Dialogs.PropertyMapperDialog propertyMapper = new AndroMDA.VS80AddIn.Dialogs.PropertyMapperDialog(currentMethod); + AndroMDA.VS80AddIn.Dialogs.PropertyMapperDialog propertyMapper = new AndroMDA.VS80AddIn.Dialogs.PropertyMapperDialog(currentMethod, m_addInSettings); if (propertyMapper.ShowDialog() == System.Windows.Forms.DialogResult.OK) { // User clicked OK + AddInUtils.InsertCodeInMethod(currentMethod, propertyMapper.GeneratedCode); + m_application.StatusBar.Text = "AndroMDA: Code inserted"; } else { - // User clicked cancel } } } 1.3 +101 -66 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/PropertyMapperDialog.cs Index: PropertyMapperDialog.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/PropertyMapperDialog.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- PropertyMapperDialog.cs 11 Jul 2006 13:45:34 -0000 1.2 +++ PropertyMapperDialog.cs 12 Jul 2006 09:14:58 -0000 1.3 @@ -15,20 +15,26 @@ { CodeFunction2 m_currentMethod = null; + AddInSettings m_addInSettings = null; + private string m_codeToInsert; - public PropertyMapperDialog(CodeFunction2 currentMethod) + public string GeneratedCode + { + get { return m_codeToInsert; } + } + + public PropertyMapperDialog(CodeFunction2 currentMethod, AddInSettings settings) { InitializeComponent(); m_currentMethod = currentMethod; - this.SetStyle( - ControlStyles.UserPaint | - ControlStyles.AllPaintingInWmPaint | - ControlStyles.OptimizedDoubleBuffer, true); this.KeyPreview = true; + m_codeToInsert = string.Empty; + m_addInSettings = settings; } private void btnOk_Click(object sender, EventArgs e) { + GenerateCode(); this.DialogResult = DialogResult.OK; } @@ -49,6 +55,10 @@ InitListView(lstToProperties, CodeModelUtils.GetPropertiesFromType(m_currentMethod.Type.CodeType)); //InitTreeView(treeView1, CodeModelUtils.GetPropertiesFromType(fromParameter.Type.CodeType)); RefreshView(); + if (m_addInSettings.PropertyMapperAutoMapOnOpen) + { + AutoMap(); + } } private void InitListView(ListView lstView, ArrayList properties) @@ -157,25 +167,6 @@ lstToProperties.EndUpdate(); } - private void lstFromProperties_SelectedIndexChanged(object sender, EventArgs e) - { - //RefreshView(); - } - - private void lstToProperties_SelectedIndexChanged(object sender, EventArgs e) - { - RefreshView(); - } - - private void lstToProperties_ItemActivate(object sender, EventArgs e) - { - } - - private void lstFromProperties_ItemActivate(object sender, EventArgs e) - { - MapSelectedItems(); - } - private void MapSelectedItems() { if (lstToProperties.SelectedItems.Count > 0 && lstFromProperties.SelectedItems.Count > 0) @@ -230,45 +221,7 @@ private void btnAutoMap_Click(object sender, EventArgs e) { - bool mapped = false; - foreach (ListViewItem fromItem in lstFromProperties.Items) - { - foreach (ListViewItem toItem in lstToProperties.Items) - { - string fromName = fromItem.Name; - string toName = toItem.Name; - string fromNameNoDots = fromName.Replace(".", string.Empty); - string toNameNoDots = toName.Replace(".", string.Empty); - if (fromName == toName || fromName == toNameNoDots || fromNameNoDots == toNameNoDots) - { - string fromType = fromItem.SubItems[1].Text.Replace("?", string.Empty); - string toType = toItem.SubItems[1].Text.Replace("?", string.Empty); - if (fromType == toType) - { - // If the from item is already mapped - if (fromItem.Tag != null) - { - // Remove the back reference - ((ListViewItem)fromItem.Tag).Tag = null; - // Unmap it - fromItem.Tag = null; - } - if (toItem.Tag != null) - { - ((ListViewItem)toItem.Tag).Tag = null; - toItem.Tag = null; - } - fromItem.Tag = toItem; - toItem.Tag = fromItem; - mapped = true; - } - } - } - } - if (mapped) - { - RefreshView(); - } + AutoMap(); } private void pnlConnections_Paint(object sender, PaintEventArgs e) @@ -352,11 +305,51 @@ private ListView m_whichListView = null; - private void expandToolStripMenuItem_Click(object sender, EventArgs e) + private void AutoMap() { + bool mapped = false; + foreach (ListViewItem fromItem in lstFromProperties.Items) + { + foreach (ListViewItem toItem in lstToProperties.Items) + { + string fromName = fromItem.Name; + string toName = toItem.Name; + string fromNameNoDots = fromName.Replace(".", string.Empty); + string toNameNoDots = toName.Replace(".", string.Empty); + if (fromName == toName || fromName == toNameNoDots || fromNameNoDots == toNameNoDots) + { + string fromType = fromItem.SubItems[1].Text.Replace("?", string.Empty); + string toType = toItem.SubItems[1].Text.Replace("?", string.Empty); + if (fromType == toType) + { + // If the from item is already mapped + if (fromItem.Tag != null) + { + // Remove the back reference + ((ListViewItem)fromItem.Tag).Tag = null; + // Unmap it + fromItem.Tag = null; + } + if (toItem.Tag != null) + { + ((ListViewItem)toItem.Tag).Tag = null; + toItem.Tag = null; + } + fromItem.Tag = toItem; + toItem.Tag = fromItem; + mapped = true; + } + } + } + } + if (mapped) + { + RefreshView(); + } + } - ListView lst = m_whichListView; - + private void ExpandSelectedItem(ListView lst) + { if (lst.SelectedItems.Count == 0) return; ListViewItem item = lst.SelectedItems[0]; CodeProperty prop = (CodeProperty)item.SubItems[1].Tag; @@ -406,6 +399,11 @@ } } + private void expandToolStripMenuItem_Click(object sender, EventArgs e) + { + ExpandSelectedItem(m_whichListView); + } + private void mapToolStripMenuItem_Click(object sender, EventArgs e) { MapSelectedItems(); @@ -425,5 +423,42 @@ } + private void lstFromProperties_SelectedIndexChanged(object sender, EventArgs e) + { + //RefreshView(); + } + + private void lstToProperties_SelectedIndexChanged(object sender, EventArgs e) + { + RefreshView(); + } + + private void lstToProperties_ItemActivate(object sender, EventArgs e) + { + } + + private void lstFromProperties_ItemActivate(object sender, EventArgs e) + { + MapSelectedItems(); + } + + private void GenerateCode() + { + ConversionCodeGenerator codeGenerator = new ConversionCodeGenerator(); + foreach (ListViewItem toItem in lstToProperties.Items) + { + ListViewItem fromItem = (ListViewItem)toItem.Tag; + if (fromItem != null) + { + codeGenerator.AddProperty(toItem.Text, toItem.SubItems[1].Text, fromItem.Text, fromItem.SubItems[1].Text); + } + else + { + codeGenerator.AddProperty(toItem.Text, toItem.SubItems[1].Text); + } + } + m_codeToInsert = codeGenerator.GenerateCode(m_currentMethod); + } + } } \ No newline at end of file 1.5 +13 -0 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Utils/AddInUtils.cs Index: AddInUtils.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Utils/AddInUtils.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- AddInUtils.cs 7 Jul 2006 22:32:17 -0000 1.4 +++ AddInUtils.cs 12 Jul 2006 09:15:02 -0000 1.5 @@ -8,6 +8,8 @@ using System.Collections.Generic; using System.Text; using System.Windows.Forms; +using EnvDTE80; +using EnvDTE; #endregion @@ -46,5 +48,16 @@ lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, value)); listView.Items.Add(lvi); } + + public static void InsertCodeInMethod(CodeFunction2 currentMethod, string codeToInsert) + { + TextPoint startPoint = currentMethod.GetStartPoint(vsCMPart.vsCMPartBody); + // Batch insert the new code so it can be undone in 1 call to undo + EditPoint pnt = startPoint.CreateEditPoint(); + pnt.Insert(codeToInsert); + // Format the code (indent it properly) + pnt.SmartFormat(startPoint); + } + } } 1.3 +41 -9 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Utils/CodeModelUtils.cs Index: CodeModelUtils.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Utils/CodeModelUtils.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- CodeModelUtils.cs 7 Jul 2006 22:32:17 -0000 1.2 +++ CodeModelUtils.cs 12 Jul 2006 09:15:02 -0000 1.3 @@ -24,8 +24,8 @@ { public int Compare(object first, object second) { - CodeElement2 f = (CodeElement2)second; - CodeElement2 s = (CodeElement2)first; + CodeElement2 f = (CodeElement2)first; + CodeElement2 s = (CodeElement2)second; return f.Name.CompareTo(s.Name); } } @@ -36,12 +36,22 @@ public static ArrayList GetPropertiesFromType(CodeType type) { - return GetPropertiesFromType(type, true); + return GetMembersFromType(type, new vsCMElement[] { vsCMElement.vsCMElementProperty }); } public static ArrayList GetPropertiesFromType(CodeType type, bool sort) { - ArrayList results = GetPropertiesFromType(type, new ArrayList()); + return GetMembersFromType(type, new vsCMElement[] { vsCMElement.vsCMElementProperty }, sort); + } + + private static ArrayList GetMembersFromType(CodeType type, vsCMElement[] searchScopes) + { + return GetMembersFromType(type, searchScopes, true); + } + + private static ArrayList GetMembersFromType(CodeType type, vsCMElement[] searchScopes, bool sort) + { + ArrayList results = GetMembersFromType(type, searchScopes, new ArrayList()); if (sort) { results.Sort(new CodeElement2Comparator()); @@ -49,23 +59,28 @@ return results; } - private static ArrayList GetPropertiesFromType(CodeType type, ArrayList properties) + private static ArrayList GetMembersFromType(CodeType type, vsCMElement[] searchScopes, ArrayList properties) { foreach (CodeElement2 prop in type.Members) { - if (prop.Kind == vsCMElement.vsCMElementProperty) + foreach(vsCMElement elemType in searchScopes) + { + if (prop.Kind == elemType) { properties.Add(prop); + break; + } } } for (int i = 1; i <= type.Bases.Count; i++) { CodeType baseclass = type.Bases.Item(i) as CodeType; - GetPropertiesFromType(baseclass, properties); + GetMembersFromType(baseclass, searchScopes, properties); } return properties; } + public static CodeFunction2 GetCurrentMethod(DTE dte) { vsCMElement[] searchScopes = { @@ -144,5 +159,22 @@ return null; return element; } + + + public static bool IsEntityClass(CodeType type) + { + vsCMElement[] searchScopes = { vsCMElement.vsCMElementClass }; + + // If the type has a Factory class, then it is an entity + ArrayList classes = GetMembersFromType(type, searchScopes, false); + if (classes.Count == 0) return false; + foreach (CodeElement2 elem in classes) + { + if (elem.Name == "Factory") return true; + } + return false; + } + + } } 1.1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Controls/MDAProjectSetupControl.cs Index: MDAProjectSetupControl.cs =================================================================== // AndroMDA Visual Studio 2005 Add-In // (c)2006 AndroMDA.org #region Using statements using System; using System.Collections; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using EnvDTE; using VSLangProj; #endregion namespace AndroMDA.VS80AddIn.Dialogs { public partial class MDAProjectSetupControl : UserControl { #region Member variables private bool m_firstEnter = true; #endregion #region Properties /* [Category("Appearance")] [LocalizableAttribute(true)] [BindableAttribute(true)] public string Title { get { return lblTitle.Text; } set { lblTitle.Text = value; } } [Category("Appearance")] [LocalizableAttribute(true)] [BindableAttribute(true)] public string Description { get { return lblDescription.Text; } set { lblDescription.Text = value; } } */ private bool m_webProjectMode = false; [Category("Behavior")] [LocalizableAttribute(true)] [BindableAttribute(true)] [DefaultValue(false)] public bool WebProjectMode { get { return m_webProjectMode; } set { /* rbDontAddSupport.Enabled = rbDontAddSupport.Visible = value; int baseY = value ? 23 : 0; rbCreate.Top = baseY + 0; txtNewProject.Top = baseY + 20; rbExisting.Top = baseY + 45; ddlExistingProject.Top = baseY + 66; */ m_webProjectMode = value; if (m_webProjectMode) { rbExisting.Text = "Use existing web site"; rbCreate.Text = "Create new web site"; } else { rbExisting.Text = "Use existing project"; rbCreate.Text = "Create new project"; } } } public bool DontAddSupport { get { return rbDontAddSupport.Checked; } } public bool CreateNewProject { get { return rbCreate.Checked; } } public string ProjectName { get { if (CreateNewProject) { return txtNewProject.Text; } else { return ddlExistingProject.SelectedItem.ToString(); } } set { rbCreate.Checked = true; txtNewProject.Text = value; } } #endregion public MDAProjectSetupControl() { InitializeComponent(); } public void OnEnter(object sender, EventArgs e, DTE applicationObject) { string webProjectKind = "{E24C65DC-7377-472b-9ABA-BC803B73C61A}"; if (m_firstEnter) { m_firstEnter = false; ddlExistingProject.Items.Clear(); string itemToSelect = string.Empty; foreach (Project p in applicationObject.Solution.Projects) { if ( (m_webProjectMode && p.Kind == webProjectKind) || (!m_webProjectMode && p.Kind != webProjectKind) ) { ddlExistingProject.Items.Add(p.Name); // If there is a project in the solution with the same // name as the pre-generated project if (!m_webProjectMode && p.Name == txtNewProject.Text) { // Select it by default itemToSelect = p.Name; } // Or if we are in web project mode select the first web site automatically else if (m_webProjectMode && itemToSelect == string.Empty) { itemToSelect = p.Name; } } } if (ddlExistingProject.Items.Count > 0) { if (itemToSelect != string.Empty) { ddlExistingProject.SelectedIndex = ddlExistingProject.Items.IndexOf(itemToSelect); rbExisting.Checked = true; } else { ddlExistingProject.SelectedIndex = 0; rbExisting.Checked = false; } } else { rbExisting.Enabled = false; } } if (rbExisting.Checked) { ddlExistingProject.Focus(); } else { txtNewProject.Focus(); } } public bool ValidateControl() { if (rbExisting.Checked) { return ddlExistingProject.SelectedItem.ToString() != string.Empty; } else { return ValidationUtils.ValidateRequiredTextBox(txtNewProject); } } private void checkChanged(object sender, EventArgs e) { if (txtNewProject.Enabled) { txtNewProject.BackColor = SystemColors.Window; } else { txtNewProject.BackColor = SystemColors.Control; } txtNewProject.Enabled = rbCreate.Checked; ddlExistingProject.Enabled = rbExisting.Checked; } } } 1.1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Controls/MDAProjectSetupControl.designer.cs Index: MDAProjectSetupControl.designer.cs =================================================================== namespace AndroMDA.VS80AddIn.Dialogs { partial class MDAProjectSetupControl { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.ddlExistingProject = new System.Windows.Forms.ComboBox(); this.txtNewProject = new System.Windows.Forms.TextBox(); this.rbExisting = new System.Windows.Forms.RadioButton(); this.rbCreate = new System.Windows.Forms.RadioButton(); this.rbDontAddSupport = new System.Windows.Forms.RadioButton(); this.SuspendLayout(); // // ddlExistingProject // this.ddlExistingProject.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.ddlExistingProject.Enabled = false; this.ddlExistingProject.FormattingEnabled = true; this.ddlExistingProject.Location = new System.Drawing.Point(18, 72); this.ddlExistingProject.Name = "ddlExistingProject"; this.ddlExistingProject.Size = new System.Drawing.Size(394, 21); this.ddlExistingProject.TabIndex = 16; // // txtNewProject // this.txtNewProject.Location = new System.Drawing.Point(18, 23); this.txtNewProject.Name = "txtNewProject"; this.txtNewProject.Size = new System.Drawing.Size(394, 20); this.txtNewProject.TabIndex = 13; // // rbExisting // this.rbExisting.AutoSize = true; this.rbExisting.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.rbExisting.Location = new System.Drawing.Point(0, 49); this.rbExisting.Name = "rbExisting"; this.rbExisting.Size = new System.Drawing.Size(138, 17); this.rbExisting.TabIndex = 15; this.rbExisting.Text = "Use existing project"; this.rbExisting.UseVisualStyleBackColor = true; this.rbExisting.CheckedChanged += new System.EventHandler(this.checkChanged); // // rbCreate // this.rbCreate.AutoSize = true; this.rbCreate.Checked = true; this.rbCreate.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.rbCreate.Location = new System.Drawing.Point(0, 0); this.rbCreate.Name = "rbCreate"; this.rbCreate.Size = new System.Drawing.Size(133, 17); this.rbCreate.TabIndex = 12; this.rbCreate.TabStop = true; this.rbCreate.Text = "Create new project"; this.rbCreate.UseVisualStyleBackColor = true; this.rbCreate.CheckedChanged += new System.EventHandler(this.checkChanged); // // rbDontAddSupport // this.rbDontAddSupport.AutoSize = true; this.rbDontAddSupport.Enabled = false; this.rbDontAddSupport.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.rbDontAddSupport.Location = new System.Drawing.Point(0, 0); this.rbDontAddSupport.Name = "rbDontAddSupport"; this.rbDontAddSupport.Size = new System.Drawing.Size(203, 17); this.rbDontAddSupport.TabIndex = 14; this.rbDontAddSupport.Text = "Do not add web project support"; this.rbDontAddSupport.UseVisualStyleBackColor = true; this.rbDontAddSupport.Visible = false; // // MDAProjectSetupControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.ddlExistingProject); this.Controls.Add(this.txtNewProject); this.Controls.Add(this.rbExisting); this.Controls.Add(this.rbCreate); this.Controls.Add(this.rbDontAddSupport); this.Name = "MDAProjectSetupControl"; this.Size = new System.Drawing.Size(434, 138); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.ComboBox ddlExistingProject; private System.Windows.Forms.TextBox txtNewProject; private System.Windows.Forms.RadioButton rbExisting; private System.Windows.Forms.RadioButton rbCreate; private System.Windows.Forms.RadioButton rbDontAddSupport; } } 1.1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Controls/MDAProjectSetupControl.resx Index: MDAProjectSetupControl.resx =================================================================== <?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.Componen... [truncated message content] |