diff options
author | Jon Skeet <skeet@pobox.com> | 2009-11-03 17:36:32 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2009-11-03 17:36:32 +0000 |
commit | b075ff5c17b04efcd8ab8adee866456b0abf2195 (patch) | |
tree | 9186debb649fbbc1f0ffe2cd56f305749039048b /src/ProtoGen | |
parent | b49d3c7834c9448e137d88c510f30963661ff7d9 (diff) | |
download | protobuf-b075ff5c17b04efcd8ab8adee866456b0abf2195.tar.gz protobuf-b075ff5c17b04efcd8ab8adee866456b0abf2195.tar.bz2 protobuf-b075ff5c17b04efcd8ab8adee866456b0abf2195.zip |
Added a flag to allow code contracts to be emitted
Diffstat (limited to 'src/ProtoGen')
-rw-r--r-- | src/ProtoGen/UmbrellaClassGenerator.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ProtoGen/UmbrellaClassGenerator.cs b/src/ProtoGen/UmbrellaClassGenerator.cs index d41e70eb..9dcbcab9 100644 --- a/src/ProtoGen/UmbrellaClassGenerator.cs +++ b/src/ProtoGen/UmbrellaClassGenerator.cs @@ -115,8 +115,10 @@ namespace Google.ProtocolBuffers.ProtoGen { writer.WriteLine("namespace {0} {{", Descriptor.CSharpOptions.Namespace); writer.Indent(); writer.WriteLine(); + } + if (Descriptor.CSharpOptions.CodeContracts) { + writer.WriteLine("[global::System.Diagnostics.Contracts.ContractVerificationAttribute(false)]"); } - writer.WriteLine("{0} static partial class {1} {{", ClassAccessLevel, Descriptor.CSharpOptions.UmbrellaClassname); writer.WriteLine(); writer.Indent(); |