public BitmapImage LoadAndGetBitmapImage(IApplicationConfiguration configuration, string filename)
        {
            string      fullFilename = configuration.FingerprintDirectory + filename + configuration.FileExtension;
            BitmapImage image        = new BitmapImage(new Uri(fullFilename));

            return(image);
        }
Esempio n. 2
0
        public bool Start()
        {
            Logger.Info(m => m("Запуск приложения."));
            Logger.Debug(m => m("Для загрузки указаны компоненты из директорий: {0}", string.Join(";", this.componentPaths)));

            try
            {
                this.configuration = this.applicationConfigurationFactory.CreateApplicationConfiguration(this.componentPaths);

                this.configuration.ComponentManager.LoadComponents(this.configuration);
            }
            catch (ReflectionTypeLoadException exception)
            {
                if (exception.LoaderExceptions != null)
                {
                    foreach (var loaderException in exception.LoaderExceptions)
                    {
                        var currentException = loaderException;
                        Logger.Fatal(m => m("Ошибка загрузки типа"), currentException);
                    }
                }

                Logger.Fatal(m => m("При запуске приложения произошла ошибка."), exception);
                throw;
            }
            catch (Exception exception)
            {
                Logger.Fatal(m => m("При запуске приложения произошла ошибка."), exception);
                throw;
            }

            return(true);
        }
Esempio n. 3
0
 public ReloadRelatedItemTask(
     IApplicationConfiguration applicationConfiguration,
     IContentLoader contentLoader,
     IDialogCreator dialogCreator,
     IRelatedItemSerializer relatedItemSerializer,
     IMoBiContext context,
     ICloneManagerForBuildingBlock cloneManagerForBuildingBlock,
     IBuildingBlockTaskRetriever taskRetriever,
     IPKSimExportTask pkSimExportTask,
     ISimulationLoader simulationLoader,
     IObservedDataTask observedDataTask,
     IObjectIdResetter objectIdResetter,
     IParameterIdentificationTask parameterIdentificationTask,
     ISensitivityAnalysisTask sensitivityAnalysisTask
     ) : base(applicationConfiguration, contentLoader, dialogCreator)
 {
     _relatedItemSerializer = relatedItemSerializer;
     _context = context;
     _cloneManagerForBuildingBlock = cloneManagerForBuildingBlock;
     _taskRetriever               = taskRetriever;
     _pkSimExportTask             = pkSimExportTask;
     _simulationLoader            = simulationLoader;
     _observedDataTask            = observedDataTask;
     _objectIdResetter            = objectIdResetter;
     _parameterIdentificationTask = parameterIdentificationTask;
     _sensitivityAnalysisTask     = sensitivityAnalysisTask;
 }
 public YandexMeanFinder(
     IApplicationConfiguration applicationConfiguration,
     IRestClient restClient)
 {
     _applicationConfiguration = applicationConfiguration;
     _restClient = restClient;
 }
 public DasStatelessEndpointCommunicationListener(IConfigurationHelper configHelper, IApplicationConfiguration config, IPaymentLogger logger, ILifetimeScope lifetimeScope)
 {
     this.configHelper  = configHelper ?? throw new ArgumentNullException(nameof(configHelper));
     this.config        = config ?? throw new ArgumentNullException(nameof(config));
     this.logger        = logger ?? throw new ArgumentNullException(nameof(logger));
     this.lifetimeScope = lifetimeScope ?? throw new ArgumentNullException(nameof(lifetimeScope));
 }
        protected override void Context()
        {
            _dialogCreator               = A.Fake <IDialogCreator>();
            _applicationConfiguration    = A.Fake <IApplicationConfiguration>();
            _contentLoader               = A.Fake <IContentLoader>();
            _mobiExportTask              = A.Fake <IMoBiExportTask>();
            _relatedItemSerializer       = A.Fake <IRelatedItemSerializer>();
            _observedDataTask            = A.Fake <IObservedDataTask>();
            _buildingBlockTask           = A.Fake <IBuildingBlockTask>();
            _objectIdResetter            = A.Fake <IObjectIdResetter>();
            _withIdRepository            = A.Fake <IWithIdRepository>();
            _parameterIdentificationTask = A.Fake <IParameterIdentificationTask>();
            _sensitivityAnalysisTask     = A.Fake <ISensitivityAnalysisTask>();

            sut = new ReloadRelatedItemTask(_applicationConfiguration, _contentLoader, _dialogCreator,
                                            _mobiExportTask, _relatedItemSerializer, _observedDataTask, _buildingBlockTask, _objectIdResetter, _withIdRepository, _parameterIdentificationTask, _sensitivityAnalysisTask);

            _relatedItem = new RelatedItem {
                FullPath = _fullPath, Content = new Content {
                    Data = new byte[] { 10, 20 }
                }
            };

            A.CallTo(() => _applicationConfiguration.Product).Returns(Origins.PKSim);
        }
Esempio n. 7
0
        public ShellContext(IApplicationConfiguration cfg)
        {
            this.cfg        = cfg;
            this.connection = cfg.Connection;
            this.mgr        = new PathManager(connection);
            this.commandee  = new Commandee(mgr);

            string server = connection.Home;

            ConnectionProvider pvd = null;

            if (!string.IsNullOrEmpty(server))
            {
                pvd = connection.GetProvider(server);
            }

            if (pvd != null)
            {
                theSide = new Side(pvd);
                ChangeSide(theSide);
            }
            else if (connection.Providers.Count() > 0)
            {
                theSide = new Side(connection.Providers.First());
                ChangeSide(theSide);
            }
            else
            {
                cerr.WriteLine("database server not defined");
            }
        }
Esempio n. 8
0
 public ReportingTask(IReportCreator reportCreator, IOSPSuiteTeXReporterRepository reporterRepository, IBuildTrackerFactory buildTrackerFactory, IApplicationConfiguration applicationConfiguration)
 {
     _reportCreator            = reportCreator;
     _reporterRepository       = reporterRepository;
     _buildTrackerFactory      = buildTrackerFactory;
     _applicationConfiguration = applicationConfiguration;
 }
Esempio n. 9
0
 public GrowlNotifications(IApplicationConfiguration applicationConfiguration, Notifications notifications)
 {
     InitializeComponent();
     _applicationConfiguration         = applicationConfiguration;
     Notifications                     = notifications;
     _notificationsControl.DataContext = Notifications;
 }
        public WebSecurity(
            IContextProvider contextService
            , IApplicationConfiguration configurationRepository
            , ApplicationUserManager userManager
            , ApplicationSignInManager signInManager
            )
        {
            _configurationRepository = configurationRepository;
            _userManager             = userManager;
            _signInManager           = signInManager;

            try
            {
                var dbContextAsync = DataContextFactory.GetDataContextAsync();
                dbContextAsync.GetDatabase().Initialize(true);

                if (_loggingService == null)
                {
                    _loggingService = Log4NetLoggingFactory.GetLogger();
                }

                _unitOfWorkAsync = new UnitOfWork(dbContextAsync, new RowAuthPoliciesContainer(_cachedUserAuthorizationGrantsProvider));
                // UserManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(_dbContextAsync as DbContext));
            }
            catch (Exception ex)
            {
                FetchLoggerAndLog(ex);
            }
        }
Esempio n. 11
0
 public EmployerDatabaseService(
     IApplicationConfiguration config,
     ILog logger)
     : base(config.EmployerConnectionString, logger)
 {
     _logger = logger;
 }
Esempio n. 12
0
        public KeyVaultAdminService(IOptionsSnapshot <AzureAdOptions> azureAdOptions,
                                    IOptionsSnapshot <AdminConfig> adminConfig,
                                    IOptionsSnapshot <ResourceIds> resources,
                                    IGraphHttpService graphHttpService,
                                    IApplicationConfiguration applicationConfiguration,
                                    IUser user,
                                    IHttpContextAccessor contextAccessor)
        {
            userId   = user.ObjectId;
            tenantId = Guid.Parse(user.TenantId);
            clientId = Guid.Parse(azureAdOptions.Value.ClientId);

            adalContext   = new AuthenticationContext($"{azureAdOptions.Value.AADInstance}{azureAdOptions.Value.TenantId}", new ADALSessionCache(userId, contextAccessor));
            resourceGroup = adminConfig.Value.ResourceGroup;

            kvManagmentClient = new KeyVaultManagementClient(new AutoRestCredential <KeyVaultManagementClient>(GetAppToken))
            {
                SubscriptionId = adminConfig.Value.SubscriptionId,
                BaseUri        = new Uri(adminConfig.Value.ArmInstance)
            };
            kvClient = new KeyVaultClient(new AutoRestCredential <KeyVaultClient>(GetAppTokenForKv));

            this.azureAdOptions           = azureAdOptions.Value;
            this.adminConfig              = adminConfig.Value;
            this.graphHttpService         = graphHttpService;
            this.applicationConfiguration = applicationConfiguration;
            this.resources = resources.Value;
        }
