Skip to content

Commit 92af085

Browse files
Randall FlaggRandall Flagg
authored andcommitted
Solved CA1063
1 parent fde54f6 commit 92af085

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

src/LogExpert.Core/Classes/Log/LogStreamReaderBase.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected LogStreamReaderBase()
3535
/// <summary>
3636
/// Indicates whether or not the stream reader has already been disposed.
3737
/// </summary>
38-
public bool IsDisposed { get; private set; }
38+
public abstract bool IsDisposed { get; protected set; }
3939

4040
#endregion
4141

@@ -46,15 +46,8 @@ protected LogStreamReaderBase()
4646
/// </summary>
4747
public void Dispose()
4848
{
49-
try
50-
{
51-
Dispose(true);
52-
GC.SuppressFinalize(this);
53-
}
54-
finally
55-
{
56-
IsDisposed = true;
57-
}
49+
Dispose(true);
50+
GC.SuppressFinalize(this);
5851
}
5952
/// <summary>
6053
/// Destroy and release the current stream reader.

src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ protected override void Dispose (bool disposing)
8888
{
8989
_stream.Dispose();
9090
_reader.Dispose();
91-
}
91+
IsDisposed = true;
92+
}
9293
}
9394

9495
//TODO This is unsafe and should be refactored

src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderLegacy.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class PositionAwareStreamReaderLegacy : PositionAwareStreamReaderBase
1111
private int _charBufferPos;
1212
private bool _crDetect;
1313

14+
public override bool IsDisposed { get; protected set; }
15+
1416
#endregion
1517

1618
#region cTor

src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderSystem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class PositionAwareStreamReaderSystem : PositionAwareStreamReaderBase
1717

1818
private int _newLineSequenceLength;
1919

20+
public override bool IsDisposed { get; protected set; }
21+
2022
#endregion
2123

2224
#region cTor

src/LogExpert.Core/Classes/xml/XmlBlockSplitter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class XmlBlockSplitter : LogStreamReaderBase
2424
private string _stylesheet;
2525
private XslCompiledTransform _xslt;
2626

27+
public override bool IsDisposed { get; protected set; }
28+
2729
#endregion
2830

2931
#region cTor
@@ -136,6 +138,7 @@ protected override void Dispose(bool disposing)
136138
if (disposing)
137139
{
138140
_reader.Dispose();
141+
IsDisposed = true;
139142
}
140143
}
141144

src/LogExpert.Core/Classes/xml/XmlLogReader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class XmlLogReader : LogStreamReaderBase
1010
#region Fields
1111

1212
private readonly ILogStreamReader reader;
13+
public override bool IsDisposed { get; protected set; }
1314

1415
#endregion
1516

@@ -47,6 +48,7 @@ protected override void Dispose(bool disposing)
4748
if (disposing)
4849
{
4950
reader.Dispose();
51+
IsDisposed = true;
5052
}
5153
}
5254

0 commit comments

Comments
 (0)