Пример #1
0
        protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
        {
            try
            {
                var project = await VS.Solutions.GetActiveProjectAsync();

                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                if (project != null)
                {
                    try
                    {
                        ProjectDescription  pd  = new ProjectDescription(project);
                        ConfigurationDialog dlg = new ConfigurationDialog(project.DteProject(), pd);
                        dlg.ShowDialog();
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(ex.ToString());
                        MessageBox.Show(ex.Message, "NDO Configuration");
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
                MessageBox.Show(ex.Message, "Configure");
            }
        }
Пример #2
0
        protected virtual void DisplayConfigurationDialog()
        {
            try
            {
                var dialog = new ConfigurationDialog(this.Log)
                {
                    Configuration = _configuration,
                    AllDrivers    = _feedData != null?
                                    _feedData.vehicles.Select(v => new FavoriteDriver()
                    {
                        SeriesId = _feedData.series_id, Driver = v.driver.full_name
                    }).ToList() :
                                        new List <FavoriteDriver>(),
                                        Favorites = _userSettings.FavoriteDrivers.ToList()
                };

                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    Configuration = dialog.Configuration;

                    SetLogLevel(Configuration.UseVerboseLogging);

                    _userSettings.FavoriteDrivers = dialog.Favorites.ToList();

                    SaveUserSettings();
                }

                UpdateTheme();
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error loading Settings", ex);
            }
        }
Пример #3
0
        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;
        }
Пример #4
0
        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                var dialog = new ConfigurationDialog()
                {
                    Configuration = _configuration,
                    AllDrivers    = _feedData != null?
                                    _feedData.vehicles.Select(v => new FavoriteDriver()
                    {
                        SeriesId = _feedData.series_id, Driver = v.driver.full_name
                    }).ToList() :
                                        new List <FavoriteDriver>(),
                                        Favorites = _userSettings.FavoriteDrivers.ToList()
                };

                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    Configuration = dialog.Configuration;
                    _userSettings.FavoriteDrivers = dialog.Favorites.ToList();
                    SaveUserSettings();
                }

                UpdateTheme();
            }
            catch (Exception ex)
            {
                ExceptionHandler(ex);
            }
        }
Пример #5
0
        void Configure_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new ConfigurationDialog {
                Owner = this
            };

            dialog.ShowDialog();
        }
Пример #6
0
        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);
        }
Пример #7
0
        public MainWindow()
        {
            InitializeComponent();

            if (!Settings.Default.FirstRunLicensingConfigurationFinished)
            {
                var dialog = new ConfigurationDialog();
                dialog.ShowDialog();
            }
        }
Пример #8
0
 public void Configure()
 {
     try
     {
         ConfigurationDialog.Show(this.Context.DesktopWindow, FolderExplorerConfigurationComponent.ConfigurationPagePath);
     }
     catch (Exception e)
     {
         ExceptionHandler.Report(e, this.Context.DesktopWindow);
     }
 }
Пример #9
0
 /// <summary>
 /// Called by the framework when the user clicks the "Options" menu item.
 /// </summary>
 public void Show()
 {
     try
     {
         ConfigurationDialog.Show(this.Context.DesktopWindow);
     }
     catch (Exception e)
     {
         ExceptionHandler.Report(e, this.Context.DesktopWindow);
     }
 }
Пример #10
0
 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);
         }
     }
 }
        public void NewWebReference()
        {
            // Get the project and project folder
            DotNetProject project = CurrentNode.GetParentDataItem(typeof(DotNetProject), true) as DotNetProject;

            // Check and switch the runtime environment for the current project
            if (project.TargetFramework.Id == TargetFrameworkMoniker.NET_1_1)
            {
                string question = "The current runtime environment for your project is set to version 1.0.";
                question += "Web Service is not supported in this version.";
                question += "Do you want switch the runtime environment for this project version 2.0 ?";

                AlertButton switchButton = new AlertButton("_Switch to .NET2");
                if (MessageService.AskQuestion(question, AlertButton.Cancel, switchButton) == switchButton)
                {
                    project.TargetFramework = Runtime.SystemAssemblyService.GetTargetFramework(TargetFrameworkMoniker.NET_2_0);
                }
                else
                {
                    return;
                }
            }

            WebReferenceDialog dialog = new WebReferenceDialog(project);

            dialog.NamespacePrefix = project.DefaultNamespace;

            try {
                if (MessageService.RunCustomDialog(dialog) != (int)Gtk.ResponseType.Ok)
                {
                    return;
                }

                var wcfResult = dialog.SelectedService as WCF.WebServiceDiscoveryResultWCF;
                if (ConfigurationDialog.IsSupported() && (wcfResult != null))
                {
                    var options = CreateClientOptions();
                    if (options == null)
                    {
                        return;
                    }
                    wcfResult.InitialClientOptions = options;
                }

                dialog.SelectedService.GenerateFiles(project, dialog.Namespace, dialog.ReferenceName);
                IdeApp.ProjectOperations.Save(project);
            } catch (Exception exception) {
                MessageService.ShowException(exception);
            } finally {
                dialog.Destroy();
            }
        }