Esempio n. 13
0
        public bool Start()
        {
            Logger.Info(m => m("Starting application..."));
            Logger.Debug(m => m($"Specified directories for loadings components: {string.Join(";", this.componentPaths)}"));

            try
            {
                this.configuration = this.applicationConfigurationFactory.CreateApplicationConfiguration(this.componentPaths);

                this.configuration.ComponentManager.LoadComponents(this.configuration);
            }
            catch (ReflectionTypeLoadException exception)
            {
                if (exception.LoaderExceptions != null)
                {
                    foreach (var loaderException in exception.LoaderExceptions)
                    {
                        var currentException = loaderException;
                        Logger.Fatal(m => m("Type loading error"), currentException);
                    }
                }

                Logger.Fatal(m => m("Error during starting the application"), exception);
                throw;
            }
            catch (Exception exception)
            {
                Logger.Fatal(m => m("Error during starting the application"), exception);
                throw;
            }

            return(true);
        }
Esempio n. 14
0
        public async Task RemoveAccountAsync(IApplicationConfiguration appConfig, IAccount account)
        {
            string homeTenantId = account?.HomeAccountId?.TenantId;

            if (!string.IsNullOrEmpty(homeTenantId))
            {
                bool               isMsaAccount = IsConsumerTenantId(homeTenantId);
                IWamPlugin         wamPlugin    = isMsaAccount ? _msaPlugin : _aadPlugin;
                WebAccountProvider provider;
                if (isMsaAccount)
                {
                    provider = await _webAccountProviderFactory.GetAccountProviderAsync("consumers").ConfigureAwait(false);
                }
                else
                {
                    provider = await _webAccountProviderFactory.GetAccountProviderAsync("organizations")
                               .ConfigureAwait(false);
                }

                var webAccount = await FindWamAccountForMsalAccountAsync(provider, wamPlugin, account, null, appConfig.ClientId)
                                 .ConfigureAwait(false);

                _logger.Info("Found a webAccount? " + (webAccount != null));

                if (webAccount != null)
                {
                    await webAccount.SignOutAsync();
                }
            }
        }
Esempio n. 15
0
 public DrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient  = new RestClient(AppHarborBaseUrl);
     _writer      = writer;
 }
Esempio n. 16
0
 public EventsController(
     IRepository repository,
     IProcessedContentRepository processedContentRepository,
     EventEmailBuilder emailBuilder,
     IRssFeedFactory rssFeedFactory,
     ILogger <EventsController> logger,
     IApplicationConfiguration config,
     BusinessId businessId,
     IFilteredUrl filteredUrl,
     CalendarHelper helper,
     ITimeProvider timeProvider,
     IDateCalculator dateCalculator,
     IStockportApiEventsService stockportApiEventsService)
 {
     _repository = repository;
     _processedContentRepository = processedContentRepository;
     _emailBuilder              = emailBuilder;
     _rssFeedFactory            = rssFeedFactory;
     _logger                    = logger;
     _config                    = config;
     _businessId                = businessId;
     _filteredUrl               = filteredUrl;
     _helper                    = helper;
     _dateCalculator            = dateCalculator;
     _stockportApiEventsService = stockportApiEventsService;
 }
