Skip to content

Commit b3e07e7

Browse files
committed
Refactor parameter names and simplify iteration
Changed parameter name `innerResult` to `methodInnerResult` in `OnInnerResultCompleted` method across multiple files in the `Caliburn.Micro` namespace for consistency: - `ContinueResultDecorator.cs` - `OverrideCancelResultDecorator.cs` - `RescueResultDecorator.cs` - `ResultDecoratorBase.cs` Removed unnecessary variable `keys` in `HttpUtility.cs` within the `Caliburn.Micro.Maui` namespace, directly iterating over `this.Keys` in the `foreach` loop to simplify the code. Closes Caliburn-Micro#940 Closes Caliburn-Micro#939
1 parent 664e243 commit b3e07e7

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

src/Caliburn.Micro.Core/ContinueResultDecorator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ public ContinueResultDecorator(IResult result, Func<IResult> coroutine)
3030
/// Called when the execution of the decorated result has completed.
3131
/// </summary>
3232
/// <param name="context">The context.</param>
33-
/// <param name="innerResult">The decorated result.</param>
33+
/// <param name="methodInnerResult">The decorated result.</param>
3434
/// <param name="args">The <see cref="ResultCompletionEventArgs" /> instance containing the event data.</param>
35-
protected override void OnInnerResultCompleted(CoroutineExecutionContext context, IResult innerResult, ResultCompletionEventArgs args)
35+
protected override void OnInnerResultCompleted(CoroutineExecutionContext context, IResult methodInnerResult, ResultCompletionEventArgs args)
3636
{
3737
if (args.Error != null || !args.WasCancelled)
3838
{
3939
OnCompleted(new ResultCompletionEventArgs { Error = args.Error });
4040
}
4141
else
4242
{
43-
Log.Info(string.Format("Executing coroutine because {0} was cancelled.", innerResult.GetType().Name));
43+
Log.Info(string.Format("Executing coroutine because {0} was cancelled.", methodInnerResult.GetType().Name));
4444
Continue(context);
4545
}
4646
}

src/Caliburn.Micro.Core/OverrideCancelResultDecorator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public OverrideCancelResultDecorator(IResult result)
1818
/// Called when the execution of the decorated result has completed.
1919
/// </summary>
2020
/// <param name="context">The context.</param>
21-
/// <param name="innerResult">The decorated result.</param>
21+
/// <param name="methodInnerResult">The decorated result.</param>
2222
/// <param name="args">The <see cref="ResultCompletionEventArgs" /> instance containing the event data.</param>
23-
protected override void OnInnerResultCompleted(CoroutineExecutionContext context, IResult innerResult, ResultCompletionEventArgs args)
23+
protected override void OnInnerResultCompleted(CoroutineExecutionContext context, IResult methodInnerResult, ResultCompletionEventArgs args)
2424
{
2525
if (args.WasCancelled)
2626
{
27-
Log.Info(string.Format("Overriding WasCancelled from {0}.", innerResult.GetType().Name));
27+
Log.Info(string.Format("Overriding WasCancelled from {0}.", methodInnerResult.GetType().Name));
2828
}
2929

3030
OnCompleted(new ResultCompletionEventArgs { Error = args.Error });

src/Caliburn.Micro.Core/RescueResultDecorator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public RescueResultDecorator(IResult result, Func<TException, IResult> coroutine
2828
/// Called when the execution of the decorated result has completed.
2929
/// </summary>
3030
/// <param name="context">The context.</param>
31-
/// <param name="innerResult">The decorated result.</param>
31+
/// <param name="methodInnerResult">The decorated result.</param>
3232
/// <param name="args">The <see cref="ResultCompletionEventArgs" /> instance containing the event data.</param>
33-
protected override void OnInnerResultCompleted(CoroutineExecutionContext context, IResult innerResult, ResultCompletionEventArgs args)
33+
protected override void OnInnerResultCompleted(CoroutineExecutionContext context, IResult methodInnerResult, ResultCompletionEventArgs args)
3434
{
3535
var error = args.Error as TException;
3636
if (error == null)
@@ -40,7 +40,7 @@ protected override void OnInnerResultCompleted(CoroutineExecutionContext context
4040
else
4141
{
4242
Log.Error(error);
43-
Log.Info(string.Format("Executing coroutine because {0} threw an exception.", innerResult.GetType().Name));
43+
Log.Info(string.Format("Executing coroutine because {0} threw an exception.", methodInnerResult.GetType().Name));
4444
Rescue(context, error);
4545
}
4646
}

src/Caliburn.Micro.Core/ResultDecoratorBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ private void InnerResultCompleted(object sender, ResultCompletionEventArgs args)
5050
/// Called when the execution of the decorated result has completed.
5151
/// </summary>
5252
/// <param name="context">The context.</param>
53-
/// <param name="innerResult">The decorated result.</param>
53+
/// <param name="methodInnerResult">The decorated result.</param>
5454
/// <param name="args">The <see cref="ResultCompletionEventArgs"/> instance containing the event data.</param>
55-
protected abstract void OnInnerResultCompleted(CoroutineExecutionContext context, IResult innerResult, ResultCompletionEventArgs args);
55+
protected abstract void OnInnerResultCompleted(CoroutineExecutionContext context, IResult methodInnerResult, ResultCompletionEventArgs args);
5656

5757
/// <summary>
5858
/// Occurs when execution has completed.

src/Caliburn.Micro.Platform/Platforms/Maui/HttpUtility.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public override string ToString()
4646
if (count == 0)
4747
return "";
4848
StringBuilder sb = new StringBuilder();
49-
var keys = this.Keys;
5049
foreach (var key in this.Keys)
5150
{
5251
sb.AppendFormat("{0}={1}&", key, this[key]);

0 commit comments

Comments
 (0)