Commit 71f662c3 authored by csharptest's avatar csharptest Committed by rogerk

reformatted all code to .NET standard formatting

parent d965c666
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.IO; #endregion
namespace Google.ProtocolBuffers.Examples.AddressBook using System;
{ using System.IO;
class AddPerson {
namespace Google.ProtocolBuffers.Examples.AddressBook
/// <summary> {
/// Builds a person based on user input internal class AddPerson
/// </summary> {
static Person PromptForAddress(TextReader input, TextWriter output) { /// <summary>
Person.Builder person = Person.CreateBuilder(); /// Builds a person based on user input
/// </summary>
output.Write("Enter person ID: "); private static Person PromptForAddress(TextReader input, TextWriter output)
person.Id = int.Parse(input.ReadLine()); {
Person.Builder person = Person.CreateBuilder();
output.Write("Enter name: ");
person.Name = input.ReadLine(); output.Write("Enter person ID: ");
person.Id = int.Parse(input.ReadLine());
output.Write("Enter email address (blank for none): ");
string email = input.ReadLine(); output.Write("Enter name: ");
if (email.Length > 0) { person.Name = input.ReadLine();
person.Email = email;
} output.Write("Enter email address (blank for none): ");
string email = input.ReadLine();
while (true) { if (email.Length > 0)
output.Write("Enter a phone number (or leave blank to finish): "); {
string number = input.ReadLine(); person.Email = email;
if (number.Length == 0) { }
break;
} while (true)
{
Person.Types.PhoneNumber.Builder phoneNumber = output.Write("Enter a phone number (or leave blank to finish): ");
Person.Types.PhoneNumber.CreateBuilder().SetNumber(number); string number = input.ReadLine();
if (number.Length == 0)
output.Write("Is this a mobile, home, or work phone? "); {
String type = input.ReadLine(); break;
switch (type) { }
case "mobile":
phoneNumber.Type = Person.Types.PhoneType.MOBILE; Person.Types.PhoneNumber.Builder phoneNumber =
break; Person.Types.PhoneNumber.CreateBuilder().SetNumber(number);
case "home":
phoneNumber.Type = Person.Types.PhoneType.HOME; output.Write("Is this a mobile, home, or work phone? ");
break; String type = input.ReadLine();
case "work": switch (type)
phoneNumber.Type = Person.Types.PhoneType.WORK; {
break; case "mobile":
default: phoneNumber.Type = Person.Types.PhoneType.MOBILE;
output.Write("Unknown phone type. Using default."); break;
break; case "home":
} phoneNumber.Type = Person.Types.PhoneType.HOME;
break;
person.AddPhone(phoneNumber); case "work":
} phoneNumber.Type = Person.Types.PhoneType.WORK;
return person.Build(); break;
} default:
output.Write("Unknown phone type. Using default.");
/// <summary> break;
/// Entry point - loads an existing addressbook or creates a new one, }
/// then writes it back to the file.
/// </summary> person.AddPhone(phoneNumber);
public static int Main(string[] args) { }
if (args.Length != 1) { return person.Build();
Console.Error.WriteLine("Usage: AddPerson ADDRESS_BOOK_FILE"); }
return -1;
} /// <summary>
/// Entry point - loads an existing addressbook or creates a new one,
AddressBook.Builder addressBook = AddressBook.CreateBuilder(); /// then writes it back to the file.
/// </summary>
if (File.Exists(args[0])) { public static int Main(string[] args)
using (Stream file = File.OpenRead(args[0])) { {
addressBook.MergeFrom(file); if (args.Length != 1)
} {
} else { Console.Error.WriteLine("Usage: AddPerson ADDRESS_BOOK_FILE");
Console.WriteLine("{0}: File not found. Creating a new file.", args[0]); return -1;
} }
// Add an address. AddressBook.Builder addressBook = AddressBook.CreateBuilder();
addressBook.AddPerson(PromptForAddress(Console.In, Console.Out));
if (File.Exists(args[0]))
// Write the new address book back to disk. {
using (Stream output = File.OpenWrite(args[0])) { using (Stream file = File.OpenRead(args[0]))
addressBook.Build().WriteTo(output); {
} addressBook.MergeFrom(file);
return 0; }
} }
} else
{
Console.WriteLine("{0}: File not found. Creating a new file.", args[0]);
}
// Add an address.
addressBook.AddPerson(PromptForAddress(Console.In, Console.Out));
// Write the new address book back to disk.
using (Stream output = File.OpenWrite(args[0]))
{
addressBook.Build().WriteTo(output);
}
return 0;
}
}
} }
\ No newline at end of file
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System; #endregion
using System.IO;
using System;
namespace Google.ProtocolBuffers.Examples.AddressBook { using System.IO;
class ListPeople {
/// <summary> namespace Google.ProtocolBuffers.Examples.AddressBook
/// Iterates though all people in the AddressBook and prints info about them. {
/// </summary> internal class ListPeople
static void Print(AddressBook addressBook) { {
foreach (Person person in addressBook.PersonList) { /// <summary>
Console.WriteLine("Person ID: {0}", person.Id); /// Iterates though all people in the AddressBook and prints info about them.
Console.WriteLine(" Name: {0}", person.Name); /// </summary>
if (person.HasEmail) { private static void Print(AddressBook addressBook)
Console.WriteLine(" E-mail address: {0}", person.Email); {
} foreach (Person person in addressBook.PersonList)
{
foreach (Person.Types.PhoneNumber phoneNumber in person.PhoneList) { Console.WriteLine("Person ID: {0}", person.Id);
switch (phoneNumber.Type) { Console.WriteLine(" Name: {0}", person.Name);
case Person.Types.PhoneType.MOBILE: if (person.HasEmail)
Console.Write(" Mobile phone #: "); {
break; Console.WriteLine(" E-mail address: {0}", person.Email);
case Person.Types.PhoneType.HOME: }
Console.Write(" Home phone #: ");
break; foreach (Person.Types.PhoneNumber phoneNumber in person.PhoneList)
case Person.Types.PhoneType.WORK: {
Console.Write(" Work phone #: "); switch (phoneNumber.Type)
break; {
} case Person.Types.PhoneType.MOBILE:
Console.WriteLine(phoneNumber.Number); Console.Write(" Mobile phone #: ");
} break;
} case Person.Types.PhoneType.HOME:
} Console.Write(" Home phone #: ");
break;
/// <summary> case Person.Types.PhoneType.WORK:
/// Entry point - loads the addressbook and then displays it. Console.Write(" Work phone #: ");
/// </summary> break;
public static int Main(string[] args) { }
if (args.Length != 1) { Console.WriteLine(phoneNumber.Number);
Console.Error.WriteLine("Usage: ListPeople ADDRESS_BOOK_FILE"); }
return 1; }
} }
if (!File.Exists(args[0])) { /// <summary>
Console.WriteLine("{0} doesn't exist. Add a person to create the file first.", args[0]); /// Entry point - loads the addressbook and then displays it.
return 0; /// </summary>
} public static int Main(string[] args)
{
// Read the existing address book. if (args.Length != 1)
using (Stream stream = File.OpenRead(args[0])) { {
AddressBook addressBook = AddressBook.ParseFrom(stream); Console.Error.WriteLine("Usage: ListPeople ADDRESS_BOOK_FILE");
Print(addressBook); return 1;
} }
return 0;
} if (!File.Exists(args[0]))
} {
} Console.WriteLine("{0} doesn't exist. Add a person to create the file first.", args[0]);
return 0;
}
// Read the existing address book.
using (Stream stream = File.OpenRead(args[0]))
{
AddressBook addressBook = AddressBook.ParseFrom(stream);
Print(addressBook);
}
return 0;
}
}
}
\ No newline at end of file
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System; #endregion
namespace Google.ProtocolBuffers.Examples.AddressBook using System;
{
/// <summary> namespace Google.ProtocolBuffers.Examples.AddressBook
/// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour {
/// to individual actions. Each action has its own Main method, so that it can be used as an /// <summary>
/// invidual complete program. /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour
/// </summary> /// to individual actions. Each action has its own Main method, so that it can be used as an
class Program { /// invidual complete program.
static int Main(string[] args) { /// </summary>
if (args.Length > 1) { internal class Program
Console.Error.WriteLine("Usage: AddressBook [file]"); {
Console.Error.WriteLine("If the filename isn't specified, \"addressbook.data\" is used instead."); private static int Main(string[] args)
return 1; {
} if (args.Length > 1)
string addressBookFile = args.Length > 0 ? args[0] : "addressbook.data"; {
Console.Error.WriteLine("Usage: AddressBook [file]");
bool stopping = false; Console.Error.WriteLine("If the filename isn't specified, \"addressbook.data\" is used instead.");
while (!stopping) { return 1;
Console.WriteLine("Options:"); }
Console.WriteLine(" L: List contents"); string addressBookFile = args.Length > 0 ? args[0] : "addressbook.data";
Console.WriteLine(" A: Add new person");
Console.WriteLine(" Q: Quit"); bool stopping = false;
Console.Write("Action? "); while (!stopping)
Console.Out.Flush(); {
char choice = Console.ReadKey().KeyChar; Console.WriteLine("Options:");
Console.WriteLine(); Console.WriteLine(" L: List contents");
try { Console.WriteLine(" A: Add new person");
switch (choice) { Console.WriteLine(" Q: Quit");
case 'A': Console.Write("Action? ");
case 'a': Console.Out.Flush();
AddPerson.Main(new string[] { addressBookFile }); char choice = Console.ReadKey().KeyChar;
break; Console.WriteLine();
case 'L': try
case 'l': {
ListPeople.Main(new string[] { addressBookFile }); switch (choice)
break; {
case 'Q': case 'A':
case 'q': case 'a':
stopping = true; AddPerson.Main(new string[] {addressBookFile});
break; break;
default: case 'L':
Console.WriteLine("Unknown option: {0}", choice); case 'l':
break; ListPeople.Main(new string[] {addressBookFile});
} break;
} catch (Exception e) { case 'Q':
Console.WriteLine("Exception executing action: {0}", e); case 'q':
} stopping = true;
Console.WriteLine(); break;
} default:
return 0; Console.WriteLine("Unknown option: {0}", choice);
} break;
} }
}
catch (Exception e)
{
Console.WriteLine("Exception executing action: {0}", e);
}
Console.WriteLine();
}
return 0;
}
}
} }
\ No newline at end of file
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("AddressBook")]
[assembly: AssemblyDescription("")] [assembly: AssemblyTitle("AddressBook")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("AddressBook")] [assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2008")] [assembly: AssemblyProduct("AddressBook")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyCulture("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // Setting ComVisible to false makes the types in this assembly not visible
// COM, set the ComVisible attribute to true on that type. // to COM components. If you need to access a type in this assembly from
[assembly: ComVisible(false)] // COM, set the ComVisible attribute to true on that type.
// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: ComVisible(false)]
[assembly: Guid("57123e6e-28d1-4b9e-80a5-5e720df8035a")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
// Version information for an assembly consists of the following four values:
// [assembly: Guid("57123e6e-28d1-4b9e-80a5-5e720df8035a")]
// Major Version
// Minor Version // Version information for an assembly consists of the following four values:
// Build Number //
// Revision // Major Version
// // Minor Version
// You can specify all the values or you can default the Build and Revision Numbers // Build Number
// by using the '*' as shown below: // Revision
// [assembly: AssemblyVersion("2.3.0.277")] //
[assembly: AssemblyVersion("2.3.0.277")] // You can specify all the values or you can default the Build and Revision Numbers
[assembly: AssemblyFileVersion("2.3.0.277")] // by using the '*' as shown below:
// [assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyFileVersion("2.3.0.277")]
\ No newline at end of file
...@@ -3,42 +3,42 @@ using System.IO; ...@@ -3,42 +3,42 @@ using System.IO;
namespace Google.ProtocolBuffers.Examples.AddressBook namespace Google.ProtocolBuffers.Examples.AddressBook
{ {
class SampleUsage internal class SampleUsage
{
static void Main()
{ {
byte[] bytes; private static void Main()
//Create a builder to start building a message
Person.Builder newContact = Person.CreateBuilder();
//Set the primitive properties
newContact.SetId(1)
.SetName("Foo")
.SetEmail("foo@bar");
//Now add an item to a list (repeating) field
newContact.AddPhone(
//Create the child message inline
Person.Types.PhoneNumber.CreateBuilder().SetNumber("555-1212").Build()
);
//Now build the final message:
Person person = newContact.Build();
//The builder is no longer valid (at least not now, scheduled for 2.4):
newContact = null;
using(MemoryStream stream = new MemoryStream())
{ {
//Save the person to a stream byte[] bytes;
person.WriteTo(stream); //Create a builder to start building a message
bytes = stream.ToArray(); Person.Builder newContact = Person.CreateBuilder();
} //Set the primitive properties
//Create another builder, merge the byte[], and build the message: newContact.SetId(1)
Person copy = Person.CreateBuilder().MergeFrom(bytes).Build(); .SetName("Foo")
.SetEmail("foo@bar");
//Now add an item to a list (repeating) field
newContact.AddPhone(
//Create the child message inline
Person.Types.PhoneNumber.CreateBuilder().SetNumber("555-1212").Build()
);
//Now build the final message:
Person person = newContact.Build();
//The builder is no longer valid (at least not now, scheduled for 2.4):
newContact = null;
using (MemoryStream stream = new MemoryStream())
{
//Save the person to a stream
person.WriteTo(stream);
bytes = stream.ToArray();
}
//Create another builder, merge the byte[], and build the message:
Person copy = Person.CreateBuilder().MergeFrom(bytes).Build();
//A more streamlined approach might look like this: //A more streamlined approach might look like this:
bytes = AddressBook.CreateBuilder().AddPerson(copy).Build().ToByteArray(); bytes = AddressBook.CreateBuilder().AddPerson(copy).Build().ToByteArray();
//And read the address book back again //And read the address book back again
AddressBook restored = AddressBook.CreateBuilder().MergeFrom(bytes).Build(); AddressBook restored = AddressBook.CreateBuilder().MergeFrom(bytes).Build();
//The message performs a deep-comparison on equality: //The message performs a deep-comparison on equality:
if(restored.PersonCount != 1 || !person.Equals(restored.PersonList[0])) if (restored.PersonCount != 1 || !person.Equals(restored.PersonList[0]))
throw new ApplicationException("There is a bad person in here!"); throw new ApplicationException("There is a bad person in here!");
}
} }
} }
} \ No newline at end of file
This diff is collapsed.
using System; using System;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("ProtoBench")]
[assembly: AssemblyDescription("")] [assembly: AssemblyTitle("ProtoBench")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("ProtoBench")] [assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2009")] [assembly: AssemblyProduct("ProtoBench")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyCulture("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // Setting ComVisible to false makes the types in this assembly not visible
// COM, set the ComVisible attribute to true on that type. // to COM components. If you need to access a type in this assembly from
[assembly: ComVisible(false)] // COM, set the ComVisible attribute to true on that type.
[assembly: CLSCompliant(true)] [assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0f515d09-9a6c-49ec-8500-14a5303ebadf")] // The following GUID is for the ID of the typelib if this project is exposed to COM
// Version information for an assembly consists of the following four values: [assembly: Guid("0f515d09-9a6c-49ec-8500-14a5303ebadf")]
//
// Major Version // Version information for an assembly consists of the following four values:
// Minor Version //
// Build Number // Major Version
// Revision // Minor Version
// // Build Number
// You can specify all the values or you can default the Build and Revision Numbers // Revision
// by using the '*' as shown below: //
// [assembly: AssemblyVersion("2.3.0.277")] // You can specify all the values or you can default the Build and Revision Numbers
[assembly: AssemblyVersion("2.3.0.277")] // by using the '*' as shown below:
[assembly: AssemblyFileVersion("2.3.0.277")] // [assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyFileVersion("2.3.0.277")]
\ No newline at end of file
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System; #endregion
using System.IO;
using System;
namespace Google.ProtocolBuffers.ProtoDump using System.IO;
{
/// <summary> namespace Google.ProtocolBuffers.ProtoDump
/// Small utility to load a binary message and dump it in text form {
/// </summary> /// <summary>
class Program { /// Small utility to load a binary message and dump it in text form
static int Main(string[] args) { /// </summary>
if (args.Length != 2) { internal class Program
Console.Error.WriteLine("Usage: ProtoDump <descriptor type name> <input data>"); {
Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,"); private static int Main(string[] args)
Console.Error.WriteLine("including assembly e.g. ProjectNamespace.Message,Company.Project"); {
return 1; if (args.Length != 2)
} {
IMessage defaultMessage; Console.Error.WriteLine("Usage: ProtoDump <descriptor type name> <input data>");
try { Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,");
defaultMessage = MessageUtil.GetDefaultMessage(args[0]); Console.Error.WriteLine("including assembly e.g. ProjectNamespace.Message,Company.Project");
} catch (ArgumentException e) { return 1;
Console.Error.WriteLine(e.Message); }
return 1; IMessage defaultMessage;
} try
try { {
IBuilder builder = defaultMessage.WeakCreateBuilderForType(); defaultMessage = MessageUtil.GetDefaultMessage(args[0]);
if (builder == null) { }
Console.Error.WriteLine("Unable to create builder"); catch (ArgumentException e)
return 1; {
} Console.Error.WriteLine(e.Message);
byte[] inputData = File.ReadAllBytes(args[1]); return 1;
builder.WeakMergeFrom(ByteString.CopyFrom(inputData)); }
Console.WriteLine(TextFormat.PrintToString(builder.WeakBuild())); try
return 0; {
} catch (Exception e) { IBuilder builder = defaultMessage.WeakCreateBuilderForType();
Console.Error.WriteLine("Error: {0}", e.Message); if (builder == null)
Console.Error.WriteLine(); {
Console.Error.WriteLine("Detailed exception information: {0}", e); Console.Error.WriteLine("Unable to create builder");
return 1; return 1;
} }
} byte[] inputData = File.ReadAllBytes(args[1]);
} builder.WeakMergeFrom(ByteString.CopyFrom(inputData));
Console.WriteLine(TextFormat.PrintToString(builder.WeakBuild()));
return 0;
}
catch (Exception e)
{
Console.Error.WriteLine("Error: {0}", e.Message);
Console.Error.WriteLine();
Console.Error.WriteLine("Detailed exception information: {0}", e);
return 1;
}
}
}
} }
\ No newline at end of file
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("ProtoDump")]
[assembly: AssemblyDescription("")] [assembly: AssemblyTitle("ProtoDump")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("ProtoDump")] [assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2009")] [assembly: AssemblyProduct("ProtoDump")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyCulture("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // Setting ComVisible to false makes the types in this assembly not visible
// COM, set the ComVisible attribute to true on that type. // to COM components. If you need to access a type in this assembly from
[assembly: ComVisible(false)] // COM, set the ComVisible attribute to true on that type.
// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: ComVisible(false)]
[assembly: Guid("fed7572b-d747-4704-a6da-6c3c61088346")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
// Version information for an assembly consists of the following four values:
// [assembly: Guid("fed7572b-d747-4704-a6da-6c3c61088346")]
// Major Version
// Minor Version // Version information for an assembly consists of the following four values:
// Build Number //
// Revision // Major Version
// // Minor Version
// You can specify all the values or you can default the Build and Revision Numbers // Build Number
// by using the '*' as shown below: // Revision
// [assembly: AssemblyVersion("2.3.0.277")] //
[assembly: AssemblyVersion("2.3.0.277")] // You can specify all the values or you can default the Build and Revision Numbers
[assembly: AssemblyFileVersion("2.3.0.277")] // by using the '*' as shown below:
// [assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyFileVersion("2.3.0.277")]
\ No newline at end of file
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration>
<startup/></configuration> <configuration>
<startup />
</configuration>
\ No newline at end of file
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("ProtoGen.Test")]
[assembly: AssemblyDescription("")] [assembly: AssemblyTitle("ProtoGen.Test")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("ProtoGen.Test")] [assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2008")] [assembly: AssemblyProduct("ProtoGen.Test")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyCulture("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // Setting ComVisible to false makes the types in this assembly not visible
// COM, set the ComVisible attribute to true on that type. // to COM components. If you need to access a type in this assembly from
[assembly: ComVisible(false)] // COM, set the ComVisible attribute to true on that type.
// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: ComVisible(false)]
[assembly: Guid("40720ee3-2d15-4271-8c42-8f9cfd01b52f")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
// Version information for an assembly consists of the following four values:
// [assembly: Guid("40720ee3-2d15-4271-8c42-8f9cfd01b52f")]
// Major Version
// Minor Version // Version information for an assembly consists of the following four values:
// Build Number //
// Revision // Major Version
// // Minor Version
// You can specify all the values or you can default the Build and Revision Numbers // Build Number
// by using the '*' as shown below: // Revision
// [assembly: AssemblyVersion("2.3.0.277")] //
[assembly: AssemblyVersion("2.3.0.277")] // You can specify all the values or you can default the Build and Revision Numbers
[assembly: AssemblyFileVersion("2.3.0.277")] // by using the '*' as shown below:
// [assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyVersion("2.3.0.277")]
[assembly: AssemblyFileVersion("2.3.0.277")]
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
namespace Google.ProtocolBuffers.ProtoGen namespace Google.ProtocolBuffers.ProtoGen
{ {
class ProtoFile : TempFile internal class ProtoFile : TempFile
{ {
public ProtoFile(string filename, string contents) public ProtoFile(string filename, string contents)
: base(filename, contents) : base(filename, contents)
{ {
} }
} }
class TempFile : IDisposable
{ internal class TempFile : IDisposable
private string tempFile; {
private string tempFile;
public static TempFile Attach(string path)
{ public static TempFile Attach(string path)
return new TempFile(path, null); {
} return new TempFile(path, null);
}
protected TempFile(string filename, string contents) {
tempFile = filename; protected TempFile(string filename, string contents)
if (contents != null) {
{ tempFile = filename;
File.WriteAllText(tempFile, contents, new UTF8Encoding(false)); if (contents != null)
} {
} File.WriteAllText(tempFile, contents, new UTF8Encoding(false));
}
public TempFile(string contents) }
: this(Path.GetTempFileName(), contents)
{ public TempFile(string contents)
} : this(Path.GetTempFileName(), contents)
{
public string TempPath { get { return tempFile; } } }
public void ChangeExtension(string ext) public string TempPath
{ {
string newFile = Path.ChangeExtension(tempFile, ext); get { return tempFile; }
File.Move(tempFile, newFile); }
tempFile = newFile;
} public void ChangeExtension(string ext)
{
public void Dispose() string newFile = Path.ChangeExtension(tempFile, ext);
{ File.Move(tempFile, newFile);
if (File.Exists(tempFile)) tempFile = newFile;
{ }
File.Delete(tempFile);
} public void Dispose()
} {
} if (File.Exists(tempFile))
} {
File.Delete(tempFile);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System; #endregion
namespace Google.ProtocolBuffers.ProtoGen { using System;
/// <summary>
/// Exception thrown when dependencies within a descriptor set can't be resolved. namespace Google.ProtocolBuffers.ProtoGen
/// </summary> {
public sealed class DependencyResolutionException : Exception { /// <summary>
public DependencyResolutionException(string message) : base(message) { /// Exception thrown when dependencies within a descriptor set can't be resolved.
} /// </summary>
public sealed class DependencyResolutionException : Exception
public DependencyResolutionException(string format, params object[] args) {
: base(string.Format(format, args)) { public DependencyResolutionException(string message) : base(message)
} {
} }
}
public DependencyResolutionException(string format, params object[] args)
: base(string.Format(format, args))
{
}
}
}
\ No newline at end of file
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System; #endregion
using Google.ProtocolBuffers.DescriptorProtos;
using Google.ProtocolBuffers.Descriptors; using System;
using Google.ProtocolBuffers.DescriptorProtos;
namespace Google.ProtocolBuffers.ProtoGen { using Google.ProtocolBuffers.Descriptors;
/// <summary>
/// Utility class for determining namespaces etc. namespace Google.ProtocolBuffers.ProtoGen
/// </summary> {
internal static class DescriptorUtil { /// <summary>
/// Utility class for determining namespaces etc.
internal static string GetFullUmbrellaClassName(IDescriptor descriptor) { /// </summary>
CSharpFileOptions options = descriptor.File.CSharpOptions; internal static class DescriptorUtil
string result = options.Namespace; {
if (result != "") { internal static string GetFullUmbrellaClassName(IDescriptor descriptor)
result += '.'; {
} CSharpFileOptions options = descriptor.File.CSharpOptions;
result += GetQualifiedUmbrellaClassName(options); string result = options.Namespace;
return "global::" + result; if (result != "")
} {
result += '.';
/// <summary> }
/// Evaluates the options and returns the qualified name of the umbrella class result += GetQualifiedUmbrellaClassName(options);
/// relative to the descriptor type's namespace. Basically concatenates the return "global::" + result;
/// UmbrellaNamespace + UmbrellaClassname fields. }
/// </summary>
internal static string GetQualifiedUmbrellaClassName(CSharpFileOptions options) { /// <summary>
string fullName = options.UmbrellaClassname; /// Evaluates the options and returns the qualified name of the umbrella class
if (!options.NestClasses && options.UmbrellaNamespace != "") { /// relative to the descriptor type's namespace. Basically concatenates the
fullName = String.Format("{0}.{1}", options.UmbrellaNamespace, options.UmbrellaClassname); /// UmbrellaNamespace + UmbrellaClassname fields.
} /// </summary>
return fullName; internal static string GetQualifiedUmbrellaClassName(CSharpFileOptions options)
} {
string fullName = options.UmbrellaClassname;
internal static string GetMappedTypeName(MappedType type) { if (!options.NestClasses && options.UmbrellaNamespace != "")
switch(type) { {
case MappedType.Int32: return "int"; fullName = String.Format("{0}.{1}", options.UmbrellaNamespace, options.UmbrellaClassname);
case MappedType.Int64: return "long"; }
case MappedType.UInt32: return "uint"; return fullName;
case MappedType.UInt64: return "ulong"; }
case MappedType.Single: return "float";
case MappedType.Double: return "double"; internal static string GetMappedTypeName(MappedType type)
case MappedType.Boolean: return "bool"; {
case MappedType.String: return "string"; switch (type)
case MappedType.ByteString: return "pb::ByteString"; {
case MappedType.Enum: return null; case MappedType.Int32:
case MappedType.Message: return null; return "int";
default: case MappedType.Int64:
throw new ArgumentOutOfRangeException("Unknown mapped type " + type); return "long";
} case MappedType.UInt32:
} return "uint";
} case MappedType.UInt64:
} return "ulong";
case MappedType.Single:
return "float";
case MappedType.Double:
return "double";
case MappedType.Boolean:
return "bool";
case MappedType.String:
return "string";
case MappedType.ByteString:
return "pb::ByteString";
case MappedType.Enum:
return null;
case MappedType.Message:
return null;
default:
throw new ArgumentOutOfRangeException("Unknown mapped type " + type);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using Google.ProtocolBuffers.Descriptors; #endregion
namespace Google.ProtocolBuffers.ProtoGen { using Google.ProtocolBuffers.Descriptors;
internal class EnumGenerator : SourceGeneratorBase<EnumDescriptor>, ISourceGenerator {
internal EnumGenerator(EnumDescriptor descriptor) : base(descriptor) { namespace Google.ProtocolBuffers.ProtoGen
} {
internal class EnumGenerator : SourceGeneratorBase<EnumDescriptor>, ISourceGenerator
// TODO(jonskeet): Write out enum descriptors? Can be retrieved from file... {
public void Generate(TextGenerator writer) { internal EnumGenerator(EnumDescriptor descriptor) : base(descriptor)
writer.WriteLine("{0} enum {1} {{", ClassAccessLevel, Descriptor.Name); {
writer.Indent(); }
foreach (EnumValueDescriptor value in Descriptor.Values) {
writer.WriteLine("{0} = {1},", value.Name, value.Number); // TODO(jonskeet): Write out enum descriptors? Can be retrieved from file...
} public void Generate(TextGenerator writer)
writer.Outdent(); {
writer.WriteLine("}"); writer.WriteLine("{0} enum {1} {{", ClassAccessLevel, Descriptor.Name);
writer.WriteLine(); writer.Indent();
} foreach (EnumValueDescriptor value in Descriptor.Values)
} {
} writer.WriteLine("{0} = {1},", value.Name, value.Number);
}
writer.Outdent();
writer.WriteLine("}");
writer.WriteLine();
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Google.ProtocolBuffers.ProtoGen { #endregion
/// <summary> namespace Google.ProtocolBuffers.ProtoGen
/// Helpers to resolve class names etc. {
/// </summary> /// <summary>
internal static class Helpers { /// Helpers to resolve class names etc.
} /// </summary>
} internal static class Helpers
{
}
}
\ No newline at end of file
#region Copyright notice and license #region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Protocol Buffers - Google's data interchange format
// http://github.com/jskeet/dotnet-protobufs/ // Copyright 2008 Google Inc. All rights reserved.
// Original C++/Java/Python code: // http://github.com/jskeet/dotnet-protobufs/
// http://code.google.com/p/protobuf/ // Original C++/Java/Python code:
// // http://code.google.com/p/protobuf/
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are // Redistribution and use in source and binary forms, with or without
// met: // modification, are permitted provided that the following conditions are
// // met:
// * Redistributions of source code must retain the above copyright //
// notice, this list of conditions and the following disclaimer. // * Redistributions of source code must retain the above copyright
// * Redistributions in binary form must reproduce the above // notice, this list of conditions and the following disclaimer.
// copyright notice, this list of conditions and the following disclaimer // * Redistributions in binary form must reproduce the above
// in the documentation and/or other materials provided with the // copyright notice, this list of conditions and the following disclaimer
// distribution. // in the documentation and/or other materials provided with the
// * Neither the name of Google Inc. nor the names of its // distribution.
// contributors may be used to endorse or promote products derived from // * Neither the name of Google Inc. nor the names of its
// this software without specific prior written permission. // contributors may be used to endorse or promote products derived from
// // this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#endregion // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Google.ProtocolBuffers.ProtoGen { #endregion
internal interface IFieldSourceGenerator {
void GenerateMembers(TextGenerator writer); namespace Google.ProtocolBuffers.ProtoGen
void GenerateBuilderMembers(TextGenerator writer); {
void GenerateMergingCode(TextGenerator writer); internal interface IFieldSourceGenerator
void GenerateBuildingCode(TextGenerator writer); {
void GenerateParsingCode(TextGenerator writer); void GenerateMembers(TextGenerator writer);
void GenerateSerializationCode(TextGenerator writer); void GenerateBuilderMembers(TextGenerator writer);
void GenerateSerializedSizeCode(TextGenerator writer); void GenerateMergingCode(TextGenerator writer);
void GenerateBuildingCode(TextGenerator writer);
void WriteHash(TextGenerator writer); void GenerateParsingCode(TextGenerator writer);
void WriteEquals(TextGenerator writer); void GenerateSerializationCode(TextGenerator writer);
void WriteToString(TextGenerator writer); void GenerateSerializedSizeCode(TextGenerator writer);
}
} void WriteHash(TextGenerator writer);
void WriteEquals(TextGenerator writer);
void WriteToString(TextGenerator writer);
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration>
<startup/></configuration> <configuration>
<startup />
</configuration>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration>
<startup/></configuration> <configuration>
<startup />
</configuration>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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