Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(101)

Delta Between Two Patch Sets: Src/GoogleApis/Apis/Util/Utilities.cs

Issue 13632059: Issue 351: Reimplement OAuth2 - Step 2 (Auth PCL - only data types) (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Left Patch Set: Created 10 years, 10 months ago
Right Patch Set: minor Created 10 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Src/GoogleApis.DotNet4/Apis/Util/Store/FileDataStore.cs ('k') | Src/GoogleApis/Properties/AssemblyInfo.cs » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 Copyright 2010 Google Inc 2 Copyright 2010 Google Inc
3 3
4 Licensed under the Apache License, Version 2.0 (the "License"); 4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License. 5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at 6 You may obtain a copy of the License at
7 7
8 http://www.apache.org/licenses/LICENSE-2.0 8 http://www.apache.org/licenses/LICENSE-2.0
9 9
10 Unless required by applicable law or agreed to in writing, software 10 Unless required by applicable law or agreed to in writing, software
(...skipping 25 matching lines...) Expand all
36 { 36 {
37 if (obj == null) 37 if (obj == null)
38 { 38 {
39 throw new ArgumentNullException(paramName); 39 throw new ArgumentNullException(paramName);
40 } 40 }
41 } 41 }
42 42
43 /// <summary> 43 /// <summary>
44 /// Throws an <seealso cref="System.ArgumentNullException"/> if the stri ng is <c>null</c> or empty. 44 /// Throws an <seealso cref="System.ArgumentNullException"/> if the stri ng is <c>null</c> or empty.
45 /// </summary> 45 /// </summary>
46 /// <returns>The original string</returns>
46 internal static string ThrowIfNullOrEmpty(this string str, string paramN ame) 47 internal static string ThrowIfNullOrEmpty(this string str, string paramN ame)
47 { 48 {
48 if (string.IsNullOrEmpty(str)) 49 if (string.IsNullOrEmpty(str))
49 { 50 {
50 throw new ArgumentException("Parameter was empty", paramName); 51 throw new ArgumentException("Parameter was empty", paramName);
51 } 52 }
52 return str; 53 return str;
53 } 54 }
54 55
55 /// <summary>Returns <c>true</c> in case the enumerable is <c>null</c> o r empty. </summary> 56 /// <summary>Returns <c>true</c> in case the enumerable is <c>null</c> o r empty. </summary>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 var enumType = o.GetType(); 101 var enumType = o.GetType();
101 FieldInfo field = enumType.GetField(o.ToString()); 102 FieldInfo field = enumType.GetField(o.ToString());
102 StringValueAttribute attribute = field.GetCustomAttribute<String ValueAttribute>(); 103 StringValueAttribute attribute = field.GetCustomAttribute<String ValueAttribute>();
103 return attribute != null ? attribute.Text : o.ToString(); 104 return attribute != null ? attribute.Text : o.ToString();
104 } 105 }
105 106
106 return o.ToString(); 107 return o.ToString();
107 } 108 }
108 } 109 }
109 } 110 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b