public QueryResultsDocumentSelectionObserver(IResultsDocument queryResultsDocument, QueryResultsTotalizerModel queryResultsModel)
        {
            this.queryResultsDocument = queryResultsDocument;
            this.queryResultsModel = queryResultsModel;

            queryResultsDocument.Loaded += (sender, e) => queryResultsModel.RefreshWorkItems(queryResultsDocument);
            queryResultsDocument.Reloaded += (sender, e) => queryResultsModel.RefreshWorkItems(queryResultsDocument);
            queryResultsDocument.Saved += (s, e) => queryResultsModel.RefreshWorkItems(queryResultsDocument);

            queryResultsDocument.SelectionChanged += SelectionChanged;
        }
示例#2
0
        public QueryResultsDocumentSelectionObserver(IResultsDocument queryResultsDocument, QueryResultsTotalizerModel queryResultsModel)
        {
            this.queryResultsDocument = queryResultsDocument;
            this.queryResultsModel    = queryResultsModel;

            queryResultsDocument.Loaded   += (sender, e) => queryResultsModel.RefreshWorkItems(queryResultsDocument);
            queryResultsDocument.Reloaded += (sender, e) => queryResultsModel.RefreshWorkItems(queryResultsDocument);
            queryResultsDocument.Saved    += (s, e) => queryResultsModel.RefreshWorkItems(queryResultsDocument);

            queryResultsDocument.SelectionChanged += SelectionChanged;
        }
        public QueryResultsTotalizerController(DocumentService docService, StatusBar statusBar, IVisualStudioAdapter teamExplorer)
        {
            var documentCreationTracker = new QueryResultsDocumentCreationObserver(docService);

            documentCreationTracker.DocumentCreated += (sender, e) =>
            {
                var queryResultsModel = new QueryResultsTotalizerModel(teamExplorer);

                new QueryResultsDocumentSelectionObserver(e.QueryResultsDocument, queryResultsModel);

                new QueryResultsTotalizerView(queryResultsModel, statusBar);
            };
        }
 public QueryResultsTotalizerView(QueryResultsTotalizerModel queryResultsModel, StatusBar statusBar)
 {
     this.statusBar = statusBar;
     queryResultsModel.QuerySelectionTotalsChanged += QuerySelectionTotalsChanged;
 }