public static void Finally <T>(this TryUnit <T> tryUnit) where T : class { try { tryUnit.Action(tryUnit.Obj); } finally { } }
public static CatchUnit <T> Catch <T>(this TryUnit <T> tryUnit, Action <Exception> exAction) where T : class { return(new CatchUnit <T>(tryUnit, exAction)); }
public CatchUnit(TryUnit <T> tryUnit, Action <Exception> exAction) { this.Obj = tryUnit.Obj; this.Action = tryUnit.Action; this.ExAction = exAction; }