/// <summary> /// Install Software in a hive /// </summary> /// <param name="hive"></param> public void CreateHiveAndInstallSoftware(PlaygroundHost host) { string sessionId = Session.Current?.SessionId; this.Heading = "Setting up your hive"; ApplicationOperationsPage parent = this.Parent as ApplicationOperationsPage; HiveManager.CreateHiveAndInstallSoftware(host, parent.DepotKey, parent.AppId, (installedInHive) => { // Success Utils.ScheduleTaskHelper(sessionId, (session, id) => { if (session != null) { this.OnSoftwareInstalled(installedInHive); session.CalculatePatchAndPushOnWebSocket(); } }); }, (text, progress) => { // Progress Utils.ScheduleTaskHelper(sessionId, (session, id) => { if (session != null) { this.SetProgress(text, progress); session.CalculatePatchAndPushOnWebSocket(); } }); }, (errorResponse) => { // Error Utils.ScheduleTaskHelper(sessionId, (session, id) => { parent.OnError(errorResponse); session.CalculatePatchAndPushOnWebSocket(); }); }); }
/// <summary> /// Create Hive and install software in host /// </summary> /// <param name="host"></param> private void CreateHiveAndInstallSoftware(PlaygroundHost host) { string sessionId = Session.Current?.SessionId; // Create hive and Install app Utils.ScheduleTaskHelper(sessionId, (session, id) => { if (session != null) { ProgressPage progressPage = new ProgressPage(); this.Partial = progressPage; progressPage.CreateHiveAndInstallSoftware(host); session.CalculatePatchAndPushOnWebSocket(); } }); }