Esempio n. 1
0
        private void Mainform_Shown(object sender, EventArgs e)
        {
            if (!PersistentState.Setup)
            {
                SetupForm    setupForm = new SetupForm();
                DialogResult result    = setupForm.ShowDialog();

                if (result != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }

                PersistentState.Initialize(setupForm.Id, setupForm.Key, setupForm.BulkData);
            }

            _loader = new DynamoDbLoader();
            _loader.StatusChanged += OtherThreadNotificationHandler;

            _downloader = new DownloaderWorker();
            _downloader.StatusChanged += OtherThreadNotificationHandler;

            _mainThreadDelegate = MainThreadAction;

            //lstCrashes.View = View.Details;


            foreach (CrashReport crashReport in PersistentState.Database.GetAllCrashes())
            {
                _crashReports.Add(crashReport);
            }

            _bldCrashReports = new BindingListDisplay <CrashReport>(_crashReports, c => new CrashReportView(c, _downloader))
            {
                Anchor   = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left,
                Location = new Point(12, 69),
                Size     = new Size(863, 277),
            };

            _bldCrashReports.Sort(new CrashReportTimeStampFilter());

            tabReports.Controls.Add(_bldCrashReports);

            string automation = PersistentState.Database.GetKey("autodownload_automation");

            if (automation != null)
            {
                cboAutomation.SelectedIndex = int.Parse(automation);
            }

            UpdateDBDependantControls();
        }