annotate Implab/Safe.cs @ 42:3ba6778ed336

fixed ArgumentNullException in StartLogicalOperation
author cin
date Wed, 16 Apr 2014 00:33:09 +0400
parents dafaadca5b9f
children 2c332a9c64c0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
1 using System;
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
2 using System.Collections.Generic;
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
3 using System.Linq;
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
4 using System.Text;
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
5
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
6 namespace Implab
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
7 {
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
8 public static class Safe
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
9 {
31
dafaadca5b9f minor cleanup
cin
parents: 2
diff changeset
10 public static void Dispose<T>(T obj) where T : class
1
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
11 {
2
aa367305156b small fixes
cin
parents: 1
diff changeset
12 var disp = obj as IDisposable;
aa367305156b small fixes
cin
parents: 1
diff changeset
13 if (disp != null)
aa367305156b small fixes
cin
parents: 1
diff changeset
14 disp.Dispose();
1
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
15 }
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
16 }
6fb3b01ee971 Added utility class for safe disposing methods.
cin
parents:
diff changeset
17 }