예제 #1
0
 public EmailService(IConfiguration configuration, IExceptionService exceptionService, IClientFactory clientFactory)
 {
     _configuration    = configuration;
     _appSettings      = _configuration.Get <AppSettings>();
     _exceptionService = exceptionService;
     _clientFactory    = clientFactory;
 }
        /// <summary>
        /// Processes asynchrounously the specified action with possibilty to retry on error.
        /// </summary>
        /// <typeparam name="TResult">The result type.</typeparam>
        /// <param name="exceptionService">The exception service.</param>
        /// <param name="action">The action.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">The <paramref name="action"/> is <c>null</c>.</exception>
        public static Task <TResult> ProcessWithRetryAsync <TResult>(this IExceptionService exceptionService, Func <TResult> action, CancellationToken cancellationToken = new CancellationToken())
        {
            Argument.IsNotNull("exceptionService", exceptionService);
            Argument.IsNotNull("action", action);

            return(TaskHelper.Run(() => exceptionService.ProcessWithRetry(action), cancellationToken));
        }
예제 #3
0
 public UploadFileController(IExceptionService exceptionService, IFileDownloadUpload fileDownloadUpload, IImageService image, IHostEnvironment hostingEnvironment)
 {
     _exceptionService   = exceptionService ?? throw new ArgumentNullException(nameof(exceptionService));
     _fileUpload         = fileDownloadUpload ?? throw new ArgumentNullException(nameof(fileDownloadUpload));
     _imageService       = image ?? throw new ArgumentNullException(nameof(image));
     _hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
 }
예제 #4
0
 public DashboardService(ILocalizationService localizationSVC,
                         INotificationService notificationSVC,
                         IExceptionService exceptionSVC,
                         IWorkFlowService workflowSVC,
                         ICommonService commonSVC,
                         IRepository <Employee> employeeRepo,
                         IRepository <AttendanceLog> attendanceLogRepo,
                         IRepository <FiscalYear> fiscalYearRepo,
                         IRepository <LeaveApplication> leaveApplicationRepo,
                         IRepository <LeaveType> leaveTypeRepo,
                         IRepository <LeaveCategory> leaveCategoryRepo,
                         IRepository <TravelApplication> travelApplicationRepo,
                         IRepository <TravelCategory> travelCategoryRepo,
                         IRepository <TravelType> travelTypeRepo,
                         IRepository <ItemRequest> itemRequestRepo,
                         IRepository <ItemRequestDetail> itemRequestDetailRepo)
 {
     localizationService         = localizationSVC;
     this.notificationService    = notificationSVC;
     exceptionService            = exceptionSVC;
     workflowService             = workflowSVC;
     commonService               = commonSVC;
     employeeRepository          = employeeRepo;
     attendanceLogRepository     = attendanceLogRepo;
     fiscalYearRepository        = fiscalYearRepo;
     leaveApplicationRepository  = leaveApplicationRepo;
     leaveTypeRepository         = leaveTypeRepo;
     leaveCategoryRepository     = leaveCategoryRepo;
     travelApplicationRepository = travelApplicationRepo;
     travelCategoryRepository    = travelCategoryRepo;
     travelTypeRepository        = travelTypeRepo;
     itemRequestRepository       = itemRequestRepo;
     itemRequestDetailRepository = itemRequestDetailRepo;
 }
 public ServiceParameters(IOrganizationService organizationService, IMetadataService metadataService, INotificationService notificationService, IExceptionService exceptionService)
 {
     OrganizationService = organizationService;
     MetadataService     = metadataService;
     NotificationService = notificationService;
     ExceptionService    = exceptionService;
 }
예제 #6
0
 public HomeController(ILocationService locationService,
                       IUserService userService,
                       IExceptionService exceptionService)
     : base(userService, exceptionService)
 {
     _locationService = locationService;
 }
예제 #7
0
        /// <summary>
        /// Processes the specified action with possibilty to retry on error.
        /// </summary>
        /// <param name="exceptionService">The exception service.</param>
        /// <param name="action">The action.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="action"/> is <c>null</c>.</exception>
        public static void ProcessWithRetry(this IExceptionService exceptionService, Action action)
        {
            Argument.IsNotNull("exceptionService", exceptionService);
            Argument.IsNotNull("action", action);

            exceptionService.ProcessWithRetry(() => { action(); return(default(object)); });
        }
