/// <summary> /// /// </summary> /// <param name="actions"></param> public void Work(params Action[] actions) { ArgumentAssertion.IsNotNull(actions, "actions"); lock (locker) { foreach (var action in actions) { action(); } } }
/// <summary> /// /// </summary> /// <param name="filePath"></param> /// <returns></returns> public static string GetFullPath(string filePath) { ArgumentAssertion.IsNotNull(filePath, "filePath"); if (filePath.IndexOf(@":\\") != -1) { return(filePath); } else { return(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filePath)); } }
public static bool Handle(this Action action, string policyName, IDictionary bizInfo) { ArgumentAssertion.IsNotNull(action, "action"); try { action(); return(false); } catch (Exception ex) { return(ex.HandleException(policyName, bizInfo)); } }
public static bool HandleException(this Exception source, string policyName, IDictionary bizInfo, out Exception exceptionToThrow) { ArgumentAssertion.IsNotNull(source, "source"); try { bool retrowAdviced = source.HandleException(policyName, bizInfo); exceptionToThrow = null; return(retrowAdviced); } catch (Exception exception) { exceptionToThrow = exception; return(true); } }