Ejemplo n.º 1
0
        /// <summary>
        /// Starts a new elevated <see cref="Process"/> from the details of the <paramref name="startInfo"/>.
        /// </summary>
        /// <param name="startInfo">The <see cref="ProcessStartInfo"/> instance to start.</param>
        /// <returns>The <see cref="Process"/> instance that was started.</returns>
        /// <exception cref="ArgumentNullException">thrown if <paramref name="startInfo"/> is <c>Null</c>.</exception>
        public static Process StartElevated(this ProcessStartInfo startInfo)
        {
            if (startInfo.IsNull())
            {
                throw new ArgumentNullException(nameof(startInfo));
            }

            startInfo.ConfigureElevatedState();

            return(Process.Start(startInfo));
        }