Esempio n. 17
0
        private static void CreateWcfLogger()
        {
            try
            {
                IContextProvider          contextService = null;
                IApplicationConfiguration configuration  = null;
                WcfAppenderService        loggingService = null;

                if (HttpContext.Current == null)
                {
                    contextService = DependencyResolver.Current.GetService <ThreadContextService>();
                }
                else
                {
                    contextService = DependencyResolver.Current.GetService <HttpContextProvider>();
                }

                configuration = DependencyResolver.Current.GetService <IApplicationConfiguration>();

                _mapper = DependencyResolver.Current.GetService <IMapper>();

                loggingService = new WcfAppenderService(configuration, _mapper);

                LoggingStorageFactory <WcfAppenderService> .CreateStorageContainer().Store(loggingService);
            }
            catch (Exception logEx)
            {
                throw new Exception(
                          "Exception while initializing and storing LoggingService instance into appropriate cache, detailed exc: " +
                          logEx);
            }
        }
        public static IServiceCollection AddInfrastructure(this IServiceCollection services,
                                                           IConfiguration configuration,
                                                           IApplicationConfiguration applicationConfiguration)
        {
            // Install Infrastructure services
            services.AddPersistence(configuration);
            services.AddHealthCheck(configuration);

            // Install modules
            services.AddScheduleModule();

            var emailConfig = configuration
                              .GetSection("EmailConfiguration")
                              .Get <EmailConfiguration>();

            services.AddSingleton(emailConfig);
            services.AddSingleton <IEmailSender, EmailSender>();
            services.AddSingleton(c => new RazorLightEngineBuilder()
                                  .UseEmbeddedResourcesProject(Assembly.GetExecutingAssembly())
                                  .UseMemoryCachingProvider()
                                  .Build());
            services.AddSingleton <IDateTime, DateTimeService>();
            services.AddScoped <ICurrentUserService, CurrentUserService>();
            services.AddScoped <IApplicationDbContext>(provider => provider.GetService <ApplicationDbContext>());

            return(services);
        }
 public ShowcaseController(
     IProcessedContentRepository repository,
     IApplicationConfiguration config)
 {
     _repository = repository;
     _config     = config;
 }
Esempio n. 20
0
        public DeployWebAppDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IMsDeploy msDeploy,
            IArtifactsRepository artifactsRepository,
            IIisManager iisManager,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            IApplicationConfiguration applicationConfiguration,
            IDirectoryAdapter directoryAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(msDeploy, "msDeploy");
            Guard.NotNull(artifactsRepository, "artifactsRepository");
            Guard.NotNull(iisManager, "iisManager");
            Guard.NotNull(fileAdapter, "fileAdapter");
            Guard.NotNull(zipFileAdapter, "zipFileAdapter");
            Guard.NotNull(directoryAdapter, "directoryAdapter");

            _msDeploy                 = msDeploy;
            _artifactsRepository      = artifactsRepository;
            _iisManager               = iisManager;
            _fileAdapter              = fileAdapter;
            _zipFileAdapter           = zipFileAdapter;
            _applicationConfiguration = applicationConfiguration;
            _directoryAdapter         = directoryAdapter;
        }
Esempio n. 21
0
        public PageModule(BlogDB db, IApplicationConfiguration config, IContentService contentService)
        {
            Get["/{slug}"] = (parameters) => {
                if (!db.Pages.Any())
                {
                    return(Response.AsError(HttpStatusCode.InternalServerError));
                }

                var fileLocation = String.Format("App_Data\\Content\\_pages\\{0}.md", parameters.slug);

                var page = db.Pages.FirstOrDefault(p => p.FileLocation == fileLocation);

                if (page == null)
                {
                    return(Response.AsError(HttpStatusCode.NotFound));
                }

                ViewBag.PageTitle = " - " + page.Title;

                return(View[page.Layout, new PageDetailViewModel {
                                Page = page,
                                EditLink = GetEditLink(config.Sync, "_pages", parameters.slug + ".md")
                            }]);
            };

            Post["/update", true] = async(parameters, ct) => {
                if (config.CanRefresh(Request))
                {
                    await contentService.GetLatestContent(config);
                }

                return(Response.AsText("Success"));
            };
        }
Esempio n. 22
0
 public DrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient = new RestClient(AppHarborBaseUrl);
     _writer = writer;
 }
Esempio n. 23
0
        private void SetupDatabase(IApplicationConfiguration configuration)
        {
            var mongourl = new MongoUrl(configuration.GetConnectionString("MongoDB"));
            var client   = new MongoClient(mongourl);

            database = client.GetDatabase(mongourl.DatabaseName);
        }
 public SiteRulesRequest(IApplicationConfiguration config, bool includeAdRules, bool includeIncapRules, int pageSize, int pageNum) : this(config)
 {
     IncludeAdRules    = includeAdRules;
     IncludeIncapRules = includeIncapRules;
     PageSize          = pageSize;
     PageNum           = pageNum;
 }
