Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.

Commit 0620c13

Browse files
committed
code formatting: removing redundant empty lines, using statements etc
1 parent 9f86964 commit 0620c13

Some content is hidden

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

41 files changed

+604
-905
lines changed

src/CFException.cs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,12 @@ protected CFException(SerializationInfo info, StreamingContext context)
3434
public CFException(string message)
3535
: base(message, null)
3636
{
37-
3837
}
3938

4039
public CFException(string message, Exception innerException)
4140
: base(message, innerException)
4241
{
43-
4442
}
45-
4643
}
4744

4845
/// <summary>
@@ -68,15 +65,12 @@ protected CFDisposedException(SerializationInfo info, StreamingContext context)
6865
public CFDisposedException(string message)
6966
: base(message, null)
7067
{
71-
7268
}
7369

7470
public CFDisposedException(string message, Exception innerException)
7571
: base(message, innerException)
7672
{
77-
7873
}
79-
8074
}
8175

8276
/// <summary>
@@ -100,15 +94,12 @@ protected CFFileFormatException(SerializationInfo info, StreamingContext context
10094
public CFFileFormatException(string message)
10195
: base(message, null)
10296
{
103-
10497
}
10598

10699
public CFFileFormatException(string message, Exception innerException)
107100
: base(message, innerException)
108101
{
109-
110102
}
111-
112103
}
113104

114105
/// <summary>
@@ -118,7 +109,6 @@ public CFFileFormatException(string message, Exception innerException)
118109
[Serializable]
119110
public class CFItemNotFound : CFException
120111
{
121-
122112
#if !NETSTANDARD1_6
123113
protected CFItemNotFound(SerializationInfo info, StreamingContext context)
124114
: base(info, context)
@@ -134,15 +124,12 @@ public CFItemNotFound()
134124
public CFItemNotFound(string message)
135125
: base(message, null)
136126
{
137-
138127
}
139128

140129
public CFItemNotFound(string message, Exception innerException)
141130
: base(message, innerException)
142131
{
143-
144132
}
145-
146133
}
147134

148135
/// <summary>
@@ -151,7 +138,7 @@ public CFItemNotFound(string message, Exception innerException)
151138
[Serializable]
152139
public class CFInvalidOperation : CFException
153140
{
154-
public CFInvalidOperation()
141+
public CFInvalidOperation()
155142
: base()
156143
{
157144
}
@@ -166,15 +153,12 @@ protected CFInvalidOperation(SerializationInfo info, StreamingContext context)
166153
public CFInvalidOperation(string message)
167154
: base(message, null)
168155
{
169-
170156
}
171157

172158
public CFInvalidOperation(string message, Exception innerException)
173159
: base(message, innerException)
174160
{
175-
176161
}
177-
178162
}
179163

180164
/// <summary>
@@ -203,13 +187,11 @@ protected CFDuplicatedItemException(SerializationInfo info, StreamingContext con
203187
public CFDuplicatedItemException(string message)
204188
: base(message, null)
205189
{
206-
207190
}
208191

209192
public CFDuplicatedItemException(string message, Exception innerException)
210193
: base(message, innerException)
211194
{
212-
213195
}
214196
}
215197

@@ -237,15 +219,11 @@ protected CFCorruptedFileException(SerializationInfo info, StreamingContext cont
237219
public CFCorruptedFileException(string message)
238220
: base(message, null)
239221
{
240-
241222
}
242223

243224
public CFCorruptedFileException(string message, Exception innerException)
244225
: base(message, innerException)
245226
{
246-
247227
}
248-
249228
}
250-
251-
}
229+
}

src/CFItem.cs

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-

