private void ExecuteInstallOperation(ParameterHelper parameters) { // Parse app and dependency filenames from the parameters string appxFile = parameters.GetParameterValue(ParameterAppx); string certificate = parameters.GetParameterValue(ParameterCert); _portal.AppInstallStatus += OnAppInstallStatus; _lastInstallStatus = null; try { if (!String.IsNullOrWhiteSpace(appxFile)) { ExecuteInstallAppx(parameters, appxFile, certificate); } else { throw new System.ArgumentNullException("Must specify an appx file to install"); } } finally { _portal.AppInstallStatus -= OnAppInstallStatus; _lastInstallStatus = null; } }
private void OnAppInstallStatus(object sender, ApplicationInstallStatusEventArgs args) { if (_verbose) { Console.Out.WriteLine(args.Message); } _lastInstallStatus = args; }
/// <summary> /// Handles the ApplicationInstallStatus event. /// </summary> /// <param name="sender">The object which sent this event.</param> /// <param name="args">Event arguments.</param> private void HoloLensMonitor_AppInstallStatus( HoloLensMonitor sender, ApplicationInstallStatusEventArgs args) { if (args.Status == ApplicationInstallStatus.Completed) { // Assigning the return value of RefreshInstalledAppsAsync to a Task object to avoid // warning 4014 (call is not awaited). Task t = this.RefreshInstalledAppsAsync(); } }
/// <summary> /// Handler for the ApplicationInstallStatus event. /// </summary> /// <param name="sender">The object sending the event.</param> /// <param name="args">The event data.</param> private void AppInstallStatusHandler( object sender, ApplicationInstallStatusEventArgs args) { if (this.verbose) { Console.WriteLine(args.Message); } if (args.Status != ApplicationInstallStatus.InProgress) { this.installResults = args; this.mreAppInstall.Set(); } }
private void NotifyAppInstallStatus( ApplicationInstallStatusEventArgs args) { if (!this.dispatcher.HasThreadAccess) { // Assigning the return value of RunAsync to a Task object to avoid // warning 4014 (call is not awaited). Task t = this.dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { this.NotifyAppInstallStatus(args); }).AsTask(); return; } this.AppInstallStatus?.Invoke( this, args); }
/// <summary> /// Handles the ApplicationInstallStatus event. /// </summary> /// <param name="sender">The object which sent this event.</param> /// <param name="args">Event arguments.</param> private void HoloLensMonitor_AppInstallStatus( HoloLensMonitor sender, ApplicationInstallStatusEventArgs args) { this.StatusMessage = args.Message; }
private void DevicePortal_AppInstallStatus( DevicePortal sender, ApplicationInstallStatusEventArgs args) { NotifyAppInstallStatus(args); }
/// <summary> /// Handles the ApplicationInstallStatus event. /// </summary> /// <param name="sender">The object which sent this event.</param> /// <param name="args">Event arguments.</param> private void DeviceMonitor_AppInstallStatus( DeviceMonitor sender, ApplicationInstallStatusEventArgs args) { this.StatusMessage = args.Message; }