comparison Implab/Safe.cs @ 55:c0bf853aa04f

Added initial JSON support +JSONParser +JSONWriter
author cin
date Sun, 15 Jun 2014 19:39:11 +0400
parents 2c332a9c64c0
children 790e8a997d30
comparison
equal deleted inserted replaced
51:2c332a9c64c0 55:c0bf853aa04f
23 public static void ArgumentNotNull(object param, string name) { 23 public static void ArgumentNotNull(object param, string name) {
24 if (param == null) 24 if (param == null)
25 throw new ArgumentNullException(name); 25 throw new ArgumentNullException(name);
26 } 26 }
27 27
28 public static void ArgumentInRange(int arg, int min, int max, string name) {
29 if (arg < min || arg > max)
30 throw new ArgumentOutOfRangeException(name);
31 }
32
28 public static void Dispose<T>(T obj) where T : class 33 public static void Dispose<T>(T obj) where T : class
29 { 34 {
30 var disp = obj as IDisposable; 35 var disp = obj as IDisposable;
31 if (disp != null) 36 if (disp != null)
32 disp.Dispose(); 37 disp.Dispose();