Skip to content

Commit eb2a712

Browse files
- remove redundant using statements
- remove redundant qualifiers - add missing asserts
1 parent 3f6ecda commit eb2a712

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

Sources/LambdaConverters.Wpf/MultiValueConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ protected override object ConvertInternal(object[] values, object parameter, Cul
175175
}
176176
}
177177

178+
Debug.Assert(convertFunction != null);
179+
178180
return convertFunction(new MultiValueConverterArgs<I>(new ReadOnlyCollection<I>(inputValues), culture));
179181
}
180182

@@ -257,6 +259,8 @@ protected override object ConvertInternal(object[] values, object parameter, Cul
257259
}
258260
}
259261

262+
Debug.Assert(convertFunction != null);
263+
260264
return convertFunction(new MultiValueConverterArgs<I, P>(new ReadOnlyCollection<I>(inputValues), parameterValue, culture));
261265
}
262266

Sources/LambdaConverters.Wpf/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
33

4-
// General Information about an assembly is controlled through the following
4+
// General Information about an assembly is controlled through the following
55
// set of attributes. Change these attribute values to modify the information
66
// associated with an assembly.
77
[assembly: AssemblyTrademark("")]
88
[assembly: AssemblyCulture("")]
99
[assembly: AssemblyCopyright("© 2017 Michael Damatov, Dimitri Enns.")]
1010

11-
// Setting ComVisible to false makes the types in this assembly not visible
12-
// to COM components. If you need to access a type in this assembly from
11+
// Setting ComVisible to false makes the types in this assembly not visible
12+
// to COM components. If you need to access a type in this assembly from
1313
// COM, set the ComVisible attribute to true on that type.
1414
[assembly: ComVisible(false)]
1515

Sources/LambdaConverters.Wpf/RuleErrorStrategy.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Windows.Controls;
2-
3-
namespace LambdaConverters
1+
namespace LambdaConverters
42
{
53
/// <summary>
64
/// Defines the validation rule error strategy.

Sources/LambdaConverters.Wpf/TemplateSelector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace LambdaConverters
1111
/// </summary>
1212
public static class TemplateSelector
1313
{
14-
sealed class Selector<I> : System.Windows.Controls.DataTemplateSelector
14+
sealed class Selector<I> : DataTemplateSelector
1515
{
1616
readonly Func<TemplateSelectorArgs<I>, DataTemplate> selectFunction;
1717

@@ -63,7 +63,7 @@ DataTemplate SelectTemplateInternal(object item, DependencyObject container)
6363

6464
public override DataTemplate SelectTemplate(object item, DependencyObject container)
6565
{
66-
if (this.selectFunction == null)
66+
if (selectFunction == null)
6767
{
6868
EventSource.Log.MissingSelectTemplateFunction("selectFunction", ErrorStrategy.ToString());
6969

Sources/LambdaConverters.Wpf/Validator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace LambdaConverters
1111
/// </summary>
1212
public static class Validator
1313
{
14-
sealed class Rule<I> : System.Windows.Controls.ValidationRule
14+
sealed class Rule<I> : ValidationRule
1515
{
1616
readonly Func<ValidationRuleArgs<I>, ValidationResult> ruleFunction;
1717

@@ -65,7 +65,7 @@ ValidationResult ValidateInternal(object item, CultureInfo cultureInfo)
6565

6666
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
6767
{
68-
if (this.ruleFunction == null)
68+
if (ruleFunction == null)
6969
{
7070
EventSource.Log.MissingRuleFunction("ruleFunction", ErrorStrategy.ToString());
7171

Sources/Tests.LambdaConverters.Wpf/Properties/AssemblyInfo.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
33

4-
// General Information about an assembly is controlled through the following
4+
// General Information about an assembly is controlled through the following
55
// set of attributes. Change these attribute values to modify the information
66
// associated with an assembly.
77
[assembly: AssemblyTitle("Tests.LambdaConverters.Wpf")]
88
[assembly: AssemblyDescription("")]
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("")]
1111
[assembly: AssemblyProduct("Tests.LambdaConverters.Wpf")]
12-
[assembly: AssemblyCopyright("Copyright © 2016")]
12+
[assembly: AssemblyCopyright("")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

16-
// Setting ComVisible to false makes the types in this assembly not visible
17-
// to COM components. If you need to access a type in this assembly from
16+
// Setting ComVisible to false makes the types in this assembly not visible
17+
// to COM components. If you need to access a type in this assembly from
1818
// COM, set the ComVisible attribute to true on that type.
1919
[assembly: ComVisible(false)]
2020

@@ -24,11 +24,11 @@
2424
// Version information for an assembly consists of the following four values:
2525
//
2626
// Major Version
27-
// Minor Version
27+
// Minor Version
2828
// Build Number
2929
// Revision
3030
//
31-
// You can specify all the values or you can default the Build and Revision Numbers
31+
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
3434
[assembly: AssemblyVersion("1.0.0.0")]

Sources/Tests.Shared/SequenceAssert.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public static void DoesNotContain<T>([NotNull] IEnumerable<T> sequence, T item,
7171

7272
public static void AreEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> equalityComparer = null)
7373
{
74-
string reason;
75-
if (!AreEqual(expected, actual, equalityComparer, out reason))
74+
if (!AreEqual(expected, actual, equalityComparer, out var reason))
7675
{
7776
throw new AssertFailedException(string.Format("{0} failed. {1}", nameof(AreEqual), reason));
7877
}

0 commit comments

Comments
 (0)