Esempio n. 25
0
        private XElement GetSitemap(IApplicationConfiguration config)
        {
            XNamespace ns = "http://www.sitemaps.org/schemas/sitemap/0.9";

            var homepage = new XElement[] {
                new XElement(ns + "url",
                             new XElement(ns + "loc", config.BaseUrl)
                             )
            };

            var pages = db.Pages.Select(p => new XElement(ns + "url",
                                                          new XElement(ns + "loc", config.BaseUrl + p.Href)
                                                          ));

            var posts = db.Posts.Select(p => new XElement(ns + "url",
                                                          new XElement(ns + "loc", config.BaseUrl + p.Href)
                                                          ));

            XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance";

            return(new XElement(ns + "urlset",
                                new XAttribute("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9"),
                                new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"),
                                new XAttribute(xsi + "schemaLocation", "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"),
                                homepage.Concat(pages).Concat(posts).ToArray()
                                ));
        }
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());

            IPerformanceLogger        performanceLogger        = null;
            IApplicationConfiguration applicationConfiguration = null;

            try
            {
                performanceLogger        = DependencyResolver.Current.GetService <IPerformanceLogger>();
                applicationConfiguration = DependencyResolver.Current.GetService <IApplicationConfiguration>();

                if (performanceLogger == null || !performanceLogger.IsPerformanceLogEnabled())
                {
                    return;
                }
                var performanceLogProvider = DependencyResolver.Current.GetService <IPerformanceLogProvider>();

                if (performanceLogProvider == null)
                {
                    return;
                }
                var performanceLogActionFilter =
                    new PerformanceLogActionFilter(performanceLogProvider, applicationConfiguration);

                filters.Add(performanceLogActionFilter);
            }
            catch (Exception)
            {
                // swallow up, non critical functionality
            }
        }
Esempio n. 27
0
 public SesliSozlukTranslator(IApplicationConfiguration applicationConfiguration,
                              SesliSozlukTranslatorConfiguration sesliSozlukTranslatorConfiguration, TranslatorClient translatorClient)
 {
     this.applicationConfiguration           = applicationConfiguration;
     this.sesliSozlukTranslatorConfiguration = sesliSozlukTranslatorConfiguration;
     this.translatorClient = translatorClient;
 }
Esempio n. 28
0
        public ApplicationCommand(IApplicationConfiguration cfg, string line)
        {
            this.cfg = cfg;
            this.Top = cfg.TopLimit;

            ParseLine(line);
        }
        public DeployWebAppDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IMsDeploy msDeploy,
            IArtifactsRepository artifactsRepository,
            IIisManager iisManager,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            IApplicationConfiguration applicationConfiguration,
            IDirectoryAdapter directoryAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(msDeploy, "msDeploy");
              Guard.NotNull(artifactsRepository, "artifactsRepository");
              Guard.NotNull(iisManager, "iisManager");
              Guard.NotNull(fileAdapter, "fileAdapter");
              Guard.NotNull(zipFileAdapter, "zipFileAdapter");
              Guard.NotNull(directoryAdapter, "directoryAdapter");

              _msDeploy = msDeploy;
              _artifactsRepository = artifactsRepository;
              _iisManager = iisManager;
              _fileAdapter = fileAdapter;
              _zipFileAdapter = zipFileAdapter;
              _applicationConfiguration = applicationConfiguration;
              _directoryAdapter = directoryAdapter;
        }
Esempio n. 30
0
 public YandexMeanFinder(IYandexTranslatorConfiguration yandexConfiguration, IMeanOrganizerFactory meanOrganizerFactory,
                         IApplicationConfiguration applicationConfiguration)
 {
     _yandexConfiguration      = yandexConfiguration;
     _meanOrganizerFactory     = meanOrganizerFactory;
     _applicationConfiguration = applicationConfiguration;
 }
Esempio n. 31
0
 public DialogCreator(IDialogResultToViewResultMapper mapper, DirectoryMapSettings directoryMapSettings, IApplicationConfiguration applicationConfiguration)
 {
     _mapper = mapper;
     _directoryMapSettings     = directoryMapSettings;
     _applicationConfiguration = applicationConfiguration;
     _defaultButton            = ViewResult.Yes;
 }
