コード例 #1
0
        public ExceptionsDataLoadParams(IDbContext context, ExceptionsSettings settings)
        {
            if (context == null) throw new ArgumentNullException(nameof(context));
            if (settings == null) throw new ArgumentNullException(nameof(settings));

            this.Context = context;
            this.Settings = settings;
        }
コード例 #2
0
ファイル: ExceptionsViewModel.cs プロジェクト: ppetrov/Cchbc
		private ExceptionsDataLoadParams GetExceptionsDataLoadParams(IDbContext context, ExceptionsSettings settings)
		{
			var loadParams = new ExceptionsDataLoadParams(context, settings)
			{
				Version = this.Version,
				TimePeriod = this.TimePeriod
			};
			return loadParams;
		}
コード例 #3
0
ファイル: ExceptionsViewModel.cs プロジェクト: ppetrov/Cchbc
		private void LoadCurrentExceptionData(ExceptionsSettings settings = null)
		{
			if (!this.IsLoaded) return;

			using (var ctx = this.DbContextCreator())
			{
				this.LoadExceptions(ctx, settings);
				this.LoadExceptionsCounts(ctx, settings);

				ctx.Complete();
			}
		}
コード例 #4
0
ファイル: ExceptionsViewModel.cs プロジェクト: ppetrov/Cchbc
		private void LoadExceptionsCounts(IDbContext context, ExceptionsSettings settings = null)
		{
			this.ExceptionsCounts.Clear();

			foreach (var exceptionsCount in this.ExceptionsCountProvider(this.GetExceptionsDataLoadParams(context, settings ?? this.Settings)))
			{
				this.ExceptionsCounts.Add(new ExceptionsCountViewModel(exceptionsCount));
			}
		}
コード例 #5
0
ファイル: ExceptionsViewModel.cs プロジェクト: ppetrov/Cchbc
		private void LoadExceptions(IDbContext context, ExceptionsSettings settings = null)
		{
			this.LatestExceptions.Clear();

			foreach (var featureException in this.ExceptionsProvider(this.GetExceptionsDataLoadParams(context, settings ?? this.Settings)))
			{
				this.LatestExceptions.Add(featureException);
			}
		}
コード例 #6
0
ファイル: ExceptionsViewModel.cs プロジェクト: ppetrov/Cchbc
		public ExceptionsViewModel(Func<IDbContext> dbContextCreator, ExceptionsSettings settings)
		{
			if (dbContextCreator == null) throw new ArgumentNullException(nameof(dbContextCreator));
			if (settings == null) throw new ArgumentNullException(nameof(settings));

			this.DbContextCreator = dbContextCreator;
			this.Settings = settings;
		}