Пример #12
0
 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);
         }
     }
 }
        private void setPrintButton_Click(object sender, EventArgs e)
        {
            if (printComponent == null)
            {
                return;
            }
            ApplicationComponentExitCode exitCode = ConfigurationDialog.Show(printComponent.DesktopWindow, null);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                printComponent.InitDicomPrinterConfig();
                Loaded(this, null);
            }
        }
Пример #14
0
        private void Configure_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ConfigurationDialog dialog = new ConfigurationDialog
            {
                Owner = this
            };

            if (dialog.ShowDialog() == true)
            {
                // Al terminar el diálogo, cambiar la configuración y guardarla
                Properties.Settings.Default.ColorUsuario = dialog.ColorUsuario;
                Properties.Settings.Default.ColorFondo   = dialog.ColorFondo;
                Properties.Settings.Default.ColorBot     = dialog.ColorRobot;
                Properties.Settings.Default.Save();
            }
        }
        WCF.ClientOptions CreateClientOptions()
        {
            var options = new WCF.ClientOptions();
            var dialog  = new ConfigurationDialog(options);

            try {
                if (MessageService.RunCustomDialog(dialog) != (int)Gtk.ResponseType.Ok)
                {
                    return(null);
                }
                return(options);
            } catch (Exception exception) {
                MessageService.ShowException(exception);
                return(null);
            } finally {
                dialog.Destroy();
            }
        }
        public void Configure()
        {
            var item = (WebReferenceItem)CurrentNode.DataItem;

            if (!ConfigurationDialog.IsSupported(item))
            {
                return;
            }

            WCF.ReferenceGroup refgroup;
            WCF.ClientOptions  options;

            try {
                refgroup = WCF.ReferenceGroup.Read(item.MapFile.FilePath);
                if (refgroup == null || refgroup.ClientOptions == null)
                {
                    return;
                }
                options = refgroup.ClientOptions;
            } catch {
                return;
            }

            var dialog = new ConfigurationDialog(options);

            try {
                if (MessageService.RunCustomDialog(dialog) != (int)Gtk.ResponseType.Ok)
                {
                    return;
                }
                if (!dialog.Modified)
                {
                    return;
                }

                refgroup.Save(item.MapFile.FilePath);
                UpdateReferences(new [] { item });
            } catch (Exception exception) {
                MessageService.ShowException(exception);
            } finally {
                dialog.Destroy();
            }
        }
Пример #17
0
 private void InitDialogs()
 {
     _ConfigDialog      = new ConfigurationDialog(this._address);
     _ParticipantDialog = new ParticipantDialog();
 }
Пример #18
0
 private void showConfigurationDialog()
 {
     ConfigurationDialog cfgDialog = new ConfigurationDialog();
     if (cfgDialog.ShowDialog() == DialogResult.OK) {
         updateCandidateFiles(true);
     }
 }
        void CanConfigureWebReferences(CommandInfo ci)
        {
            var item = (WebReferenceItem)CurrentNode.DataItem;

            ci.Enabled = ConfigurationDialog.IsSupported(item);
        }
Пример #20
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            ConfigurationDialog.ShowCompareFilesConfigurationWindow(sender, e);
        }
Пример #21
0
        public static void Present(bool modal, IConfigurablePlugin plugin, string path)
        {
            ConfigurationDialog dialog = ConfigurationDialog.GetSingleton<ConfigurationDialog>(false);

            if (dialog == null)
            {
                dialog = new ConfigurationDialog();

                dialog.SetPath(path);
                dialog.Populate(plugin);
            }

            dialog.ShowSingleton(modal);
        }
Пример #22
0
 public static void Configure(IDesktopWindow desktopWindow)
 {
     ConfigurationDialog.Show(desktopWindow, ConfigurationPageProvider.BasicLayoutConfigurationPath);
 }
 public void Show()
 {
     ConfigurationDialog.Show(base.Context.DesktopWindow, ConfigurationPageProvider.DefaultPageId);
 }