コード例 #1
0
        public MainWindow(SettingsViewModel settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");
            
            this.settings = settings;

            this.tfsConnector = new TfsConnector(this.settings.TfsConnection);

            var cache = new MongoDbCache<ChangeInfo>(
                this.settings.MongoConnection,
                MongoDbCache.DatabaseName,
                "changeStats");

            this.analystics = new TfsAnalytics(this.tfsConnector, cache);

            this.imageService = new DirectoryUserImageService(this.settings.DomainController, this.settings.DirectoryImageProperty);

            this.DataContext = this;

            this.Projects = new ObservableCollection<TeamProject>(this.tfsConnector.GeTeamProjects());

            this.Changesets = new ObservableCollection<ChangesetViewModel>();
            this.Changes = new ObservableCollection<ChangeViewModel>();
            
            this.InitializeComponent();

            Observable.FromEvent<EventHandler, EventArgs>(
                handler => (sender, e) => handler(e),
                h => this.RedrawCharts += h,
                h => this.RedrawCharts -= h)
                .Throttle(TimeSpan.FromSeconds(3)).ObserveOn(Scheduler.CurrentThread).Subscribe(l =>
                {
                    this.Dispatcher.Invoke(this.DrawCharts);
                });
        }
コード例 #2
0
 public TfsAnalytics(TfsConnector tfs, IPersistentCache<ChangeInfo> changesCache)
 {
     this.changesCache = changesCache;
     this.tfs = tfs;
 }