Skip to content

Commit ad63b83

Browse files
authored
Merge pull request Caliburn-Micro#941 from Caliburn-Micro/940-fix-code-scanning-alert-useless-assignment-to-local-variable
Refactor parameter names and simplify iteration
2 parents 664e243 + 33709af commit ad63b83

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

src/Caliburn.Micro.Core/ContinueResultDecorator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ public ContinueResultDecorator(IResult result, Func<IResult> coroutine)
2929
/// <summary>
3030
/// Called when the execution of the decorated result has completed.
3131
/// </summary>
32-
/// <param name="context">The context.</param>
33-
/// <param name="innerResult">The decorated result.</param>
32+
/// <param name="methodContext">The context.</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 methodContext, 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));
44-
Continue(context);
43+
Log.Info(string.Format("Executing coroutine because {0} was cancelled.", methodInnerResult.GetType().Name));
44+
Continue(methodContext);
4545
}
4646
}
4747

src/Caliburn.Micro.Core/OverrideCancelResultDecorator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ public OverrideCancelResultDecorator(IResult result)
1717
/// <summary>
1818
/// Called when the execution of the decorated result has completed.
1919
/// </summary>
20-
/// <param name="context">The context.</param>
21-
/// <param name="innerResult">The decorated result.</param>
20+
/// <param name="methodContext">The context.</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 methodContext, 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public RescueResultDecorator(IResult result, Func<TException, IResult> coroutine
2727
/// <summary>
2828
/// Called when the execution of the decorated result has completed.
2929
/// </summary>
30-
/// <param name="context">The context.</param>
31-
/// <param name="innerResult">The decorated result.</param>
30+
/// <param name="methodContext">The context.</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 methodContext, IResult methodInnerResult, ResultCompletionEventArgs args)
3434
{
3535
var error = args.Error as TException;
3636
if (error == null)
@@ -40,8 +40,8 @@ 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));
44-
Rescue(context, error);
43+
Log.Info(string.Format("Executing coroutine because {0} threw an exception.", methodInnerResult.GetType().Name));
44+
Rescue(methodContext, error);
4545
}
4646
}
4747

src/Caliburn.Micro.Core/ResultDecoratorBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ private void InnerResultCompleted(object sender, ResultCompletionEventArgs args)
4949
/// <summary>
5050
/// Called when the execution of the decorated result has completed.
5151
/// </summary>
52-
/// <param name="context">The context.</param>
53-
/// <param name="innerResult">The decorated result.</param>
52+
/// <param name="methodContext">The context.</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 methodContext, IResult methodInnerResult, ResultCompletionEventArgs args);
5656

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

src/Caliburn.Micro.Platform/Bind.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void DataContextChanged(DependencyObject d, DependencyPropertyChangedEven
265265
return;
266266

267267
var enable = d.GetValue(AtDesignTimeProperty);
268-
if (enable == null || ((bool)enable) == false || e.NewValue == null)
268+
if (enable == null || !((bool)enable) || e.NewValue == null)
269269
return;
270270

271271
var fe = d as FrameworkElement;

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)