From: Daniel C. \(kzu\) <dca...@us...> - 2005-11-15 17:29:12
|
Update of /cvsroot/mvp-xml/Design/v2/src/CustomTools/XGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19060/v2/src/CustomTools/XGen Modified Files: XGenTool.cs XmlSerializerGenerator.cs Log Message: Updated tests and generator for a bug in debug compilations of the generator when multiple types are generated, that causes generation of code that didn't compile. Index: XGenTool.cs =================================================================== RCS file: /cvsroot/mvp-xml/Design/v2/src/CustomTools/XGen/XGenTool.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- XGenTool.cs 31 Oct 2005 12:28:17 -0000 1.5 +++ XGenTool.cs 15 Nov 2005 17:29:04 -0000 1.6 @@ -193,10 +193,12 @@ private void CopyDesignToOutput(string outputPath) { // Copy Design assembly to output for the isolated AppDomain. - string asmfile = GetAssemblyPath(Assembly.GetExecutingAssembly()); + string asmFile = GetAssemblyPath(Assembly.GetExecutingAssembly()); + string targetFile = Path.Combine(outputPath, Path.GetFileName(asmFile)); try { - File.Copy(asmfile, Path.Combine(outputPath, Path.GetFileName(asmfile)), true); + if (File.Exists(targetFile)) File.Delete(targetFile); + File.Copy(asmFile, targetFile, true); } catch (Exception ex) { Index: XmlSerializerGenerator.cs =================================================================== RCS file: /cvsroot/mvp-xml/Design/v2/src/CustomTools/XGen/XmlSerializerGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- XmlSerializerGenerator.cs 1 Nov 2005 06:44:41 -0000 1.4 +++ XmlSerializerGenerator.cs 15 Nov 2005 17:29:04 -0000 1.5 @@ -231,7 +231,7 @@ foreach (Type type in types) { - output += GenerateCodeForType(type, targetNamespace, output); + output += GenerateCodeForType(type, targetNamespace, output) + Environment.NewLine ; } return output; @@ -275,7 +275,8 @@ output = @" #pragma warning disable 0642, 0219 " + output + @" -#pragma warning restore 0642, 0219"; +#pragma warning restore 0642, 0219 +"; output = CustomTool.GetToolGeneratedCodeWarning(typeof(XGenTool)) + output; @@ -421,8 +422,11 @@ if (!previousOutput.Contains(delegateName)) { // Create a delegate for the event to expose. - // public delegate void [objectBeingRead]DeserializedHandler(Mvp.Xml.Design.Tests.Customer customer); + // internal delegate void [objectBeingRead]DeserializedHandler([objectBeingRead] value); + // Due to bug http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=a0bf7d07-bd96-4672-a1cb-f7fe7ff0b29e, + // the delegate will always be public. CodeTypeDelegate del = new CodeTypeDelegate(delegateName); + del.Attributes = MemberAttributes.Assembly; del.Parameters.Add(new CodeParameterDeclarationExpression( readMethodMatch.Groups[ReadMethodReturnType].Value, MakeFirstLower(objectBeingRead))); |