NanoByte.Common.Native.WindowsRestartManager.RegisterResources C# (CSharp) Method

RegisterResources() private method

private RegisterResources ( ) : void
return void
        public void RegisterResources([NotNull, ItemNotNull] params string[] files)
        {
            #region Sanity checks
            if (files == null) throw new ArgumentNullException(nameof(files));
            #endregion

            int ret = NativeMethods.RmRegisterResources(_sessionHandle, (uint)files.Length, files, 0, new NativeMethods.RM_UNIQUE_PROCESS[0], 0, new string[0]);
            if (ret != 0) throw BuildException(ret);
        }
        #endregion

Usage Example

        public void TestListApps()
        {
            if (!WindowsUtils.IsWindowsVista) Assert.Ignore("Restart Manager only available on Windows Vista or higher");

            using (var restartManager = new WindowsRestartManager())
            {
                restartManager.RegisterResources(@"C:\Windows\explorer.exe");
                restartManager.ListApps(new SilentTaskHandler());
            }
        }
All Usage Examples Of NanoByte.Common.Native.WindowsRestartManager::RegisterResources