Commit 9134a21f authored by Jon Skeet's avatar Jon Skeet

Tweaks

parent cabd06d1
...@@ -37,4 +37,6 @@ o There's a mixture of generic and non-generic code. This ...@@ -37,4 +37,6 @@ o There's a mixture of generic and non-generic code. This
o Nested types always end up under a "Types" static class which o Nested types always end up under a "Types" static class which
is merely present to avoid name clashes. is merely present to avoid name clashes.
o FileDescriptor.FindByName has been made generic to allow simple o FileDescriptor.FindByName has been made generic to allow simple
type-safe searching for any nested type. type-safe searching for any nested type.
\ No newline at end of file o No enum.valueOf for enums (due to them being simple C# enums)
o Public Builder constructors to aid C# object/collection initializers
...@@ -26,6 +26,12 @@ package protobuf_unittest; ...@@ -26,6 +26,12 @@ package protobuf_unittest;
option java_multiple_files = true; option java_multiple_files = true;
option java_outer_classname = "MultipleFilesTestProto"; option java_outer_classname = "MultipleFilesTestProto";
option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
option csharp_file_classname = "MultiFileProto";
option csharp_multiple_files = true;
option csharp_nest_classes = false;
option csharp_public_classes = true;
message MessageWithNoOuter { message MessageWithNoOuter {
message NestedMessage { message NestedMessage {
optional int32 i = 1; optional int32 i = 1;
......
...@@ -215,9 +215,6 @@ void MessageGenerator::Generate(io::Printer* printer) { ...@@ -215,9 +215,6 @@ void MessageGenerator::Generate(io::Printer* printer) {
} }
printer->Indent(); printer->Indent();
printer->Print( printer->Print(
"// Use $classname$.CreateBuilder() to construct.\r\n"
"private $classname$() {}\r\n"
"\r\n"
"private static readonly $classname$ defaultInstance = new $classname$();\r\n" "private static readonly $classname$ defaultInstance = new $classname$();\r\n"
"public static $classname$ DefaultInstance {\r\n" "public static $classname$ DefaultInstance {\r\n"
" get { return defaultInstance; }\r\n" " get { return defaultInstance; }\r\n"
...@@ -383,7 +380,7 @@ GenerateParseFromMethods(io::Printer* printer) { ...@@ -383,7 +380,7 @@ GenerateParseFromMethods(io::Printer* printer) {
"public static $classname$ ParseFrom(byte[] data) {\r\n" "public static $classname$ ParseFrom(byte[] data) {\r\n"
" return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();\r\n" " return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();\r\n"
"}\r\n" "}\r\n"
"public static $classname$ parseFrom(byte[] data,\r\n" "public static $classname$ ParseFrom(byte[] data,\r\n"
" pb::ExtensionRegistry extensionRegistry) {\r\n" " pb::ExtensionRegistry extensionRegistry) {\r\n"
" return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))\r\n" " return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))\r\n"
" .BuildParsed();\r\n" " .BuildParsed();\r\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment