CodeDOM

16/01/2006 - 13:13 por Cesar Collado | Informe spam
Una consulta , estoy con CodeDOM y al generar una clase
siempre me pone el siguiente comentario , alguna manera de elimarlo o poner
otro texto definido por mi. Gracias

//
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//
 

Leer las respuestas

#1 José Escrich
16/01/2006 - 15:25 | Informe spam
esta un poco complicado el asunto, porque este comentario se pega en el generador
de código, el que implementa (ICodeGenerator), en ppio se me ocurrio que
se podria extender CSharpCodeGenerator para eliminar el comentario pero esta
como internal :(:(, lo que se me ocurre, un poco grasa pero funciona, es
truncale a la salida las 8 primeras lineas...

aca te pego el metodo que pega ese comentario...
saludos, espero te sirva

private void GenerateCompileUnitStart(CodeCompileUnit e)
{
if (e.StartDirectives.Count > 0)
{
this.GenerateDirectives(e.StartDirectives);
}
this.Output.WriteLine("//");
this.Output.Write("// <");
this.Output.WriteLine(SR.GetString("AutoGen_Comment_Line1"));
this.Output.Write("// ");
this.Output.WriteLine(SR.GetString("AutoGen_Comment_Line2"));
this.Output.Write("// ");
this.Output.Write(SR.GetString("AutoGen_Comment_Line3"));
this.Output.WriteLine(Environment.Version.ToString());
this.Output.WriteLine("//");
this.Output.Write("// ");
this.Output.WriteLine(SR.GetString("AutoGen_Comment_Line4"));
this.Output.Write("// ");
this.Output.WriteLine(SR.GetString("AutoGen_Comment_Line5"));
this.Output.Write("// </");
this.Output.WriteLine(SR.GetString("AutoGen_Comment_Line1"));
this.Output.WriteLine("//");
this.Output.WriteLine("");

José Escrich
jescrich (a) gmail.com
http://latincoder.com

CC> Una consulta , estoy con CodeDOM y al generar una clase siempre me
CC> pone el siguiente comentario , alguna manera de elimarlo o poner
CC> otro texto definido por mi. Gracias
CC>
CC> //
CC>
CC> // <auto-generated>
CC> // This code was generated by a tool.
CC> // Runtime Version:2.0.50727.42
CC> //
CC> // Changes to this file may cause incorrect behavior and will be
CC> lost if
CC> // the code is regenerated.
CC> // </auto-generated>
CC> //
CC> --

Preguntas similares