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

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

Issue 13972043: Issue 351: Reimplement OAuth2 (Step 3 - Tests, Flows and Credential) (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Left Patch Set: minor Created 10 years, 10 months ago
Right Patch Set: minor Created 10 years, 9 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:
Right: Side by side diff | Download
« no previous file with change/comment | « Src/GoogleApis.Auth/Properties/AssemblyInfo.cs ('k') | Src/GoogleApis/Apis/Util/Store/IDataStore.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
(no file at all)
1 /* 1 /*
2 Copyright 2013 Google Inc 2 Copyright 2013 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
11 distributed under the License is distributed on an "AS IS" BASIS, 11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and 13 See the License for the specific language governing permissions and
14 limitations under the License. 14 limitations under the License.
15 */ 15 */
16 16
17 using System; 17 using System;
18 18
19 namespace Google.Apis.Util 19 namespace Google.Apis.Util
20 { 20 {
21 /// <summary>Clock wrapper for getting the current time.</summary> 21 /// <summary>Clock wrapper for getting the current time.</summary>
22 public interface IClock 22 public interface IClock
23 { 23 {
24 /// <summary> 24 /// <summary>
25 /// Gets a <seealso cref="DateTime"/> object that is set to the current date and time on this computer,· 25 /// Gets a <seealso cref="DateTime"/> object that is set to the current date and time on this computer,·
26 /// expressed as the local time. 26 /// expressed as the local time.
27 /// </summary> 27 /// </summary>
28 DateTime Now { get; } 28 DateTime Now { get; }
29
30 /// <summary>
31 /// Gets a <seealso cref="DateTime"/> object that is set to the current date and time on this computer,·
32 /// expressed as UTC time.
33 /// </summary>
34 DateTime UtcNow { get; }
29 } 35 }
30 36
31 /// <summary>A default clock implementation that wraps the <seealso cref="Da teTime.Now"/> property.</summary> 37 /// <summary>A default clock implementation that wraps the <seealso cref="Da teTime.Now"/> property.</summary>
32 public class SystemClock : IClock 38 public class SystemClock : IClock
33 { 39 {
34 /// <summary>Constructs a new system clock.</summary> 40 /// <summary>Constructs a new system clock.</summary>
35 protected SystemClock() { } 41 protected SystemClock() { }
36 42
37 /// <summary>The default instance.</summary> 43 /// <summary>The default instance.</summary>
38 public static readonly IClock Default = new SystemClock(); 44 public static readonly IClock Default = new SystemClock();
39 45
40 public DateTime Now 46 public DateTime Now
41 { 47 {
42 get { return DateTime.Now; } 48 get { return DateTime.Now; }
43 } 49 }
50
51 public DateTime UtcNow
52 {
53 get { return DateTime.UtcNow; }
54 }
44 } 55 }
45 } 56 }
LEFTRIGHT

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