Beispiel #1
0
        private void btnCheck_Click(object sender, EventArgs e)
        {
            if (btnSave.Enabled)
            {
                btnSave_Click(null, null);
            }

            ITicketingSystem instance;

            try
            {
                TicketingSystemFactory factory = new TicketingSystemFactory(_activator.RepositoryLocator.CatalogueRepository);
                instance = factory.CreateIfExists(_ticketingSystemConfiguration);

                checksUI1.OnCheckPerformed(
                    new CheckEventArgs("successfully created a instance of " + instance.GetType().FullName,
                                       CheckResult.Success));
            }
            catch (Exception exception)
            {
                checksUI1.OnCheckPerformed(
                    new CheckEventArgs("Could not create ticketing system from your current configuration",
                                       CheckResult.Fail, exception));
                return;
            }
            checksUI1.StartChecking(instance);
        }
Beispiel #2
0
        public void ReCheckTicketingSystemInCatalogue()
        {
            ragSmiley1.SetVisible(false);

            try
            {
                if (VisualStudioDesignMode)
                {
                    return;
                }

                if (Activator == null)
                {
                    throw new Exception("Activator has not been set, call SetItemActivator");
                }

                TicketingSystemFactory factory = new TicketingSystemFactory(Activator.RepositoryLocator.CatalogueRepository);

                var configuration = Activator.RepositoryLocator.CatalogueRepository.GetTicketingSystem();
                _ticketingSystemConfiguration = factory.CreateIfExists(configuration);

                gbTicketing.Enabled = _ticketingSystemConfiguration != null;
            }
            catch (Exception exception)
            {
                ragSmiley1.SetVisible(true);
                ragSmiley1.Fatal(exception);
            }
        }
Beispiel #3
0
        private void MakeAssessment()
        {
            Assesment = TicketingReleaseabilityEvaluation.TicketingLibraryMissingOrNotConfiguredCorrectly;

            var configuration = _repository.CatalogueRepository.GetAllObjectsWhere <TicketingSystemConfiguration>("IsActive", 1).SingleOrDefault();

            if (configuration == null)
            {
                return;
            }

            TicketingSystemFactory factory = new TicketingSystemFactory(_repository.CatalogueRepository);


            ITicketingSystem ticketingSystem;

            try
            {
                ticketingSystem = factory.CreateIfExists(configuration);
            }
            catch (Exception e)
            {
                Assesment = TicketingReleaseabilityEvaluation.TicketingLibraryCrashed;
                Exception = e;
                return;
            }

            if (ticketingSystem == null)
            {
                return;
            }

            try
            {
                Exception e;
                string    reason;
                Assesment = ticketingSystem.GetDataReleaseabilityOfTicket(Project.MasterTicket,
                                                                          Configuration.RequestTicket, Configuration.ReleaseTicket, out reason, out e);
                Exception = e;
                Reason    = reason;
            }
            catch (Exception e)
            {
                if (e is ThreadInterruptedException)
                {
                    throw;
                }

                Assesment = TicketingReleaseabilityEvaluation.TicketingLibraryCrashed;
                Exception = e;
            }
        }