public HomeController(
     INewsTasks newsTasks,
     IMapper<IList<NewsItem>, HomePageViewModel> homePageViewModelMapper,
     ICachingService cachingService)
 {
     this.newsTasks = newsTasks;
     this.homePageViewModelMapper = homePageViewModelMapper;
     this.cachingService = cachingService;
 }
 public AboutController(
     INewsTasks newsTasks,
     IMapper<IList<NewsItem>, AboutPageViewModel> aboutPageViewModelMapper, 
     ICachingService cachingService)
 {
     this.newsTasks = newsTasks;
     this.cachingService = cachingService;
     this.aboutPageViewModelMapper = aboutPageViewModelMapper;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginFactory" /> class.
        /// </summary>
        /// <param name="pluginsTranslator">The pluginsTranslator.</param>
        /// <param name="cachingService">The caching service.</param>
        public PluginFactory(
            ITranslator<string, Plugins> pluginsTranslator,
            ICachingService cachingService)
        {
            TraceService.WriteLine("PluginFactory::Constructor");

            this.pluginsTranslator = pluginsTranslator;
            this.cachingService = cachingService;
        }
		/// <summary>
		/// Constructs a caching decorated <see cref="IRepository"/>.
		/// </summary>
		/// <param name="decoratedRepository">The <see cref="IRepository"/> being decorated.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>service which to use.</param>
		public CachingRepositoryDecorator(IRepository decoratedRepository, ICachingService cachingService) : base(decoratedRepository)
		{
			// validate arguments
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// set values.
			this.cachingService = cachingService;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="cachingService"></param>
		/// <exception cref="ArgumentNullException"></exception>
		public ClearCacheTag(ICachingService cachingService)
		{
			// validate arguments
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// set values
			this.cachingService = cachingService;
		}
		/// <summary>
		/// Constructs the HTML template serivce.
		/// </summary>
		/// <param name="interpreters">The <see cref="IEnumerable{T}"/>s.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>.</param>
		public HtmlTemplateService(IEnumerable<SectionInterpreter> interpreters, ICachingService cachingService)
		{
			// validate arguments
			if (interpreters == null)
				throw new ArgumentNullException("interpreters");
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// set values
			this.interpreters = interpreters;
			this.cachingService = cachingService;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="cachingService"></param>
		/// <param name="expressionScriptService"></param>
		/// <exception cref="ArgumentNullException"></exception>
		public ResponseTemplateTag(ICachingService cachingService, IExpressionScriptService expressionScriptService)
		{
			// validate arguments
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");
			if (expressionScriptService == null)
				throw new ArgumentNullException("expressionScriptService");

			// set values
			this.cachingService = cachingService;
			this.expressionScriptService = expressionScriptService;
		}
		/// <summary>
		/// Constructs the index definition resolver.
		/// </summary>
		/// <param name="typeService">The <see cref="ITypeDefinition"/>.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>.</param>
		public IndexDefinitionResolver(ITypeService typeService, ICachingService cachingService)
		{
			// validate arguments
			if (typeService == null)
				throw new ArgumentNullException("typeService");
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// set values
			this.typeService = typeService;
			this.cachingService = cachingService;
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="EffectViewModel" /> class.
 /// </summary>
 /// <param name="messageBoxService">The message box service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="effectFactory">The effect factory.</param>
 public EffectViewModel(
     IMessageBoxService messageBoxService,
     ISettingsService settingsService,
     ICachingService cachingService,
     IEffectFactory effectFactory)
 {
     this.messageBoxService = messageBoxService;
     this.settingsService = settingsService;
     this.cachingService = cachingService;
     this.effectFactory = effectFactory;
     this.Init();
 }
		/// <summary>
		/// Constructs the expression service.
		/// </summary>
		/// <param name="interpreters">The <see cref="IEnumerable{T}"/>.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>.</param>
		/// <exception cref="ArgumentNullException">Thrown when either <paramref name="interpreters"/> or <paramref name="cachingService"/> is null.</exception>
		public ExpressionScriptService(IEnumerable<ExpressionPartInterpreter> interpreters, ICachingService cachingService)
		{
			// validate arguments
			if (interpreters == null)
				throw new ArgumentNullException("interpreters");
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// set values
			this.interpreters = interpreters;
			this.cachingService = cachingService;
		}
		/// <summary>
		/// Constructs the window resource service.
		/// </summary>
		/// <param name="physicalBasePath">The physical base path of th application.</param>
		/// <param name="resourceSubFolder">The subfolder in which the application paths live.</param>
		/// <param name="assemblyRootPaths">The root paths.</param>
		/// <param name="pathInterpreters">The <see cref="IEnumerable{T}"/>s.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>.</param>
		public WindowsApplicationResourceService(string physicalBasePath, string resourceSubFolder, IEnumerable<string> assemblyRootPaths, IEnumerable<ResourcePathInterpreter> pathInterpreters, ICachingService cachingService)
		{
			// validate arguments
			if (string.IsNullOrEmpty(physicalBasePath))
				throw new ArgumentNullException("physicalBasePath");
			if (assemblyRootPaths == null)
				throw new ArgumentNullException("assemblyRootPaths");
			if (pathInterpreters == null)
				throw new ArgumentNullException("pathInterpreters");
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// get the directory info
			var physicalBaseDirectory = new DirectoryInfo(physicalBasePath);
			if (!physicalBaseDirectory.Exists)
				throw new InvalidOperationException(string.Format("Physical path '{0}' does not exist", physicalBasePath));

			// set the values
			this.physicalBasePath = physicalBaseDirectory.FullName;
			this.pathInterpreters = pathInterpreters;

			foreach (var rootPath in assemblyRootPaths.Select(rootPath => rootPath.Trim(new[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar})))
			{
				// make sure the path is only added once
				if (rootPaths.Contains(rootPath))
					throw new InvalidOperationException(string.Format("The root path '{0}' is already added", rootPath));

				// make sure the directoy exists
				var rootPathDirectory = Path.Combine(physicalBasePath, Path.Combine(rootPath, resourceSubFolder));
				if (!Directory.Exists(rootPathDirectory))
					throw new InvalidOperationException(string.Format("Resource path '{0}' does not exist", rootPathDirectory));

				// add the root path
				rootPaths.Add(rootPathDirectory);
				rootPathsReverse.Insert(0, rootPathDirectory);
			}

			// add file system watchers
			foreach (var watcher in rootPaths.Select(rootPath => new FileSystemWatcher(rootPath)
			                                                     {
			                                                     	EnableRaisingEvents = true,
			                                                     	IncludeSubdirectories = true
			                                                     }))
			{
				watcher.Changed += (sender, e) =>
				                   {
				                   	// clear the cache when this object is not yet disposed
				                   	if (IsNotDisposed)
				                   		cachingService.ClearAll();
				                   };
				watchers.Add(watcher);
			}
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectFactory" /> class.
        /// </summary>
        /// <param name="resolverService">The resolver service.</param>
        /// <param name="registerService">The register service.</param>
        /// <param name="cachingService">The caching service.</param>
        /// <param name="settingsService">The settings service.</param>
        public ProjectFactory(
            IResolverService resolverService,
            IRegisterService registerService,
            ICachingService cachingService,
            ISettingsService settingsService)
        {
            TraceService.WriteLine("ProjectFactory::Constructor");

            this.resolverService = resolverService;
            this.registerService = registerService;
            this.cachingService = cachingService;
            this.settingsService = settingsService;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NugetService" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="cachingService">The caching service.</param>
        /// <param name="fileOperationService">The file operation service.</param>
        public NugetService(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            ICachingService cachingService,
            IFileOperationService fileOperationService)
        {
            TraceService.WriteLine("NugetService::Constructor");

            this.visualStudioService = visualStudioService;
            this.settingsService = settingsService;
            this.cachingService = cachingService;
            this.fileOperationService = fileOperationService;
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsViewModel" /> class.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="folderBrowserDialogService">The folder browser dialog service.</param>
        /// <param name="cachingService">The caching service.</param>
        public ProjectsViewModel(
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IProjectFactory projectFactory,
            IFileSystem fileSystem,
            IMessageBoxService messageBoxService,
            IFolderBrowserDialogService folderBrowserDialogService,
            ICachingService cachingService)
        {
            TraceService.WriteLine("ProjectsViewModel::Constructor Start");

            this.visualStudioService        = visualStudioService;
            this.settingsService            = settingsService;
            this.fileSystem                 = fileSystem;
            this.projectFactory             = projectFactory;
            this.messageBoxService          = messageBoxService;
            this.folderBrowserDialogService = folderBrowserDialogService;
            this.cachingService             = cachingService;

            this.projects = new ObservableCollection <SelectableItemViewModel <ProjectTemplateInfo> >();

            //// set the defaults!
            this.Project = visualStudioService.GetDefaultProjectName();

            if (string.IsNullOrEmpty(this.Project) &&
                this.settingsService.UseTempProjectName)
            {
                this.Project = "P" + DateTime.Now.ToString("yyMMddHHmm");
            }

            string defaultPath = this.settingsService.DefaultProjectsPath;

            //// if we are already in the solution disable project name and path.
            this.solutionAlreadyCreated = this.visualStudioService.SolutionAlreadyCreated;

            if (this.solutionAlreadyCreated)
            {
                TraceService.WriteLine("Solution already created");

                this.Path = visualStudioService.SolutionService.GetParentDirectoryName();
            }
            else
            {
                this.Path = string.IsNullOrEmpty(defaultPath) == false
                                ? defaultPath
                                : visualStudioService.DTEService.GetDefaultProjectsLocation();
            }

            TraceService.WriteLine("ProjectsViewModel::Constructor End");
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectsFinishedViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="visualStudioService">The visual studio service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="tinyMessengerHub">The tiny messenger hub.</param>
 public ProjectsFinishedViewModel(
     ISettingsService settingsService,
     IVisualStudioService visualStudioService,
     IProjectFactory projectFactory,
     ICachingService cachingService,
     ITinyMessengerHub tinyMessengerHub)
 {
     this.settingsService     = settingsService;
     this.visualStudioService = visualStudioService;
     this.projectFactory      = projectFactory;
     this.cachingService      = cachingService;
     this.tinyMessengerHub    = tinyMessengerHub;
     this.Init();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationSamplesOptionsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 public ApplicationSamplesOptionsViewModel(
     ISettingsService settingsService,
     ICachingService cachingService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
     : base(settingsService,
      pluginsService,
      projectFactory,
      pluginFactory)
 {
     this.settingsService = settingsService;
     this.cachingService = cachingService;
 }
Example #17
0
 public PredictionsManager(
     INextBusClient nextBusClient,
     ICachingService cachingService,
     ILocationsManager locationsManager,
     BusVbotDbContext dbContext,
     IAgencyServiceAccessor agencyServiceAccessor
     )
 {
     _nextBusClient         = nextBusClient;
     _cachingService        = cachingService;
     _locationsManager      = locationsManager;
     _dbContext             = dbContext;
     _agencyServiceAccessor = agencyServiceAccessor;
 }
Example #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomRendererViewModel" /> class.
 /// </summary>
 /// <param name="messageBoxService">The message box service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="translator">The translator.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="customRendererFactory">The custom renderer factory.</param>
 public CustomRendererViewModel(
     IMessageBoxService messageBoxService,
     ISettingsService settingsService,
     ITranslator <string, CustomRenderers> translator,
     ICachingService cachingService,
     ICustomRendererFactory customRendererFactory)
 {
     this.messageBoxService     = messageBoxService;
     this.settingsService       = settingsService;
     this.translator            = translator;
     this.cachingService        = cachingService;
     this.customRendererFactory = customRendererFactory;
     this.Init();
 }
Example #19
0
        public CinemaService(
            ILocalSettingsService applicationSettingsService,
            IApiClient apiClient,
            ICachingService <List <Cinema> > cinemaCache,
            ILocalStorageService storageService)
        {
            _applicationSettingsService = applicationSettingsService;
            _apiClient      = apiClient;
            _cinemaCache    = cinemaCache;
            _storageService = storageService;

            _cinemaCache.Initialise(LoadCinemasFromFileOrApi);

            LoadCinema();
        }
Example #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationOptionsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="projectFactory">The project factory.</param>
 public ApplicationOptionsViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IPluginFactory pluginFactory,
     ICachingService cachingService,
     IProjectFactory projectFactory)
     : base(
         settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.settingsService = settingsService;
     this.cachingService  = cachingService;
 }
 public OperateLogService(
     IRepository <OperateLogSetting> logSettingRepository,
     IRepository <OperateLogDetail> logDetailRepository,
     ICachingService <OperateLogSetting> logSettingCache,
     SystemIdentityDbUnitOfWork unitOfWork,
     IMapper mapper,
     ILogger <OperateLogService> logger)
 {
     _logSettingRepository = logSettingRepository;
     _logDetailRepository  = logDetailRepository;
     _logSettingCache      = logSettingCache;
     _unitOfWork           = unitOfWork;
     _mapper = mapper;
     _logger = logger;
 }
Example #22
0
        private void InitConfiguredPlugins(string moduleKey, string configFile, ICachingService cachingService)
        {
            //Init the kraft module configurations model
            ModuleSettings = new KraftModuleConfigurationSettings(_DependencyInjectionContainer, cachingService, _KraftGlobalConfigurationSettings);

            //read the module configuration
            IConfigurationBuilder configbuilder = new ConfigurationBuilder();

            configbuilder.SetBasePath(Path.GetDirectoryName(configFile)).AddJsonFile(configFile);
            IConfigurationRoot configurationRoot = configbuilder.Build();

            configurationRoot.Bind("KraftModuleConfigurationSettings", ModuleSettings);

            ModuleSettings.LoadDefinedObjects(moduleKey, configFile);
        }
 public PrivateCommunitiesLeadAdapterProvider(int accountId, int leadAdapterAndAccountMapID, ILeadAdaptersRepository leadAdaptersRepository, IServiceProviderRepository serviceProviderRepository,
                                              IImportDataRepository importDataRepository, ISearchService <Contact> searchService, IUnitOfWork unitOfWork,
                                              ICustomFieldService customFieldService, ICachingService cacheService, ICommunicationService communicationService, IMailGunService mailGunService, IContactService contactService)
     : base(accountId, leadAdapterAndAccountMapID, LeadAdapterTypes.BDX, leadAdaptersRepository, importDataRepository, searchService, unitOfWork,
            customFieldService, cacheService, serviceProviderRepository, mailGunService, contactService)
 {
     this.mailGunService            = mailGunService;
     this.searchService             = searchService;
     this.contactService            = contactService;
     this.cacheService              = cacheService;
     this.leadAdaptersRepository    = leadAdaptersRepository;
     this.serviceProviderRepository = serviceProviderRepository;
     this.customFieldService        = customFieldService;
     this.importDataRepository      = importDataRepository;
 }
Example #24
0
        public RaumFeldService(IEventAggregator eventAggregatorInstance, IMessagingService messagingServiceInstance, ICachingService cachingServiceInstance)
        {
            eventAggregator  = eventAggregatorInstance;
            messagingService = messagingServiceInstance;
            cachingService   = cachingServiceInstance;
            //shellViewModel = shellViewModelInstance;

            semaphoreLock = new SemaphoreSlim(1);

            devices = new Dictionary <string, IMediaDevice>();

            eventAggregator.GetEvent <NetWorkDeviceAddedEvent>().Subscribe(onDeviceAdded, ThreadOption.UIThread);
            eventAggregator.GetEvent <NetWorkDeviceUpdatedEvent>().Subscribe(onDeviceUpdated, ThreadOption.UIThread);
            eventAggregator.GetEvent <NetWorkDeviceRemovedEvent>().Subscribe(onDeviceRemoved, ThreadOption.UIThread);
        }
 public ContactRelationshipService(IContactRelationshipRepository contactRelationshipRepository, ICachingService cachingService,
                                   IUnitOfWork unitOfWork, IAccountService accountService)
 {
     if (contactRelationshipRepository == null)
     {
         throw new ArgumentNullException("contactRelationshipRepository");
     }
     if (unitOfWork == null)
     {
         throw new ArgumentNullException("unitOfWork");
     }
     this.contactRelationshipRepository = contactRelationshipRepository;
     this.cachingService = cachingService;
     this.unitOfWork     = unitOfWork;
     this.accountService = accountService;
 }
Example #26
0
 /// <inheritdoc />
 public PostsController(
     IPostService postService,
     ILikeService likeService,
     IEncryptionService encryptionService,
     IMapper mapper,
     ICachingService cachingService,
     IProcessingService processingService,
     DbContext context) : base(mapper)
 {
     _postService       = postService;
     _likeService       = likeService;
     _encryptionService = encryptionService;
     _context           = context;
     _cachingService    = cachingService;
     _processingService = processingService;
 }
Example #27
0
        public void ConstructResources(ICachingService cachingService, string rootPath, string startDepFile, bool isScript)
        {
            if (isScript)
            {
                //process Scripts folder
                ScriptKraftBundle = ConstructScriptsBundle(rootPath, Path.Combine(ModulePath, JS_FOLDER_NAME), startDepFile);

                //process Template folder
                TemplateKraftBundle = ConstructTmplResBundle(rootPath, Path.Combine(ModulePath, TEMPLATES_FOLDER_NAME));
            }
            else
            {
                //process CSS folder
                StyleKraftBundle = ConstructStyleBundle(rootPath, Path.Combine(ModulePath, CSS_FOLDER_NAME), startDepFile);
            }
        }
Example #28
0
 public ImportLeadProcessor(CronJobDb cronJob, JobService jobService, string importProcessorCacheName)
     : base(cronJob, jobService, importProcessorCacheName)
 {
     leadAdaptersRepository‏   = IoC.Container.GetInstance <ILeadAdaptersRepository‏>();
     serviceProviderRepository = IoC.Container.GetInstance <IServiceProviderRepository>();
     importDataRepository      = IoC.Container.GetInstance <IImportDataRepository>();
     searchService             = IoC.Container.GetInstance <ISearchService <Contact> >();
     customFieldService        = IoC.Container.GetInstance <ICustomFieldService>();
     suppressionListService    = IoC.Container.GetInstance <ISuppressionListService>();
     suppressionListRepository = IoC.Container.GetInstance <ISuppressionListRepository>();
     cahceService          = IoC.Container.GetInstance <ICachingService>();
     communicationService  = IoC.Container.GetInstance <ICommunicationService>();
     mailGunService        = IoC.Container.GetInstance <IMailGunService>();
     contactService        = IoC.Container.GetInstance <IContactService>();
     unitofWork            = IoC.Container.GetInstance <IUnitOfWork>();
     dropdownValuesService = IoC.Container.GetInstance <IDropdownValuesService>();
 }
Example #29
0
 public FacebookLeadAdapterProvider(int accountId, int leadAdapterAndAccountMapID, ILeadAdaptersRepository leadAdaptersRepository, IServiceProviderRepository serviceProviderRepository,
                                    IImportDataRepository importDataRepository, ISearchService <Contact> searchService, IUnitOfWork unitOfWork,
                                    ICustomFieldService customFieldService, ICachingService cacheService, ICommunicationService communicationService, IMailGunService mailGunService, IContactService contactService, IAccountRepository accRepository)
     : base(accountId, leadAdapterAndAccountMapID, LeadAdapterTypes.BDX, leadAdaptersRepository, importDataRepository, searchService, unitOfWork,
            customFieldService, cacheService, serviceProviderRepository, mailGunService, contactService)
 {
     Logger.Current.Verbose("Enter into Facebook LeadAdapterProvider");
     this.mailGunService            = mailGunService;
     this.searchService             = searchService;
     this.contactService            = contactService;
     this.leadAdaptersRepository    = leadAdaptersRepository;
     this.importDataRepository      = importDataRepository;
     this.accountRepository         = accRepository;
     this.cacheService              = cacheService;
     this.customFieldService        = customFieldService;
     this.serviceProviderRepository = serviceProviderRepository;
 }
        public OutlookBarViewModel(
            IWorkspaceService workspaceService,
            IEventAggregator eventAggregator,
            ICachingService cachingService,
            IStatusBarMessageQueue statusBarMessageQueue,
            IOutlookBarItemViewModelFactory modelFactory,
            ISearchViewModel searchViewModel)
        {
            _workspaceService      = workspaceService;
            _eventAggregator       = eventAggregator;
            _cachingService        = cachingService;
            _statusBarMessageQueue = statusBarMessageQueue;
            _modelFactory          = modelFactory;
            _searchViewModel       = searchViewModel;

            Initialize();
        }
 /// <summary>
 /// ctor the Mighty
 /// </summary>
 public DefaultRecipeService(IBrewgrRepository repository, ICachingService cachingService, IUserResolver userResolver,
                             IRecipeDataService recipeDataService, IBeerStyleService beerStyleService, IPartnerIdResolver partnerIdResolver, IPartnerService partnerService,
                             IIngredientCategorizer ingredientCategorizer, IDataContextActivationInfo <BrewgrContext> dataContextActivationInfo, IUserService userService,
                             ISendToShopService sendToShopService)
 {
     this.Repository                = repository;
     this.CachingService            = cachingService;
     this.UserResolver              = userResolver;
     this.RecipeDataService         = recipeDataService;
     this.BeerStyleService          = beerStyleService;
     this.PartnerIdResolver         = partnerIdResolver;
     this.PartnerService            = partnerService;
     this.IngredientCategorizer     = ingredientCategorizer;
     this.DataContextActivationInfo = dataContextActivationInfo;
     this.UserService               = userService;
     this.SendToShopService         = sendToShopService;
 }
 /// <summary>
 /// Parametrized c'tor with variable services
 /// </summary>
 /// <param name="requestService">Reference to the request service</param>
 /// <param name="requestParameterService">refernece to the request paramter service</param>
 /// <param name="mappingService">reference to a mapping service</param>
 /// <param name="geolocationMappingService">Reference to a geolocation mapping service</param>
 /// <param name="cachingService">Reference to a caching service</param>
 /// <param name="serializationService">Reference to a serialization service</param>
 /// <param name="threadService">Reference to a thread service</param>
 public PredefinedServiceFacade(
     IRequestService requestService,
     IRequestParameterService requestParameterService,
     IMappingService mappingService,
     IGeolocationMappingService geolocationMappingService,
     ICachingService cachingService,
     ISerializationService serializationService,
     IThreadService threadService)
 {
     RequestParameterService   = requestParameterService;
     RequestService            = requestService;
     MappingService            = mappingService;
     GeolocationMappingService = geolocationMappingService;
     CachingService            = cachingService;
     SerializationService      = serializationService;
     ThreadService             = threadService;
 }
Example #33
0
        static void Main(string[] args)
        {
            // Glue together the system.
            ContainerBuilder builder = new ContainerBuilder();

            // Singletons
            builder.RegisterType <ConsoleLogger>().As <ILogger>().SingleInstance();
            builder.RegisterType <EventBus>().As <IEventBus>().SingleInstance();

            // Per request.
            builder.RegisterType <CachingService>().As <ICachingService>();
            builder.RegisterType <DownloadService>().As <IDownloadService>();
            builder.RegisterType <DownloaderClient>().As <IDownloaderClient>();
            builder.RegisterType <DownloadItemRepository>().As <IDownloadItemRepository>();

            // Get the relevant parts.
            IContainer      container      = builder.Build();
            ILogger         logger         = container.Resolve <ILogger>();
            ICachingService cachingService = container.Resolve <ICachingService>();
            IEventBus       eventBus       = container.Resolve <IEventBus>();
            Func <IDownloadItemRepository> createDownloadRepository = container.Resolve <Func <IDownloadItemRepository> >();

            ServiceHost queueHost = new ServiceHost(typeof(DownloadService));

            if (!MessageQueue.Exists(@".\private$\DownloadService"))
            {
                MessageQueue.Create(@".\private$\DownloadService", true);
            }
            queueHost.AddDependencyInjectionBehavior <IDownloadService>(container);
            queueHost.Open();

            ServiceHost host = new ServiceHost(typeof(CachingService));

            host.AddDependencyInjectionBehavior <ICachingService>(container);
            host.Description.Behaviors.Add(new ServiceMetadataBehavior {
                HttpGetEnabled = true, HttpGetUrl = new Uri("http://localhost:8080/WebDownloaderService")
            });
            host.Open();

            Console.WriteLine("The host has been opened.");
            Console.ReadLine();

            host.Close();
            queueHost.Close();
            Environment.Exit(0);
        }
Example #34
0
 public LeadProcessor(CronJobDb cronJob, JobService jobService, string leadProcessorCacheName)
     : base(cronJob, jobService, leadProcessorCacheName)
 {
     leadAdaptersRepository‏   = IoC.Container.GetInstance <ILeadAdaptersRepository‏>();
     contactRepository         = IoC.Container.GetInstance <IContactRepository>();
     serviceProviderRepository = IoC.Container.GetInstance <IServiceProviderRepository>();
     importDataRepository      = IoC.Container.GetInstance <IImportDataRepository>();
     searchService             = IoC.Container.GetInstance <ISearchService <Contact> >();
     tagService           = IoC.Container.GetInstance <ITagService>();
     customFieldService   = IoC.Container.GetInstance <ICustomFieldService>();
     cahceService         = IoC.Container.GetInstance <ICachingService>();
     communicationService = IoC.Container.GetInstance <ICommunicationService>();
     unitOfWork           = IoC.Container.GetInstance <IUnitOfWork>();
     mailGunService       = IoC.Container.GetInstance <IMailGunService>();
     contactService       = IoC.Container.GetInstance <IContactService>();
     accountRepository    = IoC.Container.GetInstance <IAccountRepository>();
 }
Example #35
0
 public AutomationEngine(ICachingService cachingService, IIndexingService indexingService,
                         IAdvancedSearchService advancedSearchService, IContactService contactService, IWorkflowService workflowService,
                         IAccountService accountService, ITagService tagService, ICampaignService campaignService, ILeadScoreService leadScoreService,
                         IPublishSubscribeService pubSubService, IOpportunitiesService opportunityService, ICommunicationService communicationService)
 {
     this.cachingService        = cachingService;
     this.indexingService       = indexingService;
     this.advancedSearchService = advancedSearchService;
     this.contactService        = contactService;
     this.workflowService       = workflowService;
     this.accountService        = accountService;
     this.tagService            = tagService;
     this.campaignService       = campaignService;
     this.leadScoreService      = leadScoreService;
     this.pubSubService         = pubSubService;
     this.communicationService  = communicationService;
     this.opportunityService    = opportunityService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NugetPackagesViewModel" /> class.
 /// </summary>
 /// <param name="applicationService">The application service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 /// <param name="cachingService">The caching service.</param>
 public NugetPackagesViewModel(
     IApplicationService applicationService,
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory,
     ICachingService cachingService)
     : base(
         settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.applicationService = applicationService;
     this.settingsService    = settingsService;
     this.pluginFactory      = pluginFactory;
     this.cachingService     = cachingService;
 }
Example #37
0
 /// <inheritdoc />
 public CharactersController(
     ICharacterService characterService,
     ICharacterFacadeService characterFacadeService,
     IPostService postService,
     IProcessingService processingService,
     DbContext dbContext,
     ICachingService cachingService,
     ISuggestedEditService suggestedEditService,
     IMapper mapper) : base(mapper)
 {
     _characterService       = characterService;
     _dbContext              = dbContext;
     _cachingService         = cachingService;
     _postService            = postService;
     _processingService      = processingService;
     _characterFacadeService = characterFacadeService;
     _suggestedEditService   = suggestedEditService;
 }
Example #38
0
        public void ConstructResources(ICachingService cachingService, KraftGlobalConfigurationSettings kraftGlobalConfigurationSettings, string startDepFile, bool isScript)
        {
            if (IsInitialized)//This is not a module with proper configuration files
            {
                if (isScript)
                {
                    //process Scripts folder
                    ScriptKraftBundle = ConstructScriptsBundle(kraftGlobalConfigurationSettings, Path.Combine(_ModulePath, JS_FOLDER_NAME), startDepFile);

                    //process Template folder
                    TemplateKraftBundle = ConstructTmplResBundle(kraftGlobalConfigurationSettings, Path.Combine(_ModulePath, TEMPLATES_FOLDER_NAME));
                }
                else
                {
                    //process CSS folder
                    StyleKraftBundle = ConstructStyleBundle(kraftGlobalConfigurationSettings, Path.Combine(_ModulePath, CSS_FOLDER_NAME), startDepFile);
                }
            }
        }
 public BaseLeadAdapterProvider(int accountId, int leadAdapterAndAccountMapID, LeadAdapterTypes leadAdapterType
                                , ILeadAdaptersRepository leadAdaptersRepository, IImportDataRepository importDataRepository, ISearchService <Contact> searchService,
                                IUnitOfWork unitOfWork, ICustomFieldService customFieldService, ICachingService cacheService, IServiceProviderRepository serviceProviderRepository, IMailGunService mailGunService,
                                IContactService contactService)
 {
     this.AccountID  = accountId;
     this.repository = leadAdaptersRepository;
     this.serviceProviderRepository = serviceProviderRepository;
     this.importDataRepository      = importDataRepository;
     this.customFieldService        = customFieldService;
     this.unitOfWork          = unitOfWork;
     this.mailGunService      = mailGunService;
     this.contactService      = contactService;
     this.leadAdapterType     = leadAdapterType;
     this.cacheService        = cacheService;
     LeadAdapterAccountMapID  = leadAdapterAndAccountMapID;
     leadAdapterAndAccountMap = repository.GetLeadAdapterByID(LeadAdapterAccountMapID);
     _fieldMappings           = GetFieldMappings();
 }
Example #40
0
 public OpportunityService(IOpportunityRepository opportunityRepository, IContactService contactService,
                           IUnitOfWork unitOfWork, ICachingService cachingService,
                           IIndexingService indexingService, ITagRepository tagRepository,
                           ISearchService <Opportunity> searchService, IUserRepository userRepository,
                           IContactRepository contactRepository, IMessageService messageService, IImageService imageService, IUrlService urlService)
 {
     this.opportunityRepository = opportunityRepository;
     this.unitOfWork            = unitOfWork;
     this.indexingService       = indexingService;
     this.cachingService        = cachingService;
     this.contactService        = contactService;
     this.searchService         = searchService;
     this.messageService        = messageService;
     this.tagRepository         = tagRepository;
     this.userRepository        = userRepository;
     this.contactRepository     = contactRepository;
     this.imageService          = imageService;
     this.urlService            = urlService;
 }
Example #41
0
 /// <inheritdoc />
 public GamesController(
     IGameService gameService,
     IStageService stageService,
     ICharacterService characterService,
     ICachingService cachingService,
     IEncryptionService encryptionService,
     IPostService postService,
     IProcessingService processingService,
     IMapper mapper) : base(mapper)
 {
     _gameService       = gameService;
     _characterService  = characterService;
     _stageService      = stageService;
     _characterService  = characterService;
     _cachingService    = cachingService;
     _encryptionService = encryptionService;
     _postService       = postService;
     _processingService = processingService;
 }
Example #42
0
        private void InitConfiguredPlugins(string moduleKey, string configFile, ICachingService cachingService)
        {
            if (!File.Exists(configFile))
            {
                throw new FileNotFoundException($"The {configFile} file was not found!");
            }

            //Init the kraft module configurations model
            ModuleSettings = new KraftModuleConfigurationSettings(_DependencyInjectionContainer, cachingService);

            //read the module configuration
            IConfigurationBuilder configbuilder = new ConfigurationBuilder();

            configbuilder.SetBasePath(Path.GetDirectoryName(configFile)).AddJsonFile(configFile);
            IConfigurationRoot configurationRoot = configbuilder.Build();

            configurationRoot.Bind("KraftModuleConfigurationSettings", ModuleSettings);

            ModuleSettings.LoadDefinedObjects(moduleKey, configFile);
        }
Example #43
0
        public static List <TopMenuPermissions> CheckPermission(List <AppModules> modules)
        {
            ICachingService           cachingService   = IoC.Container.GetInstance <ICachingService>();
            var                       usersPermissions = cachingService.GetUserPermissions(Thread.CurrentPrincipal.Identity.ToAccountID());
            List <byte>               userModules      = usersPermissions.Where(s => s.RoleId == (short)Thread.CurrentPrincipal.Identity.ToRoleID()).Select(s => s.ModuleId).ToList();
            List <TopMenuPermissions> Permissions      = new List <TopMenuPermissions>();

            foreach (AppModules appModule in modules)
            {
                if (userModules.Contains((byte)appModule))
                {
                    Permissions.Add(new TopMenuPermissions()
                    {
                        HasPermission = true,
                        Module        = appModule
                    });
                }
            }
            return(Permissions);
        }
Example #44
0
        public async Task <IProcessingContext> ExecuteAsync(LoadedNodeSet loaderContext, IProcessingContext processingContext, IPluginServiceManager pluginServiceManager, IPluginsSynchronizeContextScoped contextScoped, INode currentNode)
        {
            if (currentNode is View view)
            {
                string          cachedView     = null;
                string          cacheKey       = null;
                ICachingService cachingService = null;
                if (processingContext.InputModel.KraftGlobalConfigurationSettings.GeneralSettings.EnableOptimization)
                {
                    cacheKey       = processingContext.InputModel.Module + processingContext.InputModel.NodeSet + processingContext.InputModel.Nodepath + view.BindingKey + "_View";
                    cachingService = pluginServiceManager.GetService <ICachingService>(typeof(ICachingService));
                    cachedView     = cachingService.Get <string>(cacheKey);
                }
                if (cachedView == null)
                {
                    string directoryPath = Path.Combine(
                        processingContext.InputModel.KraftGlobalConfigurationSettings.GeneralSettings.ModulesRootFolder(processingContext.InputModel.Module),
                        processingContext.InputModel.Module,
                        "Views");

                    PhysicalFileProvider fileProvider = new PhysicalFileProvider(directoryPath);
                    cachedView = File.ReadAllText(Path.Combine(directoryPath, view.Settings.Path));
                    if (processingContext.InputModel.KraftGlobalConfigurationSettings.GeneralSettings.EnableOptimization)
                    {
                        cachingService.Insert(cacheKey, cachedView, fileProvider.Watch(view.Settings.Path));
                    }
                }
                IResourceModel resourceModel = new ResourceModel();
                resourceModel.Content = cachedView;
                resourceModel.SId     = $"node/view/{processingContext.InputModel.Module}/{processingContext.InputModel.NodeSet}/{processingContext.InputModel.Nodepath}/{view.BindingKey}";
                processingContext.ReturnModel.Views.Add(view.BindingKey, resourceModel);
            }
            else
            {
                processingContext.ReturnModel.Status.StatusResults.Add(new StatusResult {
                    StatusResultType = EStatusResult.StatusResultError, Message = "Current node is null or not OfType(View)"
                });
                throw new InvalidDataException("HtmlViewSynchronizeContextLocalImp.CurrentNode is null or not OfType(View)");
            }
            return(await Task.FromResult(processingContext));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NugetPackagesViewModel" /> class.
 /// </summary>
 /// <param name="applicationService">The application service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 /// <param name="cachingService">The caching service.</param>
 public NugetPackagesViewModel(
     IApplicationService applicationService,
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory,
     ICachingService cachingService)
     : base(settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.applicationService = applicationService;
     this.settingsService = settingsService;
     this.pluginFactory = pluginFactory;
     this.cachingService = cachingService;
 }
		/// <summary>
		/// Clears the given <paramref name="record"/> from the <paramref name="cachingService"/>.
		/// </summary>
		/// <param name="record">The <see cref="Record"/> which should be cleared from the cache.</param>
		/// <param name="context">The <see cref="IMansionContext"/>.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>.</param>
		/// <exception cref="ArgumentNullException">Thrown if one of the parameters is null.</exception>
		public static void ClearFromCache(this Record record, IMansionContext context, ICachingService cachingService)
		{
			// validate arguments
			if (record == null)
				throw new ArgumentNullException("record");
			if (context == null)
				throw new ArgumentNullException("context");
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// fire the evict by ID
			cachingService.Clear(record.CalculateIdCacheKey());

			// fire the evict by tree ID, if any
			NodePointer pointer;
			if (record.TryGet(context, "pointer", out pointer))
			{
				foreach (var treeCacheKey in pointer.CalculateTreeIdCacheKeys())
					cachingService.Clear(treeCacheKey);
			}

			// fire the repository modified
			cachingService.Clear(CachingRepositoryDecorator.RepositoryModifiedDependency.Key);
		}
		/// <summary>
		/// Clears the given <paramref name="node"/> from the <paramref name="cachingService"/>.
		/// </summary>
		/// <param name="node">The <see cref="Node"/> which should be cleared from the cache.</param>
		/// <param name="cachingService">The <see cref="ICachingService"/>.</param>
		/// <exception cref="ArgumentNullException">Thrown if one of the parameters is null.</exception>
		public static void ClearFromCache(this Node node, ICachingService cachingService)
		{
			// validate arguments
			if (node == null)
				throw new ArgumentNullException("node");
			if (cachingService == null)
				throw new ArgumentNullException("cachingService");

			// fire the evict by ID
			cachingService.Clear(node.CalculateIdCacheKey());

			// fire the evict by tree ID
			foreach (var treeCacheKey in node.Pointer.CalculateTreeIdCacheKeys())
				cachingService.Clear(treeCacheKey);

			// fire the repository modified
			cachingService.Clear(CachingRepositoryDecorator.RepositoryModifiedDependency.Key);
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectsController" /> class.
        /// </summary>
        /// <param name="projectsService">The projects service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="resolverService">The resolver service.</param>
        /// <param name="viewModelViewsService">The view model views service.</param>
        /// <param name="readMeService">The read me service.</param>
        /// <param name="projectFactory">The project factory.</param>
        /// <param name="applicationService">The application service.</param>
        /// <param name="cachingService">The caching service.</param>
        public ProjectsController(
            IProjectsService projectsService,
            INugetService nugetService,
            IVisualStudioService visualStudioService,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            IResolverService resolverService,
            IViewModelViewsService viewModelViewsService,
            IReadMeService readMeService,
            IProjectFactory projectFactory,
            IApplicationService applicationService,
            ICachingService cachingService)
            : base(visualStudioService, settingsService, messageBoxService, resolverService, readMeService)
        {
            TraceService.WriteLine("ProjectsController::Constructor");

            this.projectsService = projectsService;
            this.nugetService = nugetService;
            this.viewModelViewsService = viewModelViewsService;
            this.projectFactory = projectFactory;
            this.applicationService = applicationService;
            this.cachingService = cachingService;

            this.commands = string.Empty;
            this.postNugetCommands = new List<StudioCommand>();
            this.postNugetFileOperations = new List<FileOperation>();

            this.messages = new List<string>();
        }
		/// <summary>
		/// ctor the Mighty
		/// </summary>
		public DefaultBeerStyleService(IBrewgrRepository repository, ICachingService cachingService, IWebSettings webSettings)
		{
			this.Repository = repository;
			this.CachingService = cachingService;
			this.WebSettings = webSettings;
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectsFinishedViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="visualStudioService">The visual studio service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="tinyMessengerHub">The tiny messenger hub.</param>
 public ProjectsFinishedViewModel(
     ISettingsService settingsService,
     IVisualStudioService visualStudioService,
     IProjectFactory projectFactory,
     ICachingService cachingService,
     ITinyMessengerHub tinyMessengerHub)
 {
     this.settingsService = settingsService;
     this.visualStudioService = visualStudioService;
     this.projectFactory = projectFactory;
     this.cachingService = cachingService;
     this.tinyMessengerHub = tinyMessengerHub;
     this.Init();
 }
 public TagController(ITagTasks tagTasks, ICachingService cachingService)
 {
     this.tagTasks = tagTasks;
     this.cachingService = cachingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomRendererFinishedViewModel"/> class.
 /// </summary>
 /// <param name="cachingService">The caching service.</param>
 public CustomRendererFinishedViewModel(ICachingService cachingService)
 {
     this.cachingService = cachingService;
 }
Example #53
0
 public void Init()
 {
     _cachingService = new CachingService();
     _cachingService.DeleteAll();
 }
		/// <summary>
		/// ctor the Mighty
		/// </summary>
		public DefaultContentService(IBrewgrRepository repository, ICachingService cachingService)
		{
			this.Repository = repository;
			this.CachingService = cachingService;
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="DependencyServiceViewModel" /> class.
 /// </summary>
 /// <param name="messageBoxService">The message box service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="dependencyServicesFactory">The dependency services factory.</param>
 public DependencyServiceViewModel(
     IMessageBoxService messageBoxService,
     ISettingsService settingsService,
     ICachingService cachingService,
     IDependencyServicesFactory dependencyServicesFactory)
 {
     this.messageBoxService = messageBoxService;
     this.settingsService = settingsService;
     this.cachingService = cachingService;
     this.dependencyServicesFactory = dependencyServicesFactory;
     this.Init();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomRendererViewModel" /> class.
 /// </summary>
 /// <param name="messageBoxService">The message box service.</param>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="translator">The translator.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="customRendererFactory">The custom renderer factory.</param>
 public CustomRendererViewModel(
     IMessageBoxService messageBoxService,
     ISettingsService settingsService,
     ITranslator<string, CustomRenderers> translator,
     ICachingService cachingService,
     ICustomRendererFactory customRendererFactory)
 {
     this.messageBoxService = messageBoxService;
     this.settingsService = settingsService;
     this.translator = translator;
     this.cachingService = cachingService;
     this.customRendererFactory = customRendererFactory;
     this.Init();
 }
 /// <summary>
 /// Parametrized c'tor with variable services
 /// </summary>
 /// <param name="requestService">Reference to the request service</param>
 /// <param name="requestParameterService">refernece to the request paramter service</param>
 /// <param name="mappingService">reference to a mapping service</param>
 /// <param name="geolocationMappingService">Reference to a geolocation mapping service</param>
 /// <param name="cachingService">Reference to a caching service</param>
 /// <param name="serializationService">Reference to a serialization service</param>
 /// <param name="threadService">Reference to a thread service</param>
 /// <param name="mailService">Reference to Mail Service</param>
 public PredefinedServiceFacade(
     IRequestService requestService,
     IRequestParameterService requestParameterService,
     IMappingService mappingService,
     IGeolocationMappingService geolocationMappingService,
     ICachingService cachingService,
     ISerializationService serializationService,
     IThreadService threadService,
     IMailService mailService)
 {
     RequestParameterService = requestParameterService;
     RequestService = requestService;
     MappingService = mappingService;
     GeolocationMappingService = geolocationMappingService;
     CachingService = cachingService;
     SerializationService = serializationService;
     ThreadService = threadService;
     MailService = mailService;
 }
Example #58
0
 public PageCacheFilterAttribute()
 {
     _cachingService = Context.Current.Resolve<ICachingService>();
     Order = 0;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EffectFinishedViewModel"/> class.
 /// </summary>
 /// <param name="cachingService">The caching service.</param>
 public EffectFinishedViewModel(ICachingService cachingService)
 {
     this.cachingService = cachingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DependencyServiceFinishedViewModel"/> class.
 /// </summary>
 /// <param name="cachingService">The caching service.</param>
 public DependencyServiceFinishedViewModel(ICachingService cachingService)
 {
     this.cachingService = cachingService;
 }