コード例 #1
0
 internal AssemblyResourceStore(Type evidence)
 {
     this.evidence = evidence;
     logger = Initializer.Instance.WindsorContainer.Resolve<ILoggingService>();
     _isoFile = IsolatedStorageFile.GetMachineStoreForAssembly();
     _backingFile = new IsolatedStorageFileStream(evidence.Assembly.GetName().Name, FileMode.OpenOrCreate, _isoFile);
     if (_backingFile.Length > 0)
     {
         try
         {
             var formatter = new BinaryFormatter();
             store = (Dictionary<string, object>)formatter.Deserialize(_backingFile);
         }
         catch (Exception ex)
         {
             logger.Log(Common.LogLevel.Error, string.Format("Error deserializing resource store for {0}. Resetting resource store.", evidence.Assembly.GetName().Name));
             logger.Log(Common.LogLevel.Debug, string.Format("Deserialize error: {0}", ex.Message));
             store = new Dictionary<string, object>();
         }
     }
     else
     {
         store = new Dictionary<string, object>();
     }
 }
コード例 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="membershipRepository"> </param>
 /// <param name="settingsRepository"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postRepository"></param>
 /// <param name="pollVoteRepository"></param>
 /// <param name="pollAnswerRepository"></param>
 /// <param name="pollRepository"></param>
 /// <param name="topicRepository"></param>
 /// <param name="favouriteRepository"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMembershipRepository membershipRepository, ISettingsRepository settingsRepository,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostRepository postRepository, IPollVoteRepository pollVoteRepository, IPollAnswerRepository pollAnswerRepository,
     IPollRepository pollRepository, ITopicRepository topicRepository, IFavouriteRepository favouriteRepository,
     ICategoryService categoryService)
 {
     _membershipRepository = membershipRepository;
     _settingsRepository = settingsRepository;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postRepository = postRepository;
     _pollVoteRepository = pollVoteRepository;
     _pollAnswerRepository = pollAnswerRepository;
     _pollRepository = pollRepository;
     _topicRepository = topicRepository;
     _favouriteRepository = favouriteRepository;
     _categoryService = categoryService;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SitemapService"/> class.
 /// </summary>
 /// <param name="loggingService">The logging service.</param>
 /// <param name="urlHelper">The URL helper.</param>
 public SitemapService(
     ILoggingService loggingService,
     UrlHelper urlHelper)
 {
     this.loggingService = loggingService;
     this.urlHelper = urlHelper;
 }
コード例 #4
0
        public ProductService(
                            IProductRepository productRepository,
                            ICacheStorage cacheStorage,
                            IConfigurationRepository configurationRepository,
                            ILoggingService loggingService)
        {
            if (productRepository == null)
            {
                throw new ArgumentNullException("ProductRepository");
            }

            if (cacheStorage == null)
            {
                throw new ArgumentNullException("CacheStorage");
            }

            if (configurationRepository == null)
            {
                throw new ArgumentException("Configuration");
            }

            if (loggingService == null)
            {
                throw new ArgumentException("Logging");
            }

            this._productRepository = productRepository;
            this._cacheStorage = cacheStorage;
            this._configurationRepository = configurationRepository;
            this._loggingService = loggingService;
        }
コード例 #5
0
        public SessionViewModel(IEventAggregator eventAggregator, IWindowManager windowManager, ILoggingService loggingService)
        {
            EventAggregator = eventAggregator;
            //EventAggregator.Publish(new NavigationEvent { PageNavigatedTo = "SessionView" });
            _windowManager = windowManager;
            _loggingService = loggingService;
            MessageBox = new StandardMessageBox();
            if (!DesignerProperties.IsInDesignTool)
            {
                LoadOperation lo = context.Load(context.GetSponsorswithAllPropertiesQuery(App.Event.Id));
                lo.Completed += delegate
                {
                    TrackList = context.Tracks;
                    if (lo.HasError)
                    {
                        ErrorWindow.CreateNew(lo.Error.Message);
                        _loggingService.LogException(lo.Error);
                    }
                };
            }
            else
            {

            }
        }
コード例 #6
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            //this.Style = this.TryFindResource(typeof(TextBox)) as Style;
            this.loggingService = (ILoggingService)this.serviceProvider.GetService(typeof(ILoggingService));

            if (this.loggingService == null)
            {
                this.Text = "ERROR:  Unable to get logging service; no output available.";
            }
            else
            {
                // Every output view gets its own text (and starts with what has accumulated so far, so they're all equal).
                this.Text = this.loggingService.AccumulatedLog;
                if (this.IsLoaded)
                {
                    OnLoaded(this, null);
                }
                else
                {
                    this.Loaded += OnLoaded;
                }

                this.loggingService.MessageLogged += OnMessageLogged;
            }
        }
