public Main() { this._annotationPackageProvider = new AmazonAnnotationPackageProvider(); this._annotationConfig = this._annotationPackageProvider.GetAnnotationConfigAsync().GetAwaiter().GetResult(); if (this._annotationConfig == null) { this._annotationConfig = new AnnotationConfig(); using (var configurationForm = new ConfigurationDialog()) { configurationForm.Setup(this._annotationConfig); configurationForm.ShowDialog(); } } this.InitializeComponent(); this.downloadControl.Dock = DockStyle.Fill; this.annotationPackageListControl.Setup(this._annotationPackageProvider); this.autoplaceAnnotationsToolStripMenuItem.Checked = true; this.annotationDrawControl.AutoplaceAnnotations = true; this.annotationDrawControl.SetObjectClasses(this._annotationConfig.ObjectClasses); this.annotationDrawControl.ShowLabels = true; this.showLabelsToolStripMenuItem.Checked = true; }
public Main() { this.StartPosition = FormStartPosition.CenterScreen; try { this._annotationPackageProvider = new AmazonAnnotationPackageProvider(); } catch (TaskCanceledException) { MessageBox.Show("The local database took too long to respond.\n\n" + "Make sure your config is correctly setup. Are MinIO and your local DynamoDB running?\n\n" + "Refer to the README.md for further information on how to correctly setup a local database.", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Load += (s, e) => this.Close(); return; } this._annotationConfig = this._annotationPackageProvider.GetAnnotationConfigAsync().GetAwaiter().GetResult(); if (this._annotationConfig == null) { this._annotationConfig = new AnnotationConfig(); using (var configurationDialog = new ConfigurationDialog()) { configurationDialog.Setup(this._annotationConfig); var dialogResult = configurationDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { this._annotationPackageProvider.SetAnnotationConfigAsync(this._annotationConfig); } else { this.Load += (s, e) => this.Close(); return; } } } this.InitializeComponent(); this.Text = $"Alturos Image Annotation {Application.ProductVersion}"; this.downloadControl.Dock = DockStyle.Fill; this.annotationPackageListControl.Setup(this._annotationPackageProvider); this.annotationImageListControl.Setup(this._annotationPackageProvider); this.autoplaceAnnotationsToolStripMenuItem.Checked = true; this.annotationDrawControl.AutoplaceAnnotations = true; this.annotationDrawControl.SetObjectClasses(this._annotationConfig.ObjectClasses); this.annotationDrawControl.SetLabelsVisible(false); this.tagEditControl.SetConfig(this._annotationConfig); }
private async void SettingsToolStripMenuItem_Click(object sender, EventArgs e) { using (var configurationForm = new ConfigurationDialog()) { configurationForm.Setup(this._annotationConfig); var dialogResult = configurationForm.ShowDialog(); if (dialogResult == DialogResult.OK) { await this._annotationPackageProvider.SetAnnotationConfigAsync(this._annotationConfig); } } }
private async void SettingsToolStripMenuItem_Click(object sender, EventArgs e) { using (var dialog = new ConfigurationDialog()) { dialog.StartPosition = FormStartPosition.CenterParent; dialog.Setup(this._annotationConfig); var dialogResult = dialog.ShowDialog(this); if (dialogResult == DialogResult.OK) { await this._annotationPackageProvider.SetAnnotationConfigAsync(this._annotationConfig); } } }