protected override void Dispose(bool disposing) { try { if (disposing) { handler.Dispose(); QueryBlocks.Clear(); } } finally { base.Dispose(disposing); } }
private QueryBlockViewModel SetRootOptions(SearchOptions options = null) { Contract.Requires(AuthorityController.CurrentDoctor != null); Contract.Ensures(options == null || options.PartialLoaded == Contract.Result <QueryBlockViewModel>().Options.PartialLoaded); QueryBlocks.Clear(); var qb = new QueryBlockViewModel(session, onQbEnter, options); qb.PropertyChanged += (s, e) => { if (e.PropertyName == "AllEmpty") { OnPropertyChanged(() => AllEmpty); } }; QueryBlocks.Add(qb); return(qb); }