Esempio n. 32
0
 public AllowAccountProjectionsHandler(ILevyPeriodRepository repository, ILog logger, IApplicationConfiguration applicationConfiguration, IEmployerProjectionAuditService auditService)
 {
     AuditService             = auditService ?? throw new ArgumentNullException(nameof(auditService));
     Repository               = repository ?? throw new ArgumentNullException(nameof(repository));
     Logger                   = logger ?? throw new ArgumentNullException(nameof(logger));
     ApplicationConfiguration = applicationConfiguration ?? throw new ArgumentNullException(nameof(applicationConfiguration));
 }
Esempio n. 33
0
        public CreateAppCommand(IAppHarborClient appHarborClient, IApplicationConfiguration applicationConfiguration, TextWriter textWriter)
        {
            _appHarborClient = appHarborClient;
            _applicationConfiguration = applicationConfiguration;
            _textWriter = textWriter;

            OptionSet.Add("r|region=", "Optionally specify a region", x => _region = x);
        }
Esempio n. 34
0
 public MainPageViewModel(INavigationService navigationService, 
     RegistrationService registrationService, 
     IApplicationConfiguration configuration)
 {
     _navigationService = navigationService;
     _registrationService = registrationService;
     _registrationService.RegistrationFinished += _registrationService_RegistrationFinished;
     _configuration = configuration;
 }
 public void InitializeTest()
 {
     _mockFantasizer = MockRepository.GenerateMock<IFantasizerService>();
     _mockUserTokenStore = MockRepository.GenerateMock<IUserTokenStore>();
     _mockConfiguration = MockRepository.GenerateMock<IApplicationConfiguration>();
     _mockHttpContext = MockRepository.GenerateMock<HttpContextBase>();
     _homeController = new HomeController(_mockUserTokenStore, _mockFantasizer, _mockConfiguration);
     _testObjectFactory = new TestObjectFactory();
 }
Esempio n. 36
0
 public GroupService(IGroupRepository groupRepository, IGroupCategoryRepository categoryRepository,
     IUserGroupRepository userGroupRepository,IMessageService messageService,
     IApplicationConfiguration applicationConfiguration)
 {
     _groupRepository = groupRepository;
     _categoryRepository = categoryRepository;
     _userGroupRepository = userGroupRepository;
     _messageService = messageService;
     _applicationConfiguration = applicationConfiguration;
 }
 public ConsumeMessagesJob(
     ILogger logger,
     IExternalMessageBusReceiver receiver,
     IApplicationConfiguration<IMicroServicesCoreConfiguration> configuration,
     IMessageParserFactory messageParserFactory)
 {
     _logger = logger;
     _receiver = receiver;
     _configuration = configuration;
     _messageParserFactory = messageParserFactory;
 }
        public DeployAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextReader reader, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _restClient = new RestClient("https://packageclient.apphb.com/");
            _reader = reader;
            _writer = writer;

            _excludedDirectories = new List<string> { ".git", ".hg" };
            OptionSet.Add("e|excluded-directory=", "Add excluded directory name", x => _excludedDirectories.Add(x));
        }
        public LogEnricherJob(
            ILogger logger,
            IGeoIpFetcher geoIpFetcher,
            IApplicationConfiguration<IMicroServicesCoreConfiguration> configuration)
            : base(logger)
        {
            _geoIpFetcher = geoIpFetcher;
            _configuration = configuration;

            var elasticSearchUrl = _configuration.Get(c => c.ElasticSearchUrl);
            _elasticClient = new ElasticClient(new ConnectionSettings(new Uri(elasticSearchUrl)));
        }
Esempio n. 40
0
 public LoginatorViewModel(IApplicationConfiguration applicationConfiguration, IConfigurationDao configurationDao)
 {
     ApplicationConfiguration = applicationConfiguration;
     ConfigurationDao = configurationDao;
     IsActive = true;
     NumberOfLogsPerLevel = Constants.DEFAULT_MAX_NUMBER_OF_LOGS_PER_LEVEL;
     Logger = LogManager.GetCurrentClassLogger();
     Logs = new OrderedObservableCollection();
     LogsToInsert = new List<LogViewModel>();
     Namespaces = new ObservableCollection<NamespaceViewModel>();
     Applications = new ObservableCollection<ApplicationViewModel>();
 }
Esempio n. 41
0
        public LogAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _writer = writer;
            _restClient = new RestClient(AppHarborBaseUrl);
            _assignedColors = new Dictionary<string, ConsoleColor>();

            OptionSet.Add("t|tail", "Tail log", x => _tail = true);
            OptionSet.Add("n|num=", "Number of log messages", (int x) => _limit = x);
            OptionSet.Add("p|process=", "Filter log to this process (case-sensitive)", x => _processFilter = x);
            OptionSet.Add("s|source=", "Filter log to this source", x => _sourceFilter = x);
        }
