Definition at line 243 of file Version.cs.
244 {
245 switch (fieldCount)
246 {
247 default:
248 ThrowArgumentException("4");
249 break;
250 case 3:
251 case 4:
253 {
255 {
256 ThrowArgumentException("3");
257 }
258 }
259 else
260 {
261 ThrowArgumentException("2");
262 }
263 break;
264 case 0:
265 case 1:
266 case 2:
267 break;
268 }
269 int num = 0;
270 for (
int i = 0;
i < fieldCount;
i++)
271 {
272 if (i != 0)
273 {
275 {
276 charsWritten = 0;
277 return false;
278 }
281 num++;
282 }
283 if (!(i switch
284 {
290 {
291 charsWritten = 0;
292 return false;
293 }
294 num += charsWritten2;
296 }
297 charsWritten = num;
298 return true;
299 static void ThrowArgumentException(string failureUpperBound)
300 {
301 throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper,
"0", failureUpperBound),
"fieldCount");
302 }
303 }
bool TryFormat(Span< char > destination, out int charsWritten)
References System.Version._Build, System.Version._Major, System.Version._Minor, System.Version._Revision, System.SR.ArgumentOutOfRange_Bounds_Lower_Upper, System.destination, System.SR.Format(), and System.Version.TryFormat().