Exemple #1
0
        /// <summary>
        /// Loads the CRM Solution for the selected Repo into the grid
        /// </summary>
        private void LoadSolutions()
        {
            this.Btn_Reload.IsEnabled = false;
            try
            {
                if (Lbx_Repos.SelectedItem != null)
                {
                    Lbx_Repos.IsEnabled        = false;
                    this.selectedCrmConnection = null;
                    Core.Xrm.CrmConnection crmConnection = (Core.Xrm.CrmConnection)Lbx_Repos.SelectedItem;

                    Core.Repository.Connector repositoryConnector = new Core.Repository.Connector();
                    this.localSolutions = null;
                    this.localSolutions = repositoryConnector.GetLocalCRMSolutions(((Core.Xrm.CrmConnection)Lbx_Repos.SelectedItem).LocalPath);

                    this.Dtg_Solutions.ItemsSource = null;
                    MainWindow.SetProgress(true);

                    this.worker.DoWork             += this.Worker_DoWork;
                    this.worker.RunWorkerCompleted += this.Worker_RunWorkerCompleted;
                    this.worker.RunWorkerAsync();

                    this.selectedCrmConnection = crmConnection.Name;
                    this.Btn_Reload.IsEnabled  = true;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message, ex);
                if (!Properties.Settings.Default.DisableErrorReports)
                {
                    Diagnostics.ErrorReport errorReport = new Diagnostics.ErrorReport(ex);
                    errorReport.Show();
                }

                MainWindow.SetProgress(false);
                SolutionSelector.Log.Error(ex.Message, ex);
                Lbx_Repos.IsEnabled  = true;
                Btn_Reload.IsEnabled = true;
            }
        }
Exemple #2
0
        /// <summary>
        /// Loads the Local Solution Version into the Grid
        /// </summary>
        private void LoadVersionIntoGrid()
        {
            try
            {
                this.Dtg_Solutions.ItemsSource = null;
                Core.Repository.Connector   connector          = new Core.Repository.Connector();
                List <Core.Xrm.CrmSolution> localRepoSolutions = connector.GetLocalCRMSolutions(((Core.Xrm.CrmConnection)Lbx_Repos.SelectedItem).LocalPath);

                foreach (Core.Xrm.CrmSolution solution in localRepoSolutions)
                {
                    if (this.crmSolutions.Exists(x => x.UniqueName == solution.UniqueName))
                    {
                        this.crmSolutions.Find(x => x.UniqueName == solution.UniqueName).LocalVersion = solution.LocalVersion;
                    }
                }

                this.Dtg_Solutions.ItemsSource = this.crmSolutions;
            }
            catch (Exception)
            {
                // Ignore if the solution does not exists in CRM
            }
        }