/// <summary>
        /// Implementation of the install application command.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task InstallAppAsync()
        {
            // Prompt the user for the required file.
            AppInstallFiles installFiles = new AppInstallFiles();
            ContentDialog   dialog       = new GetAppInstallFilesDialog(installFiles);
            await dialog.ShowAsync();

            if (installFiles.AppPackageFile == null)
            {
                return;
            }

            foreach (DeviceMonitorControl monitor in this.GetCopyOfRegisteredDevices())
            {
                DeviceMonitorControlViewModel viewModel = monitor.ViewModel;
                if (!viewModel.IsSelected)
                {
                    continue;
                }

                // Assigning the return value of InstallAppAsync to a Task object to avoid
                // warning 4014 (call is not awaited).
                Task t = monitor.InstallAppAsync(installFiles);
            }
        }
Example #2
0
        /// <summary>
        /// Implementation of the install application command.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task InstallAppAsync()
        {
            // Prompt the user for the required file.
            AppInstallFiles installFiles = new AppInstallFiles();
            ContentDialog   dialog       = new GetAppInstallFilesDialog(installFiles);
            await dialog.ShowAsync();

            if (string.IsNullOrWhiteSpace(installFiles.AppPackageFileName))
            {
                return;
            }

            // Validate the file exists.
            if (!(await Utilities.FileExists(installFiles.AppPackageFileName)))
            {
                this.StatusMessage = string.Format(
                    "Could not find {0}",
                    installFiles.AppPackageFileName);
                return;
            }

            foreach (HoloLensMonitorControl monitor in this.GetCopyOfRegisteredDevices())
            {
                // Assigning the return value of InstallAppAsync to a Task object to avoid
                // warning 4014 (call is not awaited).
                Task t = monitor.InstallAppAsync(installFiles);
            }
        }
        /// <summary>
        /// Implementation of the install application command.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task InstallAppAsync()
        {
            // Prompt the user for the required file.
            AppInstallFiles installFiles = new AppInstallFiles();
            ContentDialog   dialog       = new GetAppInstallFilesDialog(installFiles);
            await dialog.ShowAsync();

            if (string.IsNullOrWhiteSpace(installFiles.AppPackageFileName))
            {
                return;
            }

            // Validate the file exists.
            if (!(await Utilities.FileExists(installFiles.AppPackageFileName)))
            {
                this.StatusMessage = string.Format(
                    "Could not find {0}",
                    installFiles.AppPackageFileName);
                return;
            }

            foreach (HoloLensMonitorControl monitor in this.GetCopyOfRegisteredDevices())
            {
                await monitor.InstallAppAsync(installFiles.AppPackageFileName);
            }

            await this.RefreshCommonAppsAsync();
        }