예제 #8
0
        private void SendRegistrationToServer(string token)
        {
            ILoginViewModel login = ServiceLocator.Current.GetInstance <ILoginViewModel>();

            hub = new NotificationHub(AppConfigurations.NotificationHubName, AppConfigurations.NotificationHubConnectionString, this);

            var tags = new List <string>
            {
                //"ucm"
            };

            if (login != null && login.User != null && string.IsNullOrEmpty(login.User.UserName) == false)
            {
                //tags.Add(login.User.UserName);
                tags.Add(ServiceLocator.Current.GetInstance <ILoginViewModel>().User.UserName);
            }

            try
            {
                Task.Run(() =>
                {
                    hub.Unregister();
                    var regID = hub.Register(token, tags.ToArray());
                });
            }
            catch (Exception ex)
            {
                exceptionService = ServiceLocator.Current.GetInstance <IExceptionService>();
                exceptionService.RegisterException(ex);
            }
        }
 public MatchController(IMatchService pridctService, IMapper mapper, IExceptionService exceptionService, IPredictionService predictionService)
 {
     _mapper            = mapper;
     _exceptionService  = exceptionService;
     _matchService      = pridctService;
     _predictionService = predictionService;
 }
 public AdminController(IUserService service, IRoleService roleService,
                        IExceptionService exceptionService)
 {
     _userService      = service;
     _roleService      = roleService;
     _exceptionService = exceptionService;
 }
예제 #11
0
 public VehicleDataService(
     IExceptionService exceptionService,
     IVehicleRepository <VehicleDetailsModel> vehicleRepository)
 {
     _exceptionService  = exceptionService;
     _vehicleRepository = vehicleRepository;
 }
예제 #12
0
 public UserDataService(
     IExceptionService exceptionService,
     IUserDataRepository <UserDataModel> userDataRepository)
 {
     _exceptionService = exceptionService;
     _userRepository   = userDataRepository;
 }
예제 #13
0
        /// <summary>
        /// Processes asynchrounously the specified action with possibilty to retry on error.
        /// </summary>
        /// <param name="exceptionService">The exception service.</param>
        /// <param name="action">The action.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="exceptionService"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="action"/> is <c>null</c>.</exception>
        public static Task ProcessWithRetryAsync(this IExceptionService exceptionService, Task action)
        {
            Argument.IsNotNull("exceptionService", exceptionService);
            Argument.IsNotNull("action", action);

            return(exceptionService.ProcessWithRetryAsync(async() => { await action.ConfigureAwait(false); return default(object); }));
        }
예제 #14
0
 public ReportController(IUserService userService,
                         IExceptionService exceptionService,
                         IReportService reportService,
                         IHostingEnvironment environment) : base(userService, exceptionService)
 {
     _reportService = reportService;
     _environment   = environment;
 }
예제 #15
0
 public BurningService(IBurningReceiptsCatalog BurningReceiptsCatalog, IExceptionService ExceptionService,
                       IProgressControllerFactory ProgressControllerFactory, IEventAggregator EventAggregator)
 {
     _burningReceiptsCatalog = BurningReceiptsCatalog;
     _exceptionService = ExceptionService;
     _progressControllerFactory = ProgressControllerFactory;
     _burningStartedEvent = EventAggregator.GetEvent<BurningStartedEvent>();
 }
예제 #16
0
 public ExceptionController(IConfiguration config,
                            ILogger <ExceptionController> logger,
                            IExceptionService exceptionService)
 {
     _config           = config;
     _logger           = logger;
     _exceptionService = exceptionService;
 }
예제 #17
0
 public FuelDataService(
     IExceptionService exceptionService,
     IFuelDataRepository <FuelDetailsModel> fuelRepository,
     IService <VehiclesDetailsDto> vehicleService)
 {
     _exceptionService = exceptionService;
     _fuelRepository   = fuelRepository;
     _vehicleService   = vehicleService;
 }
예제 #18
0
 public EditModel(
     Context context,
     IRoomService roomService,
     IExceptionService exceptionService)
 {
     _context          = context;
     _roomService      = roomService;
     _exceptionService = exceptionService;
 }
