Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1678)

Side by Side Diff: third_party/protobuf/csharp/src/AddressBook/AddPerson.cs

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #region Copyright notice and license 1 #region Copyright notice and license
2 // Protocol Buffers - Google's data interchange format 2 // Protocol Buffers - Google's data interchange format
3 // Copyright 2008 Google Inc. All rights reserved. 3 // Copyright 2008 Google Inc. All rights reserved.
4 // https://developers.google.com/protocol-buffers/ 4 // https://developers.google.com/protocol-buffers/
5 // 5 //
6 // Redistribution and use in source and binary forms, with or without 6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are 7 // modification, are permitted provided that the following conditions are
8 // met: 8 // met:
9 // 9 //
10 // * Redistributions of source code must retain the above copyright 10 // * Redistributions of source code must retain the above copyright
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 break; 66 break;
67 } 67 }
68 68
69 Person.Types.PhoneNumber phoneNumber = new Person.Types.PhoneNum ber { Number = number }; 69 Person.Types.PhoneNumber phoneNumber = new Person.Types.PhoneNum ber { Number = number };
70 70
71 output.Write("Is this a mobile, home, or work phone? "); 71 output.Write("Is this a mobile, home, or work phone? ");
72 String type = input.ReadLine(); 72 String type = input.ReadLine();
73 switch (type) 73 switch (type)
74 { 74 {
75 case "mobile": 75 case "mobile":
76 phoneNumber.Type = Person.Types.PhoneType.MOBILE; 76 phoneNumber.Type = Person.Types.PhoneType.Mobile;
77 break; 77 break;
78 case "home": 78 case "home":
79 phoneNumber.Type = Person.Types.PhoneType.HOME; 79 phoneNumber.Type = Person.Types.PhoneType.Home;
80 break; 80 break;
81 case "work": 81 case "work":
82 phoneNumber.Type = Person.Types.PhoneType.WORK; 82 phoneNumber.Type = Person.Types.PhoneType.Work;
83 break; 83 break;
84 default: 84 default:
85 output.Write("Unknown phone type. Using default."); 85 output.Write("Unknown phone type. Using default.");
86 break; 86 break;
87 } 87 }
88 88
89 person.Phones.Add(phoneNumber); 89 person.Phones.Add(phoneNumber);
90 } 90 }
91 return person; 91 return person;
92 } 92 }
(...skipping 30 matching lines...) Expand all
123 123
124 // Write the new address book back to disk. 124 // Write the new address book back to disk.
125 using (Stream output = File.OpenWrite(args[0])) 125 using (Stream output = File.OpenWrite(args[0]))
126 { 126 {
127 addressBook.WriteTo(output); 127 addressBook.WriteTo(output);
128 } 128 }
129 return 0; 129 return 0;
130 } 130 }
131 } 131 }
132 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698