コード例 #7
0
 /// <summary>
 /// Constructs a logging context from another logging context.  This is used primarily in
 /// the constructors for other logging contexts to populate the logging service parameter,
 /// while the event context will come from a call into the logging service itself.
 /// </summary>
 /// <param name="baseContext">The context from which this context is being created.</param>
 protected BaseLoggingContext(BaseLoggingContext baseContext)
 {
     _loggingService = baseContext._loggingService;
     _eventContext = null;
     _isValid = baseContext._isValid;
     _isInProcNode = baseContext._isInProcNode;
 }
コード例 #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"> </param>
 /// <param name="localizationService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="loggingService"> </param>
 public AdminBadgeController(IBadgeService badgeService, IPostService postService, ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, 
     IMembershipService membershipService, ILocalizationService localizationService, ISettingsService settingsService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
     _badgeService = badgeService;
     _postService = postService;
 }
コード例 #9
0
ファイル: ActivityService.cs プロジェクト: lenwen/mvcforum
 /// <summary>
 /// Constructor
 /// </summary>
 public ActivityService(IBadgeService badgeService, ILoggingService loggingService, IMVCForumContext context, ICacheService cacheService)
 {
     _badgeService = badgeService;
     _loggingService = loggingService;
     _cacheService = cacheService;
     _context = context as MVCForumContext;
 }
コード例 #10
0
ファイル: TaskHost_Tests.cs プロジェクト: ChronosWS/msbuild
        public void SetUp()
        {
            LoggingServiceFactory loggingFactory = new LoggingServiceFactory(LoggerMode.Synchronous, 1);

            _loggingService = loggingFactory.CreateInstance(BuildComponentType.LoggingService) as LoggingService;

            _customLogger = new MyCustomLogger();
            _mockHost = new MockHost();
            _mockHost.LoggingService = _loggingService;

            _loggingService.RegisterLogger(_customLogger);
            _elementLocation = ElementLocation.Create("MockFile", 5, 5);

            BuildRequest buildRequest = new BuildRequest(1 /* submissionId */, 1, 1, new List<string>(), null, BuildEventContext.Invalid, null);
            BuildRequestConfiguration configuration = new BuildRequestConfiguration(1, new BuildRequestData("Nothing", new Dictionary<string, string>(), "4.0", new string[0], null), "2.0");

            configuration.Project = new ProjectInstance(ProjectRootElement.Create());

            BuildRequestEntry entry = new BuildRequestEntry(buildRequest, configuration);

            BuildResult buildResult = new BuildResult(buildRequest, false);
            buildResult.AddResultsForTarget("Build", new TargetResult(new TaskItem[] { new TaskItem("IamSuper", configuration.ProjectFullPath) }, TestUtilities.GetSkippedResult()));
            _mockRequestCallback = new MockIRequestBuilderCallback(new BuildResult[] { buildResult });
            entry.Builder = (IRequestBuilder)_mockRequestCallback;

            _taskHost = new TaskHost(_mockHost, entry, _elementLocation, null /*Dont care about the callback either unless doing a build*/);
            _taskHost.LoggingContext = new TaskLoggingContext(_loggingService, BuildEventContext.Invalid);
        }
コード例 #11
0
ファイル: ActivityService.cs プロジェクト: huchao007/mvcforum
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="activityRepository"> </param>
 /// <param name="badgeRepository"> </param>
 /// <param name="membershipRepository"> </param>
 /// <param name="loggingService"> </param>
 public ActivityService(IActivityRepository activityRepository, IBadgeRepository badgeRepository, IMembershipRepository membershipRepository, ILoggingService loggingService)
 {
     _activityRepository = activityRepository;
     _badgeRepository = badgeRepository;
     _loggingService = loggingService;
     _membershipRepository = membershipRepository;
 }
