internal static void RunWithPreservedCulture <T>(CulturePair preservedCulture, Action <T> action, T arg) { RunWithPreservedCulture(preservedCulture, (f, state) => { f(state); return((object)null); }, action, arg); }
internal static TResult RunWithPreservedCulture <T1, T2, TResult>(CulturePair preservedCulture, Func <T1, T2, TResult> func, T1 arg1, T2 arg2) { var replacedCulture = SaveCulture(); try { Thread.CurrentThread.CurrentCulture = preservedCulture.Culture; Thread.CurrentThread.CurrentUICulture = preservedCulture.UICulture; return(func(arg1, arg2)); } finally { Thread.CurrentThread.CurrentCulture = replacedCulture.Culture; Thread.CurrentThread.CurrentUICulture = replacedCulture.UICulture; } }
internal static void RunWithPreservedCulture(CulturePair preservedCulture, Action action) { RunWithPreservedCulture(preservedCulture, f => f(), action); }
internal static TResult RunWithPreservedCulture <T, TResult>(CulturePair preservedCulture, Func <T, TResult> func, T arg) { return(RunWithPreservedCulture(preservedCulture, (f, state) => f(state), func, arg)); }