mirror of https://github.com/icsharpcode/ILSpy.git
2 changed files with 16 additions and 28 deletions
@ -1,28 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.IO; |
|
||||||
|
|
||||||
namespace ICSharpCode.Decompiler.Tests |
|
||||||
{ |
|
||||||
public class NotUsingBlock |
|
||||||
{ |
|
||||||
public void ThisIsNotAUsingBlock() |
|
||||||
{ |
|
||||||
object obj = File.OpenRead("..."); |
|
||||||
IDisposable disposable; |
|
||||||
try |
|
||||||
{ |
|
||||||
(obj as FileStream).WriteByte(2); |
|
||||||
Console.WriteLine("some text"); |
|
||||||
} |
|
||||||
finally |
|
||||||
{ |
|
||||||
disposable = (obj as IDisposable); |
|
||||||
if (disposable != null) |
|
||||||
{ |
|
||||||
disposable.Dispose(); |
|
||||||
} |
|
||||||
} |
|
||||||
Console.WriteLine(disposable); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue