Example #1
0
        /// <summary>
        /// Open a window for selecting an AMT database and settings.
        /// </summary>
        private void SelectAMT()
        {
            var dmsWindow        = new DatabaseSearchToolWindow();
            var optionsViewModel = new MassTagDatabaseOptionsViewModel(this.analysis.Options.MassTagDatabaseOptions);
            var databaseView     = new DatabasesViewModel {
                MassTagOptions = optionsViewModel
            };

            dmsWindow.DataContext           = databaseView;
            dmsWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            var loader    = MassTagDatabaseLoaderFactory.Create(MtdbDatabaseServerType.Dms);
            var databases = loader.LoadDatabases();

            DmsDatabaseServerViewModel selectedDatabaseServer = null;

            foreach (var database in databases)
            {
                databaseView.AddDatabase(database);
            }

            var result = dmsWindow.ShowDialog();

            if (result == true)
            {
                if (databaseView.SelectedDatabase != null)
                {
                    selectedDatabaseServer = databaseView.SelectedDatabase;
                    this.SelectedDatabase  = selectedDatabaseServer.Database;
                    this.SelectedDatabase.DatabaseFormat = MassTagDatabaseFormat.MassTagSystemSql;
                }
            }
        }
Example #2
0
        /// <summary>
        ///     Adds a database to the collection
        /// </summary>
        /// <param name="server"></param>
        public void AddDatabase(InputDatabase server)
        {
            var viewModel = new DmsDatabaseServerViewModel(server);

            Databases.Add(viewModel);
            FilteredDatabases.Add(viewModel);
            BuildOrganismsList(Databases);
        }