diff options
author | csharptest <roger@csharptest.net> | 2011-09-20 13:20:19 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2011-09-20 13:20:19 -0500 |
commit | 945ea76eaa2717734c5b901d93c4dcd1265c8229 (patch) | |
tree | 38729643b3a13813f8939e4d26654caf26ba7c5a /src/ProtoGen | |
parent | f0b72c744343d80b5ef029f2a48350512f9e138b (diff) | |
parent | aeb30d8351f33350d58e6795b16c4f861939f4e3 (diff) | |
download | protobuf-945ea76eaa2717734c5b901d93c4dcd1265c8229.tar.gz protobuf-945ea76eaa2717734c5b901d93c4dcd1265c8229.tar.bz2 protobuf-945ea76eaa2717734c5b901d93c4dcd1265c8229.zip |
merge issue-20
Diffstat (limited to 'src/ProtoGen')
-rw-r--r-- | src/ProtoGen/MessageGenerator.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ProtoGen/MessageGenerator.cs b/src/ProtoGen/MessageGenerator.cs index 01d47ce2..83004da9 100644 --- a/src/ProtoGen/MessageGenerator.cs +++ b/src/ProtoGen/MessageGenerator.cs @@ -165,9 +165,13 @@ namespace Google.ProtocolBuffers.ProtoGen {
return SourceGenerators.CreateFieldGenerator(fieldDescriptor, FieldOrdinal(fieldDescriptor));
}
-
+
public void Generate(TextGenerator writer)
{
+ if (Descriptor.File.CSharpOptions.AddSerializable)
+ {
+ writer.WriteLine("[global::System.SerializableAttribute()]");
+ }
writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]");
writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]");
writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]",
@@ -554,6 +558,10 @@ namespace Google.ProtocolBuffers.ProtoGen writer.WriteLine(" return (Builder) new Builder().MergeFrom(prototype);");
writer.WriteLine("}");
writer.WriteLine();
+ if (Descriptor.File.CSharpOptions.AddSerializable)
+ {
+ writer.WriteLine("[global::System.SerializableAttribute()]");
+ }
writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]");
writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]");
writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]",
|