예제 #1
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();
        }
        /// <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);
            }
        }
예제 #4
0
 /// <summary>
 /// Installs an application on this device.
 /// </summary>
 /// <param name="installFiles">Object describing the file(s) required to install an application.</param>
 /// <returns>Task object used for tracking method completion.</returns>
 public async Task InstallApplicationAsync(AppInstallFiles installFiles)
 {
     await Task.Run(
         async() =>
     {
         await this.devicePortal.InstallApplicationAsync(
             null,
             installFiles.AppPackageFile,
             installFiles.AppDependencyFiles,
             installFiles.AppCertificateFile);
     });
 }
 public GetAppInstallFilesBlobDialog(AppInstallFiles installFiles)
 {
     this.appInstallFiles = installFiles;
     this.DataContext     = new GetAppInstallFilesDialogViewModel();
     ViewModel.DownloadFolderAccessToken
     .Where(x => !string.IsNullOrWhiteSpace(x))
     .Subscribe(async x =>
     {
         var viewModel = DataContext as GetAppInstallFilesDialogViewModel;
         await viewModel.AutoAddInstallFiles(x);
     });
     this.InitializeComponent();
 }
예제 #6
0
        /// <summary>
        /// Installs an application on this device.
        /// </summary>
        /// <param name="installFiles">Object describing the file(s) required to install an application.</param>
        /// <returns>Task object used for tracking method completion.</returns>
        public async Task InstallApplicationAsync(AppInstallFiles installFiles)
        {
            await Task.Run(
                async() =>
            {
                string appName = await this.FindAppNameFromPackageName(installFiles.AppPackageFile.Name);

                await this.devicePortal.InstallApplicationAsync(
                    appName,
                    installFiles.AppPackageFile,
                    installFiles.AppDependencyFiles,
                    installFiles.AppCertificateFile);
            });
        }
예제 #7
0
        /// <summary>
        /// Installs an application on this device.
        /// </summary>
        /// <param name="installFiles">Object describing the file(s) required to install an application.</param>
        /// <returns>Task object used for tracking method completion.</returns>
        internal async Task InstallAppAsync(AppInstallFiles installFiles)
        {
            if (this.IsConnected && this.IsSelected)
            {
                try
                {
                    await this.deviceMonitor.InstallApplicationAsync(installFiles);

                    this.deviceMonitorControl.NotifyAppInstall();
                }
                catch (Exception e)
                {
                    this.StatusMessage = string.Format(
                        "Failed to install {0} - {1}",
                        installFiles.AppPackageFile.Name,
                        e.Message);
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetAppInstallFilesDialog" /> class.
 /// </summary>
 /// <param name="installFiles">The object in which the user's selected file(s) will be returned to the caller.</param>
 public GetAppInstallFilesDialog(AppInstallFiles installFiles)
 {
     this.appInstallFiles = installFiles;
     this.DataContext     = new GetAppInstallFilesDialogViewModel();
     this.InitializeComponent();
 }
예제 #9
0
 /// <summary>
 /// Update's the user selected install files data.
 /// </summary>
 /// <param name="installFiles">The application install files.</param>
 internal void UpdateUserData(AppInstallFiles installFiles)
 {
     installFiles.AppPackageFileName = AppPackageFile;
 }
예제 #10
0
 /// <summary>
 /// Installs an application on this device.
 /// </summary>
 /// <param name="installFiles">Object describing the file(s) required to install an application.</param>
 /// <returns>Task object used for tracking method completion.</returns>
 internal async Task InstallAppAsync(AppInstallFiles installFiles)
 {
     await this.ViewModel.InstallAppAsync(installFiles);
 }
 /// <summary>
 /// Update's the user selected install files data.
 /// </summary>
 /// <param name="installFiles">The application install files.</param>
 internal void UpdateUserData(AppInstallFiles installFiles)
 {
     installFiles.AppPackageFile = AppPackageFile;
     installFiles.AppDependencyFiles.AddRange(DependencyFiles.Values);
     installFiles.AppCertificateFile = AppCertificateFile;
 }
 /// <summary>
 /// Installs an application on this HoloLens.
 /// </summary>
 /// <param name="installFiles">Object describing the file(s) required to install an application.</param>
 /// <returns>Task object used for tracking method completion.</returns>
 internal async Task InstallAppAsync(AppInstallFiles installFiles)
 {
     await this.ViewModel.InstallAppAsync(installFiles.AppPackageFileName);
 }