OpenAndCreateCollectionDialog() public method

public OpenAndCreateCollectionDialog ( ) : OpenAndCreateCollectionDialog
return Bloom.CollectionChoosing.OpenAndCreateCollectionDialog
Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        static void ChooseAnotherProject(object sender, EventArgs e)
        {
            Application.Idle -= ChooseAnotherProject;

            while (true)
            {
                //If it looks like the 1st time, put up the create collection with the welcome.
                //The user can cancel that if they want to go looking for a collection on disk.
                if (Settings.Default.MruProjects.Latest == null)
                {
                    var path = NewCollectionWizard.CreateNewCollection();
                    if (!string.IsNullOrEmpty(path) && File.Exists(path))
                    {
                        OpenCollection(path);
                        return;
                    }
                }

                using (var dlg = _applicationContainer.OpenAndCreateCollectionDialog())
                {
                    if (dlg.ShowDialog() != DialogResult.OK)
                    {
                        Application.Exit();
                        return;
                    }

                    if (OpenCollection(dlg.SelectedPath))
                    {
                        return;
                    }
                }
            }
        }