Esempio n. 42
0
        public DeployAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextReader reader, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _restClient = new RestClient(PackageClientBaseUrl);
            _reader = reader;
            _writer = writer;

            _sourceDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());
            OptionSet.Add("source-directory=", "Set source directory", x => _sourceDirectory = new DirectoryInfo(x));

            _excludedDirectories = new List<string> { ".git", ".hg" };
            OptionSet.Add("e|excluded-directory=", "Add excluded directory name", x => _excludedDirectories.Add(x));

            OptionSet.Add("m|message=", "Specify commit message", x => _message = x);
        }
Esempio n. 43
0
 public LeadsDatabase(IApplicationConfiguration applicationConfiguration)
 {
     var url = MongoUrl.Create(applicationConfiguration.ConnectionString);
     _database = new MongoClient(url).GetDatabase(url.DatabaseName);
 }
Esempio n. 44
0
        public CatalogData(
            IApplicationConfiguration configuration,
            Catalog catalog,
            Product[] products)
        {

            // set the root category
            Categories = new Category
            {
                Key = new string[] {"catalog"},
                Slug = "catalog",
                Name = "Catalog",
                Products = new List<CatalogProduct>(products.Length),
            };

            // convert products
            Products = new Dictionary<string, CatalogProduct>(products.Length);
            foreach (var p in products)
            {
                // find/build the category
                var category = Categories;
                for (int i = 1; i < p.Category.Length; i++)
                {
                    var slug = p.Category[i].ToSlug();
                    if (null == category.Children)
                    {
                        category.Children = new Dictionary<string, Category>();
                    }
                    if (!category.Children.ContainsKey(slug))
                    {
                        category.Children[slug] = new Category
                                                        {
                                                            Key = category.Key.Concat(new[] {slug}).ToArray(),
                                                            Name = p.Category[i],
                                                            Parent = category,
                                                            Slug = slug,
                                                            Products = new List<CatalogProduct>(100),
                                                        };
                    }
                    category = category.Children[slug];
                }

                // tranform the product
                var x = new CatalogProduct
                {
                    Catalog = catalog,
                    Id = p.ProductId,
                    Name = p.Name,
                    Sku = p.Sku,
                    Manufacturer = p.Manufacturer,
                    Brand = p.Brand,
                    Model = p.Model,
                    Description = p.Description,
                    Features = p.Features,
                    Warranty = p.Warranty,
                    CountryOfOrigin = p.CountryOfOrigin,
                    Category = category,
                    Tags = p.Tags,
                    Price = (int)Math.Ceiling(catalog.GetPrice(p) * configuration.PointsPerDollar),
                    Options = null == p.Options
                        ? new List<CatalogProductOption>()
                        : p.Options.Select(i => {
                            var source = i.GetBestSource();
                            var price = null == source ? null : source.Pricing;
                            return new CatalogProductOption
                            {
                                Sku = i.Sku,
                                Name = i.Name,
                                Price = price == null ? null : (int?)Math.Ceiling(configuration.PointsPerDollar * catalog.GetPrice(p, i.Name)),
                            };
                        }).ToList(),
                };
                Products[x.Id] = x;

                // add to various categories
                do
                {
                    category.Products.Add(x);
                    category = category.Parent;
                } while (category != null);
            }

        }
Esempio n. 45
0
        public EntitiesModel(IApplicationConfiguration applicationConfiguration)
        {
            _applicationConfiguration = applicationConfiguration;

            BuildDatabaseModel();
        }
 public DeployWebServiceDeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IMsDeploy msDeploy, IArtifactsRepository artifactsRepository, IIisManager iisManager, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter, IApplicationConfiguration applicationConfiguration, IDirectoryAdapter directoryAdapter)
     : base(projectInfoRepository, environmentInfoRepository, msDeploy, artifactsRepository, iisManager, fileAdapter, zipFileAdapter, applicationConfiguration, directoryAdapter)
 {
 }
Esempio n. 47
0
		public ConfigurationReader(IApplicationConfiguration settings)
		{
			_settings = settings;
		}
