@@ -17,24 +17,14 @@ namespace TextFilter
1717{
1818 public class AsynchronousCommand : Command , INotifyPropertyChanged
1919 {
20- #region Protected Fields
21-
2220 protected Dispatcher callingDispatcher ;
2321
24- #endregion Protected Fields
25-
26- #region Private Fields
27-
2822 private Command cancelCommand ;
2923
3024 private bool isCancellationRequested ;
3125
3226 private bool isExecuting = false ;
3327
34- #endregion Private Fields
35-
36- #region Public Constructors
37-
3828 public AsynchronousCommand ( Action action , bool canExecute = true )
3929 : base ( action , canExecute )
4030 {
@@ -49,18 +39,10 @@ public AsynchronousCommand(Action<object> parameterizedAction, bool canExecute =
4939 Initialise ( ) ;
5040 }
5141
52- #endregion Public Constructors
53-
54- #region Public Events
55-
5642 public event CommandEventHandler Cancelled ;
5743
5844 public event PropertyChangedEventHandler PropertyChanged ;
5945
60- #endregion Public Events
61-
62- #region Public Properties
63-
6446 public Command CancelCommand
6547 {
6648 get { return cancelCommand ; }
@@ -98,10 +80,6 @@ public bool IsExecuting
9880 }
9981 }
10082
101- #endregion Public Properties
102-
103- #region Public Methods
104-
10583 public bool CancelIfRequested ( )
10684 {
10785 // If we haven't requested cancellation, there's nothing to do.
@@ -176,10 +154,6 @@ public void ReportProgress(Action action)
176154 }
177155 }
178156
179- #endregion Public Methods
180-
181- #region Protected Methods
182-
183157 protected void InvokeCancelled ( CommandEventArgs args )
184158 {
185159 CommandEventHandler cancelled = Cancelled ;
@@ -189,10 +163,6 @@ protected void InvokeCancelled(CommandEventArgs args)
189163 cancelled ( this , args ) ;
190164 }
191165
192- #endregion Protected Methods
193-
194- #region Private Methods
195-
196166 private void Initialise ( )
197167 {
198168 // Construct the cancel command.
@@ -214,7 +184,5 @@ private void NotifyPropertyChanged(string propertyName)
214184 if ( propertyChanged != null )
215185 propertyChanged ( this , new PropertyChangedEventArgs ( propertyName ) ) ;
216186 }
217-
218- #endregion Private Methods
219187 }
220188}
0 commit comments