This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-15
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,7 @@ public bool FirstRun
19
19
{
20
20
get
21
21
{
22
- if ( ! firstRunValue . HasValue )
23
- {
24
- firstRunValue = firstRun ;
25
- }
26
-
27
- if ( firstRun )
28
- {
29
- firstRun = false ;
30
- FirstRunAt = DateTimeOffset . Now ;
31
- Save ( true ) ;
32
- }
33
-
22
+ EnsureFirstRun ( ) ;
34
23
return firstRunValue . Value ;
35
24
}
36
25
}
@@ -39,17 +28,34 @@ public DateTimeOffset FirstRunAt
39
28
{
40
29
get
41
30
{
31
+ EnsureFirstRun ( ) ;
32
+
42
33
if ( ! firstRunAtValue . HasValue )
43
34
{
44
- firstRunAtValue = DateTimeOffset . Parse ( firstRunAtString ) ;
35
+ firstRunAtValue = DateTimeOffset . ParseExact ( firstRunAtString , Constants . Iso8601Format , CultureInfo . InvariantCulture ) ;
45
36
}
46
37
47
38
return firstRunAtValue . Value ;
48
39
}
49
40
private set
50
41
{
51
- firstRunAtString = value . ToString ( ) ;
52
- firstRunAtValue = null ;
42
+ firstRunAtString = value . ToString ( Constants . Iso8601Format ) ;
43
+ firstRunAtValue = value ;
44
+ }
45
+ }
46
+
47
+ private void EnsureFirstRun ( )
48
+ {
49
+ if ( ! firstRunValue . HasValue )
50
+ {
51
+ firstRunValue = firstRun ;
52
+ }
53
+
54
+ if ( firstRun )
55
+ {
56
+ firstRun = false ;
57
+ FirstRunAt = DateTimeOffset . Now ;
58
+ Save ( true ) ;
53
59
}
54
60
}
55
61
}
You can’t perform that action at this time.
0 commit comments