Esempio n. 1
0
        private IUsage AskUserForCorrectUsage(string term, List <IUsage> usages)
        {
            IUsage usageFromHistory;

            if (_history.TryGetValue(term, out usageFromHistory))
            {
                return(usageFromHistory);
            }

            var usageSelectionDialog = new SelectUsageDialog(term, usages);
            var dialogResult         = usageSelectionDialog.ShowDialog(this);

            if (dialogResult == DialogResult.Cancel)
            {
                _history[term] = null;
                return(null);
            }
            _history[term] = usageSelectionDialog.SelectedUsage;

            return(usageSelectionDialog.SelectedUsage);
        }
Esempio n. 2
0
        private IUsage AskUserForCorrectUsage(string term, List<IUsage> usages)
        {
            IUsage usageFromHistory;
            if ( _history.TryGetValue( term, out usageFromHistory ) )
            {
                return usageFromHistory;
            }

            var usageSelectionDialog = new SelectUsageDialog( term, usages );
            var dialogResult = usageSelectionDialog.ShowDialog( this );
            if ( dialogResult == DialogResult.Cancel )
            {
                _history[term] = null;
                return null;
            }
            _history[term] = usageSelectionDialog.SelectedUsage;

            return usageSelectionDialog.SelectedUsage;
        }