コード例 #12
0
ファイル: StatsController.cs プロジェクト: kangjh0815/test
 public StatsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
     ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicService topicService, IPostService postService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService = topicService;
     _postService = postService;
 }
コード例 #13
0
ファイル: TagController.cs プロジェクト: huchao007/mvcforum
 public TagController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicTagService topicTagService, ICategoryService categoryService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicTagService = topicTagService;
     _categoryService = categoryService;
     _cacheService = cacheService;
 }
コード例 #14
0
ファイル: MembershipService.cs プロジェクト: flerka/mvcforum
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postService"></param>
 /// <param name="pollVoteService"></param>
 /// <param name="pollAnswerService"></param>
 /// <param name="pollService"></param>
 /// <param name="topicService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMVCForumContext context, ISettingsService settingsService,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostService postService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService,
     IPollService pollService, ITopicService topicService, IFavouriteService favouriteService, 
     ICategoryService categoryService, IPostEditService postEditService)
 {
     _settingsService = settingsService;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postService = postService;
     _pollVoteService = pollVoteService;
     _pollAnswerService = pollAnswerService;
     _pollService = pollService;
     _topicService = topicService;
     _favouriteService = favouriteService;
     _categoryService = categoryService;
     _postEditService = postEditService;
     _context = context as MVCForumContext;
 }
コード例 #15
0
ファイル: ToolsController.cs プロジェクト: h2h/CandyBBS
 public ToolsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IUserService userService,
     ISettingsService settingsService,
     ILocalizationService localizationService,
     IRoleService roleService)
     : base(loggingService, unitOfWorkManager, userService, settingsService, localizationService)
 {
 }
コード例 #16
0
ファイル: SnippetsController.cs プロジェクト: lenwen/mvcforum
 public SnippetsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
     ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService,
     IMembershipUserPointsService membershipUserPointsService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _membershipUserPointsService = membershipUserPointsService;
 }
コード例 #17
0
ファイル: FileController.cs プロジェクト: lenwen/mvcforum
 public FileController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
     ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, IUploadedFileService uploadedFileService, ICategoryService categoryService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _uploadedFileService = uploadedFileService;
     _categoryService = categoryService;
 }
コード例 #18
0
 public SystemNetEmailService(IConfigurationRepository configurationRepository, ILoggingService loggingService)
 {
     if (configurationRepository == null) throw new ArgumentNullException("ConfigurationRepository");
     if (loggingService == null) throw new ArgumentNullException("LoggingService");
     _configurationRepository = configurationRepository;
     _loggingService = loggingService;
 }
コード例 #19
0
 public CombinerResponseStream(
     Stream responseStream,
     bool combineJs,
     bool combineCss,
     bool minifyJs,
     bool minifyCss,
     bool versionOnly,
     bool prependCdnHostToImages,
     string jsVersion,
     string cssVersion,
     string sharedVersion,
     int ieVersion,
     string requestedUrl,
     ICombinerService combinerService,
     ILoggingService loggingService,
     string combinedResourcesUrl,
     string cdnHostToPrepend)
     : base(responseStream)
 {
     _combineJs = combineJs;
     _combineCss = combineCss;
     _minifyJs = minifyJs;
     _minifyCss = minifyCss;
     _versionOnly = versionOnly;
     _jsVersion = jsVersion;
     _cssVersion = cssVersion;
     _sharedVersion = sharedVersion;
     _ieVersion = ieVersion;
     _requestedUrl = requestedUrl;
     _combinerService = combinerService;
     _logger = loggingService;
     _combinedResourcesUrl = combinedResourcesUrl;
     _prependCdnHostToImages = prependCdnHostToImages;
     _cdnHostToPrepend = cdnHostToPrepend;
 }
コード例 #20
0
 public ScreenshotCefClient(ScreenshotCore core, int width, int height, ILoggingService loggingService)
 {
     this.lifeSpanHandler = new WebLifeSpanHandler(core);
     this.loadHandler = new WebLoadHandler(core);
     this.renderHandler = new ScreenshotRenderHandler(core, width, height);
     this.loggingService = loggingService;
 }
