Skip to content

Commit 5802d8e

Browse files
committed
Cleaning code
1 parent 0b943fe commit 5802d8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+110
-535
lines changed

DataCommander.Providers.Msi/MsiCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void IDbCommand.Prepare()
7373

7474
IDbTransaction IDbCommand.Transaction
7575
{
76-
get { return null; }
76+
get => null;
7777

7878
set { }
7979
}

DataCommander.Providers.Tfs-15.0.0.0/TfsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void IDbCommand.Prepare()
9090

9191
IDbTransaction IDbCommand.Transaction
9292
{
93-
get { return null; }
93+
get => null;
9494

9595
set { }
9696
}

DataCommander.Providers.Wmi/WmiCommand.cs

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,24 @@ public void Prepare()
5151

5252
public int CommandTimeout
5353
{
54-
get
55-
{
56-
return 0;
57-
}
58-
set
54+
get => 0;
55+
set
5956
{
6057
}
6158
}
6259

6360
public CommandType CommandType
6461
{
65-
get
66-
{
67-
return CommandType.Text;
68-
}
69-
set
62+
get => CommandType.Text;
63+
set
7064
{
7165
}
7266
}
7367

7468
IDbConnection IDbCommand.Connection
7569
{
76-
get
77-
{
78-
return Connection;
79-
}
80-
set
70+
get => Connection;
71+
set
8172
{
8273
}
8374
}
@@ -88,22 +79,16 @@ IDbConnection IDbCommand.Connection
8879

8980
public IDbTransaction Transaction
9081
{
91-
get
92-
{
93-
return null;
94-
}
95-
set
82+
get => null;
83+
set
9684
{
9785
}
9886
}
9987

10088
public UpdateRowSource UpdatedRowSource
10189
{
102-
get
103-
{
104-
return UpdateRowSource.None;
105-
}
106-
set
90+
get => UpdateRowSource.None;
91+
set
10792
{
10893
}
10994
}

DataCommander.Providers.Wmi/WmiConnection.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ public void Open()
6969

7070
public string ConnectionString
7171
{
72-
get
73-
{
74-
return null;
75-
}
72+
get => null;
7673

7774
set
7875
{

DataCommander.Providers/AdoDB.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static void WriteSchema(_Recordset rs, TextWriter writer)
5353
var colWidth = (int) d;
5454
colWidth++;
5555

56-
foreach (ADODB.Field field in rs.Fields)
56+
foreach (Field field in rs.Fields)
5757
{
5858
var fieldType = field.Type;
5959

DataCommander.Providers/OleDBHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static DataTable Convert(_Recordset rs, out OleDbParameter[] columns)
5151
columns = new OleDbParameter[rs.Fields.Count];
5252
var index = 0;
5353

54-
foreach (ADODB.Field field in rs.Fields)
54+
foreach (Field field in rs.Fields)
5555
{
5656
var param = new OleDbParameter();
5757
param.SourceColumn = field.Name;

Foundation.NetStandard-2.0/ArgumentEqualsSelection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public sealed class ArgumentEqualsSelection<TArgument> where TArgument : IEquata
1818
/// <param name="argument"></param>
1919
public ArgumentEqualsSelection(TArgument argument)
2020
{
21-
this._argument = argument;
21+
_argument = argument;
2222
}
2323

2424
/// <summary>

Foundation.NetStandard-2.0/ArgumentIsSelection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public sealed class ArgumentIsSelection<TArgument> where TArgument : class
1818
/// <param name="argument"></param>
1919
public ArgumentIsSelection(TArgument argument)
2020
{
21-
this._argument = argument;
21+
_argument = argument;
2222
}
2323

2424
/// <summary>

Foundation.NetStandard-2.0/Collections/IndexableCollection/IndexCollection.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,7 @@ public bool Remove(ICollectionIndex<T> item)
8383
bool succeeded;
8484
var contains = _dictionary.ContainsValue(item);
8585

86-
if (contains)
87-
{
88-
succeeded = _dictionary.Remove(item.Name);
89-
}
90-
else
91-
{
92-
succeeded = false;
93-
}
86+
succeeded = contains && _dictionary.Remove(item.Name);
9487

9588
return succeeded;
9689
}

Foundation.NetStandard-2.0/CommandLine.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ public CommandLine(string commandLine)
2323
{
2424
Assert.IsNotNull(commandLine);
2525

26-
this._arguments = new IndexableCollection<CommandLineArgument>(ListIndex);
26+
_arguments = new IndexableCollection<CommandLineArgument>(ListIndex);
2727
var dictionary = new Dictionary<string, ICollection<CommandLineArgument>>(StringComparer.InvariantCultureIgnoreCase);
2828
NameIndex = new NonUniqueIndex<string, CommandLineArgument>(
2929
"nameIndex",
3030
argument => GetKeyResponse.Create(argument.Name != null, argument.Name),
3131
dictionary,
3232
() => new List<CommandLineArgument>());
33-
this._arguments.Indexes.Add(NameIndex);
33+
_arguments.Indexes.Add(NameIndex);
3434
var stringReader = new StringReader(commandLine);
3535
var arguments = Parse(stringReader);
36-
this._arguments.Add(arguments);
36+
_arguments.Add(arguments);
3737
}
3838

3939
/// <summary>
@@ -108,16 +108,7 @@ private static string ReadName(TextReader textReader)
108108
}
109109
}
110110

111-
string name;
112-
113-
if (sb.Length > 0)
114-
{
115-
name = sb.ToString();
116-
}
117-
else
118-
{
119-
name = null;
120-
}
111+
var name = sb.Length > 0 ? sb.ToString() : null;
121112

122113
return name;
123114
}

0 commit comments

Comments
 (0)