Esempio n. 48
0
 public TasksClient(IApplicationConfiguration appConfig)
 {
     _baseUrl = appConfig.ServiceUrl;
 }
Esempio n. 49
0
 public TrelloService(IApplicationConfiguration applicationConfiguration)
 {
     _applicationConfiguration = applicationConfiguration;
 }
		public ApplicationRepository(IApplicationConfiguration configuration)
		{
			_configuration = configuration;
		}
Esempio n. 51
0
        public AgentService(
            IDeploymentPipeline deploymentPipeline,
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            ITeamCityRestClient teamCityClient,
            IDeploymentRequestRepository deploymentRequestRepository,
            IDiagnosticMessagesLogger diagnosticMessagesLogger,
            IProjectMetadataExplorer projectMetadataExplorer,
            IDirPathParamsResolver dirPathParamsResolver,
            IApplicationConfiguration applicationConfiguration,
            IEnvironmentDeployInfoRepository environmentDeployInfoRepository,
            IEnvDeploymentPipeline envDeploymentPipeline)
        {
            Guard.NotNull(deploymentPipeline, "deploymentPipeline");
              Guard.NotNull(projectInfoRepository, "projectInfoRepository");
              Guard.NotNull(environmentInfoRepository, "environmentInfoRepository");
              Guard.NotNull(teamCityClient, "teamCityClient");
              Guard.NotNull(deploymentRequestRepository, "deploymentRequestRepository");
              Guard.NotNull(diagnosticMessagesLogger, "diagnosticMessagesLogger");
              Guard.NotNull(dirPathParamsResolver, "dirPathParamsResolver");
              Guard.NotNull(applicationConfiguration, "applicationConfiguration");
              Guard.NotNull(environmentDeployInfoRepository, "environmentDeployInfoRepository");
              Guard.NotNull(envDeploymentPipeline, "envDeploymentPipeline");

              _projectInfoRepository = projectInfoRepository;
              _environmentInfoRepository = environmentInfoRepository;
              _teamCityClient = teamCityClient;
              _deploymentPipeline = deploymentPipeline;
              _deploymentRequestRepository = deploymentRequestRepository;
              _diagnosticMessagesLogger = diagnosticMessagesLogger;
              _projectMetadataExplorer = projectMetadataExplorer;
              _dirPathParamsResolver = dirPathParamsResolver;
              _applicationConfiguration = applicationConfiguration;
              _environmentDeployInfoRepository = environmentDeployInfoRepository;
              _envDeploymentPipeline = envDeploymentPipeline;
        }
Esempio n. 52
0
 public UnlinkAppCommand(IApplicationConfiguration applicationConfiguration, TextWriter writer)
 {
     _applicationConfiguration = applicationConfiguration;
     _writer = writer;
 }
Esempio n. 53
0
 public AddDrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient = new RestClient(AppHarborBaseUrl);
 }
Esempio n. 54
0
 public BuildCommand(IApplicationConfiguration applicationConfiguration, IAppHarborClient appharborClient, TextWriter writer)
     : base(applicationConfiguration)
 {
     _appharborClient = appharborClient;
     _writer = writer;
 }
 public ConfigurationStorage(IApplicationConfiguration configuration)
 {
     this._configuration = configuration;
 }
Esempio n. 56
0
 internal CaseRepository(ITestCaseReader testCaseReader, IApplicationConfiguration appConfig, ITestCaseWriter testCaseWriter)
 {
     _testCaseReader = testCaseReader;
     _appConfig = appConfig;
     _testCaseWriter = testCaseWriter;
 }
Esempio n. 57
0
 public Receiver(IApplicationConfiguration applicationConfiguration)
 {
     Logger = LogManager.GetCurrentClassLogger();
     ApplicationConfiguration = applicationConfiguration;
 }
Esempio n. 58
0
 public LinkAppCommand(IApplicationConfiguration applicationConfiguration, IAppHarborClient appharborClient)
 {
     _applicationConfiguration = applicationConfiguration;
     _appharborClient = appharborClient;
 }
 public ApplicationCommand(IApplicationConfiguration applicationConfiguration)
 {
     _applicationConfiguration = applicationConfiguration;
     OptionSet.Add("a|application=", "Optional application id", x => _applicationId = x);
 }
Esempio n. 60
0
 public CanaryClient(IApplicationConfiguration appConfig)
 {
     _baseUrl = appConfig.ServiceUrl;
 }