forked from DotNetAnalyzers/IDisposableAnalyzers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Using.cs
43 lines (35 loc) · 889 Bytes
/
Using.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ReSharper disable All
namespace ValidCode
{
using System;
using System.IO;
public class Using
{
public Using(IObservable<int> observable)
{
using var file = File.OpenRead(string.Empty);
IDisposable temp;
using (temp = new Disposable())
{
}
using (new Disposable())
{
}
using (var disposable = new Disposable())
{
}
using (var disposable = File.OpenRead(string.Empty))
{
}
using (File.OpenRead(string.Empty))
{
}
using (var disposable = observable.Subscribe(x => Console.WriteLine(x)))
{
}
using (observable.Subscribe(x => Console.WriteLine(x)))
{
}
}
}
}