コード例 #21
0
 public JustGivingService(IHttpClient httpClient, ILoggingService loggingService, string apiKey, string endPoint, int charityId)
 {
     _httpClient = httpClient;
     _loggingService = loggingService;
     _endPoint = string.Format("{0}{1}/v1/", endPoint, apiKey);
     _charityId = charityId;
 }
コード例 #22
0
ファイル: AccountService.cs プロジェクト: khats/Coffee
 public AccountService(ILoggingService loggingService, IAccountRepository accountRepository,
     ISharedHelper helper)
 {
     _loggingService = loggingService;
     _accountRepository = accountRepository;
     _helper = helper;
 }
コード例 #23
0
ファイル: AzureTentQueues.cs プロジェクト: Campr/Server
        public AzureTentQueues(IGeneralConfiguration configuration, 
            IJsonHelpers jsonHelpers,
            ITaskHelpers taskHelpers,
            ILoggingService loggingService)
        {
            Ensure.Argument.IsNotNull(configuration, nameof(configuration));
            Ensure.Argument.IsNotNull(jsonHelpers, nameof(jsonHelpers));
            Ensure.Argument.IsNotNull(taskHelpers, nameof(taskHelpers));
            Ensure.Argument.IsNotNull(loggingService, nameof(loggingService));

            this.taskHelpers = taskHelpers;
            this.loggingService = loggingService;

            // Create the storage account from the connection string, and the corresponding client.
            var queuesStorageAccount = CloudStorageAccount.Parse(configuration.AzureQueuesConnectionString);
            var queuesClient = queuesStorageAccount.CreateCloudQueueClient();

            // Create the queues references.
            this.mentionsQueue = queuesClient.GetQueueReference("mentions");
            this.subscriptionsQueue = queuesClient.GetQueueReference("subscriptions");
            this.appNotificationQueue = queuesClient.GetQueueReference("appnotifications");
            this.metaSubscriptionQueue = queuesClient.GetQueueReference("metasubscriptions");
            this.retryQueue = queuesClient.GetQueueReference("retries");

            // Create the IQueue objects.
            this.Mentions = new AzureQueue<QueueMentionMessage>(this.mentionsQueue, jsonHelpers);
            this.Subscriptions = new AzureQueue<QueueSubscriptionMessage>(this.subscriptionsQueue, jsonHelpers);
            this.AppNotifications = new AzureQueue<QueueAppNotificationMessage>(this.appNotificationQueue, jsonHelpers);
            this.MetaSubscriptions = new AzureQueue<QueueMetaSubscriptionMessage>(this.metaSubscriptionQueue, jsonHelpers);
            this.Retries = new AzureQueue<QueueRetryMessage>(this.retryQueue, jsonHelpers);

            // Create the initializer for this component.
            this.initializer = new TaskRunner(this.InitializeOnceAsync);
        }
コード例 #24
0
 public SendToJustGiving()
 {
     Id = new Guid("b63f089f-6a6c-4f0b-9a7a-cd3249175595");
     Name = "Send to Just Giving";
     Description = "This workflow will post the user form data to Just Giving.";
     _loggingService = NinjectWebCommon.Kernel.GetService<ILoggingService>();
 }
コード例 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SitemapPingerService"/> class.
 /// </summary>
 /// <param name="loggingService">The logging service.</param>
 /// <param name="urlHelper">The URL helper.</param>
 public SitemapPingerService(
     ILoggingService loggingService,
     UrlHelper urlHelper)
 {
     this.loggingService = loggingService;
     this.urlHelper = urlHelper;
     this.httpClient = new HttpClient();
 }
コード例 #26
0
ファイル: BaseController.cs プロジェクト: h2h/CandyBBS
 //private readonly MembershipUser _loggedInUser;
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="loggingService"> </param>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"></param>
 /// <param name="localizationService"> </param>
 /// <param name="roleService"> </param>
 /// <param name="settingsService"> </param>
 public BaseController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,IUserService userService,IRoleService roleService,ISettingsService settingsService)
 {
     this.UnitOfWorkManager = unitOfWorkManager;
     this.LoggingService = loggingService;
     this.UserService = userService;
     this.RoleService = roleService;
     this.SettingsService = settingsService;
 }
