Example #1
0
 static void Main(string[] args)
 {
     if (args.Length == 0)
     {
         Application.Init();
         var app = new GraphicalApp();
         Application.Run();
     }
     else
     {
         ShellApp.Run(args);
     }
 }
        /// <summary>
        /// Stops all running applications on this HoloLens.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        public async Task TerminateAllApplicationsAsync()
        {
            RunningProcesses runningApps = await this.GetRunningProcessesAsync();

            foreach (DeviceProcessInfo processInfo in runningApps.Processes)
            {
                // Do not terminate the shell.
                if (ShellApp.ToLower() == processInfo.Name.ToLower())
                {
                    continue;
                }

                if (!string.IsNullOrWhiteSpace(processInfo.PackageFullName))
                {
                    await this.TerminateApplicationAsync(processInfo.PackageFullName);
                }
            }
        }