예제 #19
0
        //public int CountCompany { get; set; }
        //public int CountArticles { get; set; }
        //public int CountExceptionToday { get; set; }

        public ProfileController(IUserProfileService _userSrv, IExceptionService _excepSrv, IOrganizationService _orgSrv
                                 , IUserProfileService userSrv,
                                 IActionLogService _actionlogSrv) : base(userSrv)
        {
            this.userSrv      = _userSrv;
            this.excepSrv     = _excepSrv;
            this.orgSrv       = _orgSrv;
            this.actionLogSrv = _actionlogSrv;
        }
예제 #20
0
 public VisitController(IUserService userService,
                        IExceptionService exceptionService,
                        IMapper mapper,
                        IVisitService visitService)
     : base(userService, exceptionService)
 {
     _mapper       = mapper;
     _visitService = visitService;
 }
예제 #21
0
        /// <summary>
        /// Registers an handler for a specific exception.
        /// </summary>
        /// <typeparam name="TExceptionHandler">The type of the exception handler.</typeparam>
        /// <param name="exceptionService">The exception service.</param>
        /// <returns>The handler to use.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="exceptionService"/> is <c>null</c>.</exception>
        public static IExceptionHandler Register <TExceptionHandler>(this IExceptionService exceptionService)
            where TExceptionHandler : IExceptionHandler, new()
        {
            Argument.IsNotNull("exceptionService", exceptionService);

            var exceptionHandler = new TExceptionHandler();

            return(exceptionService.Register(exceptionHandler));
        }
예제 #22
0
 public UserdataService(
     IExceptionService exceptionService,
     IUserDataRepository userDataRepository,
     ILogger <UserdataService> logger)
 {
     _exceptionService   = exceptionService;
     _userDataRepository = userDataRepository;
     _logger             = logger;
 }
 public VehicleDataSubscriberService(
     ILogger <VehicleDataService> logger,
     IExceptionService exceptionService,
     IVehicleDataRepository vehicleDataRepository)
 {
     _logger                = logger;
     _exceptionService      = exceptionService;
     _vehicleDataRepository = vehicleDataRepository;
 }
예제 #24
0
 public VersionService(IExceptionService exceptionService, IConfiguration configuration,
                       ILogger <VersionService> logger, IVersionRepository versionRepository)
 {
     _exceptionService  = exceptionService;
     _configuration     = configuration;
     _logger            = logger;
     _versionRepository = versionRepository;
     _appSettings       = configuration.Get <AppSettings>();
 }
예제 #25
0
 public GoodsController(IGoodsService goodsService,
                        IExceptionService exceptionService,
                        ILocationService locationService,
                        IUserService userService,
                        IArticleService articleService,
                        IMapper mapper) : base(userService, exceptionService)
 {
     _goodsService = goodsService;
     _mapper       = mapper;
 }
예제 #26
0
        public EmployeeProfileService(
            ILocalizationService localizationSvc,
            IExceptionService exceptionSVC,
            IRepository <Employee> employeeRepo)
        {
            localizationService = localizationSvc;
            exceptionService    = exceptionSVC;

            employeeRepository = employeeRepo;
        }
예제 #27
0
        /// <summary>
        /// Handles asynchounously the specified exception if possible.
        /// </summary>
        /// <param name="exceptionService">The exception service.</param>
        /// <param name="exception">The exception to handle.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="exceptionService"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="exception"/> is <c>null</c>.</exception>
        /// <returns><c>true</c> if the exception is handled; otherwise <c>false</c>.</returns>
        public static async Task <bool> HandleExceptionAsync(this IExceptionService exceptionService, Exception exception, CancellationToken cancellationToken = default(CancellationToken))
        {
            Argument.IsNotNull("exceptionService", exceptionService);

#if NET40 || SL5 || PCL
            return(await Task.Factory.StartNew(() => exceptionService.HandleException(exception), cancellationToken).ConfigureAwait(false));
#else
            return(await Task.Run(() => exceptionService.HandleException(exception), cancellationToken).ConfigureAwait(false));
#endif
        }
