Ejemplo n.º 1
0
        public static void RegisterApplicationRestart(string command, RestartCondition condition)
        {
            if (!IsPlatformSupported)
            {
                throw new PlatformNotSupportedException("Requires Windows Vista or later");
            }

            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            int hr = NativeMethods.RegisterApplicationRestart(command, condition);

            if (hr != 0)
            {
                Marshal.ThrowExceptionForHR(hr);
            }
        }
Ejemplo n.º 2
0
 public ProgramRestartPolicy(RestartCondition condition, TimeSpan?delay)
 {
     Condition = condition;
     Delay     = delay;
 }
Ejemplo n.º 3
0
 internal static extern int RegisterApplicationRestart([MarshalAs(UnmanagedType.BStr)] string commandLine, RestartCondition flags);