public static T InvokeWithCredential <T>([NotNull] this ServiceController thisValue, [NotNull] Func <ServiceController, T> action, [NotNull] NetworkCredential credential) { return(ImpersonationHelper.RunWithCredential(credential, LogonType.Interactive, () => action(thisValue))); }
public static void InvokeWithCredential([NotNull] this ServiceController thisValue, [NotNull] Action <ServiceController> action, [NotNull] NetworkCredential credential) { ImpersonationHelper.RunWithCredential(credential, LogonType.Interactive, () => action(thisValue)); }