コード例 #27
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="localizationRepository"> </param>
        /// <param name="settingsRepository"> </param>
        /// <param name="loggingService"></param>
        public LocalizationService(ILocalizationRepository localizationRepository, ISettingsRepository settingsRepository, ILoggingService loggingService)
        {
            _localizationRepository = localizationRepository;
            _settingsRepository = settingsRepository;
            _loggingService = loggingService;

            _perRequestLanguageStrings = ResourceKeysByLanguage(CurrentLanguage);
        }
コード例 #28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settingsService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="cacheService"></param>
 /// <param name="context"></param>
 public LocalizationService(ISettingsService settingsService, ILoggingService loggingService, ICacheService cacheService, IMVCForumContext context)
 {
     _settingsService = settingsService;
     _loggingService = loggingService;
     _cacheService = cacheService;
     _context = context as MVCForumContext;
     _perRequestLanguageStrings = ResourceKeysByLanguage(CurrentLanguage);
 }
コード例 #29
0
 public UploadController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager,
     IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService,
     IPostService postService, IUploadedFileService uploadedFileService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _postService = postService;
     _uploadedFileService = uploadedFileService;
 }
コード例 #30
0
ファイル: KepAliveJob.cs プロジェクト: ivanchen52/mvcforum
 public KeepAliveJob(ILoggingService loggingService, 
                     IUnitOfWorkManager unitOfWorkManager, 
                     ISettingsService settingsService)
 {
     _loggingService = loggingService;
     _unitOfWorkManager = unitOfWorkManager;
     _settingsService = settingsService;
 }
コード例 #31
0
 public ProfileController(IProfileService profileService,
                          ILoggingService loggingService)
 {
     _profileService = profileService;
     _loggingService = loggingService;
 }
コード例 #32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorController"/> class.
 /// </summary>
 /// <param name="loggingService">The logging service.</param>
 public ErrorController(ILoggingService loggingService)
 {
     this.loggingService = loggingService;
 }
コード例 #33
0
 /// <summary>
 /// Default constructer
 /// </summary>
 public CustomLoggingMiddleware(RequestDelegate requestDelegate, ILoggingService loggingService, IOptions <LoggingRestrictionOptions> loggingOptions)
 {
     next                      = requestDelegate;
     LoggingService            = loggingService;
     LoggingRestrictionOptions = loggingOptions;
 }
コード例 #34
0
 public DeviceTypeParameterAttributeRepository(ITransactions transactions, ILoggingService loggingService)
 {
     this._transactions   = transactions;
     this._loggingService = loggingService;
     this._loggingService.CreateLogger(this.GetType());
 }
コード例 #35
0
        /// <summary>
        /// Find dispatcher for the dashboard page requested
        /// </summary>
        /// <param name="httpContext">Current HttpContext of the request</param>
        /// <param name="provider">Application service profider</param>
        /// <param name="loggingService">AutoPocoIO resource operation logging service</param>
        /// <returns></returns>
        public async Task Invoke(HttpContext httpContext, IServiceProvider provider, ILoggingService loggingService)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException(nameof(httpContext));
            }
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }
            if (loggingService == null)
            {
                throw new ArgumentNullException(nameof(loggingService));
            }

            SetupServices(provider);

            var context = new AspNetCoreMiddlewareContext(httpContext, _serviceProvider);

            string routeToSearch = httpContext.Request.Path.Value;
            string basePath      = "/" + AutoPocoConfiguration.DashboardPathPrefix;

            if (!httpContext.Request.PathBase.ToString().Equals(basePath, StringComparison.InvariantCultureIgnoreCase))
            {
                routeToSearch = httpContext.Request.Path.Value.Replace(basePath, string.Empty, StringComparison.OrdinalIgnoreCase);
            }

            var findResult = _routes.Routes.FindDispatcher(context, routeToSearch);


            if (context.Response.StatusCode == (int)HttpStatusCode.MethodNotAllowed)
            {
                return;
            }
            if (findResult == null)
            {
                await _next.Invoke(httpContext)
                .ConfigureAwait(false);

                return;
            }


            context.UriMatch = findResult.Item2;

            UriBuilder uriBuilder = new UriBuilder
            {
                Scheme = httpContext.Request.Scheme,
                Host   = httpContext.Request.Host.Host,
                Path   = httpContext.Request.Path.ToString(),
                Query  = httpContext.Request.QueryString.ToString()
            };

            context.RequestUri = uriBuilder.Uri;
            context.QueryStrings.Clear();
            foreach (var querystring in httpContext.Request.GetQueryStrings())
            {
                context.QueryStrings.Add(querystring);
            }

            httpContext.Request.PathBase = basePath;
            await findResult.Item1.Dispatch(context, loggingService)
            .ConfigureAwait(false);
        }
