public void SetSuggestions(ISuggestions suggestions) { var theSugs = suggestions as SpellCheckerSuggestion; if (theSugs == null) { throw new ArgumentException("The specified suggestions object must be of type \"TitledListBoxSuggestion\".", "suggestions"); } lblTitle.Text = theSugs.Message; lbSuggestions.Items.Clear(); lbSuggestions.Items.AddRange(RefineSuggestionsText(theSugs.SuggestionItems.ToArray())); if (lbSuggestions.Items.Count > 0) { m_disableChange = false; lbSuggestions.SelectedIndex = 0; this.ParentVerificationWindow.EnableAction(UserSelectedActions.Change); this.ParentVerificationWindow.EnableAction(UserSelectedActions.ChangeAll); } else { m_disableChange = true; this.ParentVerificationWindow.DisableAction(UserSelectedActions.Change); this.ParentVerificationWindow.DisableAction(UserSelectedActions.ChangeAll); txtCustomSuggestions.Text = ""; } }
public DashboardController(IRepository <Account> accountRepo, IRepository <Transaction> transactionRepo, IRepository <Category> categoryRepo, ITransactionsService transactionsService, ISuggestions suggestions) { _accountRepo = accountRepo; _transactionRepo = transactionRepo; _categoryRepo = categoryRepo; _transactionsService = transactionsService; _suggestions = suggestions; }
public void SetSuggestions(ISuggestions suggestions) { if (!(suggestions is TitledListBoxSuggestion)) { throw new ArgumentException("The specified suggestions object must be of type \"TitledListBoxSuggestion\".", "suggestions"); } var theSugs = suggestions as TitledListBoxSuggestion; lblTitle.Text = theSugs.Message; lbSuggestions.Items.Clear(); lbSuggestions.Items.AddRange(RefineSuggestionsText(theSugs.SuggestionItems.ToArray())); }
public void SetSuggestions(ISuggestions suggestions) { var dateSugs = suggestions as DateSuggestion; if (dateSugs == null) { throw new ArgumentException("The specified suggestions object must be of type \"DateSuggestion\".", "suggestions"); } lstSuggestions.Items.Clear(); lstSuggestions.Items.AddRange(CreateSuggestions(dateSugs.MainPattern)); if (lstSuggestions.Items.Count > 0) { this.ParentVerificationWindow.EnableAction(UserSelectedActions.Change); lstSuggestions.Items[0].Selected = true; } else { this.ParentVerificationWindow.DisableAction(UserSelectedActions.Change); } }
protected void SetSuggestions(ISuggestions suggestions) { SuggestionViewerControl.SetSuggestions(suggestions); }