Exemplo n.º 1
0
        /// <summary>
        /// Background Worker Event Worker_RunWorkerCompleted
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="RunWorkerCompletedEventArgs"/> instance containing the event data.</param>
        private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Diagnostics.ErrorReport errorReport = new Diagnostics.ErrorReport(e.Error, "An error occurred while downloading or extracting the solution");
                errorReport.Show();
            }

            this.loadingPanel.IsLoading = false;
            this.Btn_close.IsEnabled    = true;
            DownloadMultiple.LogToUI("---------------");
            DownloadMultiple.LogToUI("Finished download/extraction");
            DownloadMultiple.LogToUI("---------------");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DownloadMultiple"/> class.
        /// </summary>
        /// <param name="crmConnection"><see cref="Xrm.CrmConnection"/> for the XRM Connector</param>
        /// <param name="crmSolutions"><see cref="List{Xrm.CrmSolution}"/> of all Solutions to Download</param>
        public DownloadMultiple(Core.Xrm.CrmConnection crmConnection, List <Core.Xrm.CrmSolution> crmSolutions)
        {
            this.InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");
            DownloadMultiple.statusTextBox        = this.tbx_status;
            DownloadMultiple.LogToUI("Started Form");
            this.Btn_close.IsEnabled = false;
            this.CRMConnection       = crmConnection;
            DownloadMultiple.LogToUI($"CRM Connection: {this.CRMConnection.Name}", true);
            this.CRMSolutions = crmSolutions;

            foreach (Core.Xrm.CrmSolution crmSolution in this.CRMSolutions)
            {
                DownloadMultiple.LogToUI($"Added Solution: { crmSolution.UniqueName} to Download List", true);
            }

            this.tbx_download.Text = crmConnection.LocalPath;
            DownloadMultiple.LogToUI($"Pulled Path form config: {crmConnection.LocalPath}", true);

            this.Owner = App.Current.MainWindow;
        }