public TabModel ToTabModel() { FilterQuery filter; try { filter = QueryCompiler.Compile(Query); } catch (FilterQueryException ex) { BackstageModel.RegisterEvent(new QueryCorruptionEvent(Name, ex)); filter = null; } var model = new TabModel { Name = Name, FilterQuery = filter, RawQueryString = Query, BindingHashtags = BindingHashtags.Guard(), NotifyNewArrivals = NotifyNewArrivals, NotifySoundSource = NotifySoundSource, ShowUnreadCounts = ShowUnreadCounts }; BindingAccountIds.ForEach(model.BindingAccounts.Add); return(model); }
public void ClearInput(string text, bool sendDraftIfChanged) { var current = _inputData; _inputData = new InputData(text); if (current.IsChanged && sendDraftIfChanged) { // if text is not changed, send to draft _drafts.Add(current); } _inputData.BoundTags = BindingHashtags.ToArray(); RaisePropertyChanged(() => CurrentInputData); }