@@ -5,7 +5,8 @@ namespace Open.Threading
55{
66 public class Progress
77 {
8- public Progress ( ) {
8+ public Progress ( )
9+ {
910 Index = 0 ;
1011 Count = 0 ;
1112
@@ -66,8 +67,8 @@ public void Start(int? newCount = null)
6667
6768 public void Run ( Action closure , bool propagateException = false )
6869 {
69- if ( closure == null )
70- throw new ArgumentNullException ( " closure" ) ;
70+ if ( closure == null )
71+ throw new ArgumentNullException ( nameof ( closure ) ) ;
7172
7273 Start ( ) ;
7374 try
@@ -85,8 +86,8 @@ public void Run(Action closure, bool propagateException = false)
8586
8687 public T Execute < T > ( Func < T > query , bool propagateException = false )
8788 {
88- if ( query == null )
89- throw new ArgumentNullException ( " query" ) ;
89+ if ( query == null )
90+ throw new ArgumentNullException ( nameof ( query ) ) ;
9091
9192 Start ( ) ;
9293 try
@@ -95,7 +96,7 @@ public T Execute<T>(Func<T> query, bool propagateException = false)
9596 Finish ( ) ;
9697 return result ;
9798 }
98- catch ( Exception ex )
99+ catch ( Exception ex )
99100 {
100101 Failed ( ex . ToString ( ) ) ;
101102 if ( propagateException )
@@ -127,7 +128,7 @@ public double Value
127128 if ( Count == 0 )
128129 return 0 ; // Signify it hasn'T started.
129130
130- return ( double ) Index / Count ;
131+ return ( double ) Index / Count ;
131132 }
132133 }
133134
@@ -145,9 +146,9 @@ public string Message
145146
146147 public void Failed ( Exception ex )
147148 {
148- if ( ex == null )
149- throw new ArgumentNullException ( "ex" ) ;
150-
149+ if ( ex == null )
150+ throw new ArgumentNullException ( nameof ( ex ) ) ;
151+
151152 Failed ( ex . ToString ( ) ) ;
152153 }
153154
@@ -188,7 +189,7 @@ public TimeSpan EstimatedTimeLeft
188189 {
189190 get
190191 {
191- if ( Index == 0 || Count == 0 )
192+ if ( Index == 0 || Count == 0 )
192193 return TimeSpan . MaxValue ;
193194
194195 var remaining = Count - Index ;
@@ -205,7 +206,7 @@ public string EstimatedTimeLeftString
205206 {
206207 get
207208 {
208- return EstimatedTimeLeft . ToString ( ) ; //.ToStringVerbose();
209+ return EstimatedTimeLeft . ToString ( ) ; //.ToStringVerbose();
209210 }
210211 }
211212
0 commit comments