コード例 #36
0
 public VehicleStatusTypeTranslation(ILoggingService log, IDataService <IWebApiDataServiceQR> dataService) : base(log, dataService)
 {
     _dto = new xDTO.VehicleStatusTypeTranslation();
     OnLazyLoadRequest += HandleLazyLoadRequest;
 }
コード例 #37
0
 public VehicleStatusTypeTranslation(ILoggingService log, IDataService <IWebApiDataServiceQR> dataService, xDTO.VehicleStatusTypeTranslation dto) : this(log, dataService)
 {
     _dto = dto;
 }
コード例 #38
0
 /// <summary>
 /// Constructs a logging context from another logging context.  This is used primarily in
 /// the constructors for other logging contexts to populate the logging service parameter,
 /// while the event context will come from a call into the logging service itself.
 /// </summary>
 /// <param name="baseContext">The context from which this context is being created.</param>
 public LoggingContext(LoggingContext baseContext)
 {
     _loggingService = baseContext._loggingService;
     _eventContext   = null;
     _isValid        = baseContext._isValid;
 }
コード例 #39
0
ファイル: SyncService.cs プロジェクト: churchs19/WhatIEat
 public SyncService(IMobileServiceClient client, ISettingsService settings, IRepository <IEntry> entries, ILoggingService log)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     _settingsService = settings;
     if (entries == null)
     {
         throw new ArgumentNullException("entries");
     }
     _entries = entries;
     if (client == null)
     {
         throw new ArgumentNullException("client");
     }
     Client = client;
     if (log == null)
     {
         throw new ArgumentNullException("log");
     }
     _log = log;
 }
コード例 #40
0
 public ImageServer(IImageController controller, ILoggingService loggingService)
 {
     _controller     = controller;
     _loggingService = loggingService;
 }
コード例 #41
0
 public GuildConfigCommands(InteractivityService interactivity, IGuildConfigRepository repo, ILoggingService logging, DiscordSocketClient client)
 {
     logging.Info("Initialising Guild Config Command Service");
     _interactivity = interactivity;
     _repo          = repo;
     _logging       = new SourcedLoggingService(logging, "ConfigCmds");
     _client        = client.Rest;
 }
コード例 #42
0
 public ValuesController(ILoggingService loggingService)
 {
     this.loggingService = loggingService;
 }
コード例 #43
0
 public AdminTagController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicTagService topicTagService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicTagService = topicTagService;
 }
コード例 #44
0
 public NotificationService(ILoggingService loggingService)
 {
     this.loggingService = loggingService;
 }
コード例 #45
0
 public RideServiceTypeTranslation(ILoggingService log, IDataService <IWebApiDataServiceQR> dataService, xDTO.RideServiceTypeTranslation dto) : this(log, dataService)
 {
     _dto = dto;
 }
コード例 #46
0
 public TargetValueValidator(ILoggingService loggingService) : base(loggingService)
 {
 }
コード例 #47
0
 public MeetingSchedule(ILoggingService log, IDataService <IWebApiDataServiceBB> dataService, xDTO.MeetingSchedule dto) : this(log, dataService)
 {
     _dto = dto;
 }
コード例 #48
0
 /// <summary>
 /// Default constructor with logging injected
 /// </summary>
 /// <param name="loggingService">Dependency injected logging for all end points</param>
 public StoredProcedureDefinitionController(IStoredProcedureOperations storedProcedureOperations, ILoggingService loggingService)
 {
     _loggingService            = loggingService;
     _storedProcedureOperations = storedProcedureOperations;
 }