21
/* This Source Code Form is subject to the terms of the Mozilla Public
32
* License, v. 2.0. If a copy of the MPL was not distributed with this
43
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -47,7 +46,8 @@ protected CompoundFile CompoundFile
4746
protected void CheckDisposed()
4847
{
4948
if (compoundFile.IsClosed)
50-
throw new CFDisposedException("Owner Compound file has been closed and owned items have been invalidated");
49+
throw new CFDisposedException(
50+
"Owner Compound file has been closed and owned items have been invalidated");
5151
}
5252

5353
protected CFItem()
@@ -70,21 +70,18 @@ internal IDirectoryEntry DirEntry
7070
}
7171

7272

73-
7473
internal int CompareTo(CFItem other)
7574
{
76-
7775
return this.dirEntry.CompareTo(other.DirEntry);
7876
}
7977

80-
8178
#endregion
8279

8380
#region IComparable Members
8481

8582
public int CompareTo(object obj)
8683
{
87-
return this.dirEntry.CompareTo(((CFItem)obj).DirEntry);
84+
return this.dirEntry.CompareTo(((CFItem) obj).DirEntry);
8885
}
8986

9087
#endregion
@@ -98,7 +95,7 @@ public int CompareTo(object obj)
9895
}
9996

10097
// If one is null, but not both, return false.
101-
if (((object)leftItem == null) || ((object)rightItem == null))
98+
if (((object) leftItem == null) || ((object) rightItem == null))
10299
{
103100
return false;
104101
}
@@ -145,10 +142,7 @@ public String Name
145142
/// </summary>
146143
public long Size
147144
{
148-
get
149-
{
150-
return this.dirEntry.Size;
151-
}
145+
get { return this.dirEntry.Size; }
152146
}
153147

154148

@@ -161,10 +155,7 @@ public long Size
161155
/// </remarks>
162156
public bool IsStorage
163157
{
164-
get
165-
{
166-
return this.dirEntry.StgType == StgType.StgStorage;
167-
}
158+
get { return this.dirEntry.StgType == StgType.StgStorage; }
168159
}
169160

170161
/// <summary>
@@ -176,10 +167,7 @@ public bool IsStorage
176167
/// </remarks>
177168
public bool IsStream
178169
{
179-
get
180-
{
181-
return this.dirEntry.StgType == StgType.StgStream;
182-
}
170+
get { return this.dirEntry.StgType == StgType.StgStream; }
183171
}
184172

185173
/// <summary>
@@ -191,21 +179,15 @@ public bool IsStream
191179
/// </remarks>
192180
public bool IsRoot
193181
{
194-
get
195-
{
196-
return this.dirEntry.StgType == StgType.StgRoot;
197-
}
182+
get { return this.dirEntry.StgType == StgType.StgRoot; }
198183
}
199184

200185
/// <summary>
201186
/// Get/Set the Creation Date of the current item
202187
/// </summary>
203188
public DateTime CreationDate
204189
{
205-
get
206-
{
207-
return DateTime.FromFileTime(BitConverter.ToInt64(this.dirEntry.CreationDate, 0));
208-
}
190+
get { return DateTime.FromFileTime(BitConverter.ToInt64(this.dirEntry.CreationDate, 0)); }
209191

210192
set
211193
{
@@ -221,10 +203,7 @@ public DateTime CreationDate
221203
/// </summary>
222204
public DateTime ModifyDate
223205
{
224-
get
225-
{
226-
return DateTime.FromFileTime(BitConverter.ToInt64(this.dirEntry.ModifyDate, 0));
227-
}
206+
get { return DateTime.FromFileTime(BitConverter.ToInt64(this.dirEntry.ModifyDate, 0)); }
228207

229208
set
230209
{
@@ -240,10 +219,7 @@ public DateTime ModifyDate
240219
/// </summary>
241220
public Guid CLSID
242221
{
243-
get
244-
{
245-
return this.dirEntry.StorageCLSID;
246-
}
222+
get { return this.dirEntry.StorageCLSID; }
247223
set
248224
{
249225
if (this.dirEntry.StgType != StgType.StgStream)
@@ -263,9 +239,10 @@ int IComparable<CFItem>.CompareTo(CFItem other)
263239
public override string ToString()
264240
{
265241
if (this.dirEntry != null)
266-
return "[" + this.dirEntry.LeftSibling + "," + this.dirEntry.SID + "," + this.dirEntry.RightSibling + "]" + " " + this.dirEntry.GetEntryName();
242+
return "[" + this.dirEntry.LeftSibling + "," + this.dirEntry.SID + "," + this.dirEntry.RightSibling +
243+
"]" + " " + this.dirEntry.GetEntryName();
267244
else
268245
return String.Empty;
269246
}
270247
}
271-
}
248+
}

0 commit comments

Comments
 (0)