Jon Skeet 17 years ago
parent
commit
9134a21f27

+ 3 - 1
CSHARP-README.txt

@@ -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
   is merely present to avoid name clashes.
 o FileDescriptor.FindByName has been made generic to allow simple
-  type-safe searching for any nested type.
+  type-safe searching for any nested type.
+o No enum.valueOf for enums (due to them being simple C# enums)
+o Public Builder constructors to aid C# object/collection initializers

+ 6 - 0
java/src/test/java/com/google/protobuf/multiple_files_test.proto

@@ -26,6 +26,12 @@ package protobuf_unittest;
 option java_multiple_files = true;
 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 NestedMessage {
     optional int32 i = 1;

+ 1 - 4
src/google/protobuf/compiler/csharp/csharp_message.cc

@@ -215,9 +215,6 @@ void MessageGenerator::Generate(io::Printer* printer) {
   }
   printer->Indent();
   printer->Print(
-    "// Use $classname$.CreateBuilder() to construct.\r\n"
-    "private $classname$() {}\r\n"
-    "\r\n"
     "private static readonly $classname$ defaultInstance = new $classname$();\r\n"
     "public static $classname$ DefaultInstance {\r\n"
     "  get { return defaultInstance; }\r\n"
@@ -383,7 +380,7 @@ GenerateParseFromMethods(io::Printer* printer) {
     "public static $classname$ ParseFrom(byte[] data) {\r\n"
     "  return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();\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"
     "  return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))\r\n"
     "           .BuildParsed();\r\n"