コード例 #49
0
 public MeetingSchedule(ILoggingService log, IDataService <IWebApiDataServiceBB> dataService) : base(log, dataService)
 {
     _dto = new xDTO.MeetingSchedule();
     OnLazyLoadRequest += HandleLazyLoadRequest;
 }
コード例 #50
0
 public DailyWeatherService(IDailyWeatherProvider fileParser, ILoggingService loggingService)
 {
     _fileParser     = fileParser;
     _loggingService = loggingService;
 }
コード例 #51
0
ファイル: ProductController.cs プロジェクト: sysnova/SADRI
 public ProductController(IProductService productService, ILoggingService loggingService)
 {
     _productService = productService;
     _loggingService = loggingService;
 }
コード例 #52
0
 public SitecoreImageService(ILoggingService loggingService, ISitecoreContext sitecoreContext)
 {
     _loggingService  = loggingService;
     _sitecoreContext = sitecoreContext;
 }
コード例 #53
0
        public BenchmarkPresenter(IBenchmarkView benchmarkView, IMessageService messageService, ILoggingService loggingService)
        {
            _messageService = messageService;
            _loggingService = loggingService;
            _benchmarkView  = benchmarkView;

            _benchmarkView.RunBenchmark += OnRunBenchmark;

            _benchmarkView.CancelBenchmark += OnCancelBenchmark;

            _benchmarkView.IsBenchmarkRunning = false;
        }
コード例 #54
0
 public LogController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService, ISettingsService settingsService) :
     base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
 }
コード例 #55
0
 public MockLoggingContext(ILoggingService loggingService, BuildEventContext eventContext) : base(loggingService, eventContext)
 {
     IsValid = true;
 }
コード例 #56
0
 public DeviceConfigFaultCodeReportingService(IInjectConfig injectConfig, IDeviceConfigRepository deviceConfigRepository, IEnumerable <IRequestValidator <DeviceConfigRequestBase> > deviceConfigRequestValidators,
                                              IEnumerable <IRequestValidator <IServiceRequest> > serviceRequestValidators,
                                              IEnumerable <IRequestValidator <DeviceConfigFaultCodeReportingRequest> > faultCodeReportingValidators,
                                              IAssetDeviceRepository assetDeviceRepository,
                                              IOptions <Configurations> configurations,
                                              IParameterAttributeCache parameterAttributeCache, IMapper mapper, IMessageConstructor messageConstructor, IAckBypasser ackBypasser, IDeviceConfigSettingConfig settingsConfig, ITransactions transactions, ILoggingService loggingService) : base(injectConfig, deviceConfigRepository, parameterAttributeCache, mapper, assetDeviceRepository, messageConstructor, ackBypasser, settingsConfig, configurations, transactions, loggingService)
 {
     this._deviceConfigRequestValidators = deviceConfigRequestValidators;
     this._serviceRequestValidators      = serviceRequestValidators;
     this._faultCodeReportingValidators  = faultCodeReportingValidators;
     this._loggingService.CreateLogger(this.GetType());
 }
コード例 #57
0
 public PageListSmartScrapper(ISettingRepository settingRepository, ILoggingService loggingService,
                              IWebQueryService webQueryService) : base(settingRepository, loggingService, webQueryService)
 {
 }
コード例 #58
0
 // C'tor
 public StatusService(ILoggingService logger)
 {
     _logger = logger;
 }
コード例 #59
0
 public MockCodeGenerationHost(ILoggingService loggingService, ISharedCodeService sharedCodeService)
 {
     this._loggingService    = loggingService ?? new ConsoleLogger();
     this._sharedCodeService = sharedCodeService ?? new MockSharedCodeService(null, null, null);
 }
 private IDownloadService NewSecureDownloadProvider(IDownloadService downloadService,
                                                    ISecureFilePayloadService secureFilePayloadService,
                                                    ILoggingService loggingService)
 {
     return(new SecureDownloadProvider(downloadService, secureFilePayloadService, loggingService));
 }