Example #1
0
        private string LoadFromLibraryPicker(ILibraryFetch fetcher)
        {
            var source = string.Empty;

            var l = new frmLibraryPicker(fetcher);

            l.ShowDialog();

            // TODO: implement some mechanism for re-populating the selections on a load
            if (l.TextsSelected)
            {
                _previouslySelected = l.SelectedTexts;

                // for some reason, this is not working
                // even though it works on the frmLibraryPicker
                this.UseWaitCursor = true;
                Application.DoEvents();

                source = l.Source;

                this.UseWaitCursor = false;
            }

            return(source);
        }
Example #2
0
        public frmLibraryPicker(ILibraryFetch library)
            : this()
        {
            var origCursor = this.Cursor;

            Cursor.Current = Cursors.WaitCursor;
            Application.DoEvents();

            _library = library.GetLibrary();

            var items = _library.Keys.SelectMany(textKey => _library[textKey]).ToList();

            LibrarySelector.AvailableItems = items.Cast <object>().ToList();

            this.Cursor = origCursor;
        }