예제 #28
0
		ExceptionListSettings(IExceptionService exceptionService, ISettingsService settingsService, Lazy<IDefaultExceptionSettings> defaultExceptionSettings) {
			this.exceptionService = exceptionService;
			this.settingsService = settingsService;
			this.defaultExceptionSettings = defaultExceptionSettings;
			exceptionService.Changed += ExceptionService_Changed;

			disableSaveCounter++;
			Load();
			disableSaveCounter--;
		}
예제 #29
0
 public UserController(IUserService userService,
                       IExceptionService exceptionService,
                       IRoleService roleService,
                       ILocationService locationService,
                       IMapper mapper) : base(userService, exceptionService)
 {
     _roleService     = roleService;
     _locationService = locationService;
     _mapper          = mapper;
 }
 public BurningViewModelFactory(IBurningReceiptsCatalog BurningReceiptsCatalog, IIndexHelper IndexHelper, IExceptionService ExceptionService,
                                IBurningService BurningService, IEventAggregator EventAggregator, ISettingsService SettingsService,
                                BurningStatusViewModel BurningStatus)
 {
     _indexHelper = IndexHelper;
     _burningService = BurningService;
     _eventAggregator = EventAggregator;
     _settingsService = SettingsService;
     _burningStatus = BurningStatus;
 }
 public AttachmentTypeController(IAttachmentTypeService attachmentTypeService,
                                 IUserService userService,
                                 IExceptionService exceptionService,
                                 IHostingEnvironment environment,
                                 IAttachmentService attachmentService,
                                 IMemoryCache memoryCache,
                                 IMapper mapper) : base(userService, exceptionService, environment, attachmentTypeService, attachmentService, memoryCache)
 {
     _mapper = mapper;
 }
 public LoaderPageViewModel(IApiService apiService, IDialogService dialogService, IExceptionService exceptionService, IFileService fileService, INavigationService navigationService, ILoginViewModel loginViewModel, IPhoneService phoneService)
 {
     this.apiService        = apiService;
     this.dialogService     = dialogService;
     this.exceptionService  = exceptionService;
     this.fileService       = fileService;
     this.navigationService = navigationService;
     this.loginViewModel    = loginViewModel;
     this.phoneService      = phoneService;
 }
예제 #33
0
        public SignalRClient(IConfiguration configuration, ITokenService tokenService, IExceptionService exceptionService)
        {
            _configuration    = configuration;
            _tokenService     = tokenService;
            _exceptionService = exceptionService;

            _tracer = TextWriter.Null;

            //ShowUserOnline = true;
        }
예제 #34
0
		public ExceptionContext(IExceptionService exceptionService, IClassificationFormatMap classificationFormatMap, ITextElementProvider textElementProvider) {
			ExceptionService = exceptionService;
			ClassificationFormatMap = classificationFormatMap;
			TextElementProvider = textElementProvider;
		}
 public ErrorHandlingInterceptor(IExceptionService exceptionService)
 {
     this.exceptionService = exceptionService;
 }
 public ExceptionController(IExceptionService exceptionService, IProjectService projectService)
 {
     this.exceptionService = exceptionService;
     this.projectService = projectService;
 }
예제 #37
0
		ExceptionsVM(IDebuggerSettings debuggerSettings, IExceptionService exceptionService, IExceptionListSettings exceptionListSettings, IGetNewExceptionName getNewExceptionName, IClassificationFormatMapService classificationFormatMapService, ITextElementProvider textElementProvider) {
			var classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.UIMisc);
			this.debuggerSettings = debuggerSettings;
			this.exceptionService = exceptionService;
			this.exceptionListSettings = exceptionListSettings;
			this.getNewExceptionName = getNewExceptionName;
			exceptionContext = new ExceptionContext(exceptionService, classificationFormatMap, textElementProvider) {
				SyntaxHighlight = debuggerSettings.SyntaxHighlightExceptions,
			};
			exceptionsList = new ObservableCollection<ExceptionVM>();
			CollectionView = CollectionViewSource.GetDefaultView(exceptionsList);
			debuggerSettings.PropertyChanged += DebuggerSettings_PropertyChanged;
			exceptionService.Changed += ExceptionService_Changed;
			classificationFormatMap.ClassificationFormatMappingChanged += ClassificationFormatMap_ClassificationFormatMappingChanged;
			InitializeDefaultExceptions();
		}