Beispiel #1
0
 public TimedService(IConfigurationHelper configHelper, ILoggerFactory loggerFactory)
 {
     InitializeComponent();
     ConfigurationHelper = configHelper;
     _loggerFactory = loggerFactory;
     _logger = _loggerFactory.ProduceLogger("");
 }
Beispiel #2
0
        public MapIntegrationService(IHttpHandler httpHandler, IConfigurationHelper configurationHelper, ILoggingHelper loggingHelper)
        {
            this.httpHandler            = httpHandler;
            this.pdfGeneratorWebAPIName = configurationHelper != null?configurationHelper.ReadAppSettingsConfigurationValues(MapManagerConstants.PDFGeneratorWebAPIName).ToString() : string.Empty;

            this.loggingHelper = loggingHelper;
        }
        public IPlugin IstallNewPlugin(string fileName,
                                       ISonarConfiguration conf,
                                       IConfigurationHelper helper,
                                       INotificationManager manager,
                                       IVsEnvironmentHelper vshelper)
        {
            var assembliesInFile       = this.UnzipFiles(fileName, this.TempInstallPathFolder);
            var assembliesToTempFolder = this.GetAssembliesInTempFolder();
            var plugin = this.LoadPlugin(
                assembliesInFile.ToArray(),
                this.TempInstallPathFolder,
                conf, helper, manager, vshelper);

            if (plugin != null)
            {
                Directory.Delete(this.TempInstallPathFolder, true);
                this.UnzipFiles(fileName, this.PluginsFolder);
            }

            foreach (string path in assembliesInFile)
            {
                var file = Path.GetFileName(path);
                plugin.SetDllLocation(Path.Combine(this.PluginsFolder, file));
            }

            return(plugin);
        }
Beispiel #4
0
 public AuthenticationMiddleware(
     IConfigurationHelper configurationHelper,
     RequestDelegate next)
 {
     _configurationHelper = configurationHelper;
     _next = next;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AnalysisOptionsViewModel" /> class.
        /// </summary>
        /// <param name="viewModel">The view Model.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        public AnalysisOptionsViewModel(
            VSonarQubeOptionsViewModel viewModel,
            IConfigurationHelper configurationHelper)
        {
            this.configurationHelper       = configurationHelper;
            this.viewModel                 = viewModel;
            this.TimeoutValue              = 10;
            this.IsSolutionAnalysisChecked = true;
            this.IsProjectAnalysisChecked  = true;
            this.Header                 = "Analysis Options";
            this.ForeGroundColor        = Colors.Black;
            this.BackGroundColor        = Colors.White;
            this.DownloadWrapperCommand = new RelayCommand(this.OnDownloadWrapperCommand);

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
            AssociationModel.RegisterNewModelInPool(this);

            try
            {
                this.ReloadDataFromDisk(null);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Failed to reload from disk : " + ex.Message);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LocalViewModel" /> class.
        /// </summary>
        /// <param name="pluginsIn">The plugins in. TODO they must be also updatetable</param>
        /// <param name="service">The service.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notificationManager">The notification manager.</param>
        /// <param name="translator">The translator.</param>
        public LocalViewModel(
            List <IAnalysisPlugin> pluginsIn,
            ISonarRestService service,
            IConfigurationHelper configurationHelper,
            INotificationManager notificationManager,
            ISQKeyTranslator translator)
        {
            this.keyTranslator       = translator;
            this.notificationManager = notificationManager;
            this.restService         = service;
            this.configurationHelper = configurationHelper;

            this.plugins        = pluginsIn;
            this.Header         = "Local Analysis";
            this.IssuesGridView = new IssueGridViewModel(false, "LocalView", false, this.configurationHelper, service, notificationManager, translator);
            this.OuputLogLines  = new PaginatedObservableCollection <string>(300);
            this.AllLog         = new List <string>();

            this.InitCommanding();
            this.InitFileAnalysis();

            this.localAnalyserModule                           = new SonarLocalAnalyser(this.plugins, this.restService, this.configurationHelper, this.notificationManager);
            this.localAnalyserModule.StdOutEvent              += this.UpdateOutputMessagesFromPlugin;
            this.localAnalyserModule.LocalAnalysisCompleted   += this.UpdateLocalIssues;
            this.localAnalyserModule.AssociateCommandCompeted += this.UpdateAssociateCommand;

            this.ShowFlyouts  = false;
            this.SizeOfFlyout = 0;

            this.ForeGroundColor = Colors.Black;
            this.BackGroundColor = Colors.White;

            // register model
            AssociationModel.RegisterNewModelInPool(this);
        }
Beispiel #7
0
 public UsersManager(
     IOptions <AppSettings> appSettings,
     ILoginManager loginManager,
     UserManager <User> userManager,
     RoleManager <IdentityRole> roleManager,
     ApplicationDbContext applicationDbContext,
     IAuthManager authManager,
     IOrganizationsManager organizationsManager,
     IUtils utils,
     ILogger <UsersManager> logger,
     RegistryContext registryContext,
     IConfigurationHelper <AppSettings> configurationHelper)
 {
     _roleManager          = roleManager;
     _authManager          = authManager;
     _organizationsManager = organizationsManager;
     _utils                = utils;
     _logger               = logger;
     _registryContext      = registryContext;
     _configurationHelper  = configurationHelper;
     _applicationDbContext = applicationDbContext;
     _loginManager         = loginManager;
     _userManager          = userManager;
     _appSettings          = appSettings.Value;
 }
 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));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="IssuesSearchViewModel" /> class.
        /// </summary>
        /// <param name="searchModel">The search model.</param>
        /// <param name="notificationManager">The notification manager.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="restService">The rest service.</param>
        /// <param name="translator">The translator.</param>
        public IssuesSearchViewModel(
            IssuesSearchModel searchModel,
            INotificationManager notificationManager,
            IConfigurationHelper configurationHelper,
            ISonarRestService restService,
            ISQKeyTranslator translator)
        {
            this.notificationManager = notificationManager;
            this.configurationHelper = configurationHelper;
            this.searchModel = searchModel;
            this.Header = "Issues Search";
            this.AvailableActionPlans = new ObservableCollection<SonarActionPlan>();
            this.UsersList = new ObservableCollection<User>();
            this.IssuesGridView = new IssueGridViewModel(true, "SearchView", false, configurationHelper, restService, notificationManager, translator);
            this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout;
            this.SizeOfFlyout = 0;

            this.InitCommanding();

            this.ForeGroundColor = Colors.Black;
            this.BackGroundColor = Colors.White;
            this.CreatedBeforeDate = DateTime.Now;
            this.CreatedSinceDate = DateTime.Now;

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
Beispiel #10
0
        public FrmDatabaseSettings(IConfigurationHelper config, IDatabaseHelper database)
        {
            InitializeComponent();

            _config   = config;
            _database = database;
        }
Beispiel #11
0
        public NetworkManagerIntegrationService(IHttpHandler httpHandler, IConfigurationHelper configurationHelper, ILoggingHelper loggingHelper)
        {
            this.httpHandler             = httpHandler;
            this.referenceDataWebAPIName = configurationHelper != null?configurationHelper.ReadAppSettingsConfigurationValues(ReferenceDataWebAPIName).ToString() : string.Empty;

            this.loggingHelper = loggingHelper;
        }
        public PluginDescription GetPluginDescription(IConfigurationHelper vsinter)
        {
            var isEnabled = vsinter.ReadOptionFromApplicationData(GlobalIds.PluginEnabledControlId, "DuplicationsPlugin");

            var desc = new PluginDescription()
            {
                Description = "Duplications Plugin",
                Enabled = true,
                Name = "DuplicationsPlugin",
                SupportedExtensions = "*",
                Version = this.GetVersion()
            };

            if (string.IsNullOrEmpty(isEnabled))
            {
                desc.Enabled = true;
            }
            else if (isEnabled.Equals("true", StringComparison.CurrentCultureIgnoreCase))
            {
                desc.Enabled = true;
            }
            else
            {
                desc.Enabled = false;
            }

            return desc;
        }
Beispiel #13
0
 public MongoDbLogger(string category, Func <string, LogLevel, bool> filter, ILogRepository logRepository, IConfigurationHelper configurationHelper)
 {
     _categoryName        = category;
     _filter              = filter;
     _logRepository       = logRepository;
     _configurationHelper = configurationHelper;
 }
Beispiel #14
0
 /// <summary>
 /// Initializes a new instance of <see cref="CrowHost"/>.
 /// </summary>
 /// <param name="log">Instance of logger.</param>
 /// <param name="convention">Naming convention instance.</param>
 /// <param name="container">Dependency injection container.</param>
 /// <param name="configuration">Configuration helper.</param>
 /// <param name="host">Http host instance.</param>
 public CrowHost(ILog log, INamingConvention convention,
                 IInjectionContainer container,
                 IConfigurationHelper configuration,
                 IHttpHost host)
     : base(log, convention, container, configuration, host)
 {
 }
Beispiel #15
0
 public DataProcessor(IApiHelper apiHelper, IConfigurationHelper configurationHelper, IEmailHelper emailHelper, IDataHelper dataHelper)
 {
     _apiHelper           = apiHelper;
     _configurationHelper = configurationHelper;
     _emailHelper         = emailHelper;
     _dataHelper          = dataHelper;
 }
Beispiel #16
0
 public MongoChatRepository(IConfigurationHelper configurationHelper,
                            ISecurityManager securityManager)
 {
     _configurationHelper = configurationHelper;
     _securityManager     = securityManager;
     _database            = ConnectToDatabase();
 }
 public ScriptValidationHelper(
     IConfigurationHelper configurationHelper,
     ILogger <ScriptValidationHelper> logger)
 {
     _configurationHelper = configurationHelper;
     _logger = logger;
 }
Beispiel #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailNotificator"/> class.
 /// </summary>
 /// <param name="serviceBusHelper">ServiceBus helper.</param>
 /// <param name="configurationHelper">Configuration helper.</param>
 public EmailNotificator(
     IServiceBusHelper serviceBusHelper,
     IConfigurationHelper configurationHelper)
 {
     _serviceBusHelper    = serviceBusHelper;
     _configurationHelper = configurationHelper;
 }
Beispiel #19
0
        /// <summary>
        /// Gets the specified URI, passing the UserAgent.
        /// </summary>
        /// <param name="uri">
        /// The URI.
        /// </param>
        /// <param name="timeout">
        /// optional. will default to httpTimeout XML config option
        /// </param>
        /// <returns>
        /// The <see cref="Stream"/>.
        /// </returns>
        public static string Get(string uri, int timeout = -1)
        {
            if (configurationHelper == null)
            {
                configurationHelper = ServiceLocator.Current.GetInstance<IConfigurationHelper>();
            }

            var hwr = (HttpWebRequest)WebRequest.Create(uri);
            hwr.UserAgent = configurationHelper.CoreConfiguration.UserAgent;
            hwr.Timeout = timeout == -1 ? configurationHelper.CoreConfiguration.HttpTimeout : timeout;

            string data;

            using (var resp = (HttpWebResponse)hwr.GetResponse())
            {
                Stream responseStream = resp.GetResponseStream();

                if (responseStream == null)
                {
                    throw new NullReferenceException("Returned web request response stream was null.");
                }

                var streamReader = new StreamReader(responseStream);
                data = streamReader.ReadToEnd();
                streamReader.Close();
            }

            return data;
        }
 /// <summary>The save data in ui.</summary>
 /// <param name="project">The project.</param>
 /// <param name="helper">The helper.</param>
 public void SaveDataInUi(Resource project, IConfigurationHelper helper)
 {
     foreach (var prop in this.PluginProperties)
     {
         helper.WriteSetting(prop);
     }
 }
Beispiel #21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PDFGeneratorBusinessService" /> class
        /// </summary>
        /// <param name="pdfGeneratorBusinessService">PDF generator business service</param>
        /// <param name="configurationHelper">Configuration helper</param>
        /// <param name="loggingHelper">Logging helper</param>
        public PDFGeneratorBusinessService(IConfigurationHelper configurationHelper, ILoggingHelper loggingHelper)
        {
            // Validate the arguments
            if (configurationHelper == null)
            {
                throw new ArgumentNullException(nameof(configurationHelper));
            }
            if (loggingHelper == null)
            {
                throw new ArgumentNullException(nameof(loggingHelper));
            }


            // Store the injected dependencies
            this.loggingHelper = loggingHelper;


            // Retrieve the configuration settings
            //
            // PDF report folder path
            const string PdfReportFolderPathConfigurationKey = "PdfReportFolderPath";

            this.pdfReportFolderPath = configurationHelper != null?configurationHelper.ReadAppSettingsConfigurationValues(PdfReportFolderPathConfigurationKey).ToString() : string.Empty;

            if (string.IsNullOrWhiteSpace(this.pdfReportFolderPath))
            {
                throw new System.Exception($"Configuration setting {PdfReportFolderPathConfigurationKey} must not be null or empty.");
            }                                                                                                                                                                                   // TODO update exception type
            if (!Directory.Exists(this.pdfReportFolderPath))
            {
                throw new System.Exception($"Configuration setting {PdfReportFolderPathConfigurationKey} must point to a valid directory.");
            }                                                                                                                                                                                 // TODO update exception type
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LicenseViewerViewModel" /> class.
        /// </summary>
        /// <param name="plugincontroller">The plugincontroller.</param>
        /// <param name="helper">The helper.</param>
        public LicenseViewerViewModel(
            PluginManagerModel plugincontroller,
            IConfigurationHelper helper)
        {
            this.Header      = "License Manager";
            this.pluginModel = plugincontroller;
            this.confHelper  = helper;

            this.ForeGroundColor      = Colors.Black;
            this.ForeGroundColor      = Colors.Black;
            this.AvailableLicenses    = new ObservableCollection <VsLicense>();
            this.RefreshCommand       = new RelayCommand(this.GetLicensesFromServer);
            this.GenerateTokenCommand = new RelayCommand(this.OnGenerateTokenCommand, () => this.SelectedLicense != null);

            try
            {
                this.GetLicensesFromServer();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            // register model so it can be updated
            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
        private static void RegisterLogger(ContainerBuilder containerBuilder, IConfigurationHelper configHelper)
        {
            var loggerConfig = configHelper.GetSectionValues <LoggerOptions>("LoggerSection");

            containerBuilder.RegisterInstance(new LoggerOptions
            {
                LoggerConnectionstring = loggerConfig.LoggerConnectionstring
            }).As <ILoggerOptions>().SingleInstance();

            containerBuilder.Register(c =>
            {
                var loggerOptions = c.Resolve <ILoggerOptions>();
                return(new ApplicationLoggerSettings
                {
                    ApplicationLoggerOutputSettingsCollection = new List <IApplicationLoggerOutputSettings>
                    {
                        new MsSqlServerApplicationLoggerOutputSettings
                        {
                            MinimumLogLevel = LogLevel.Verbose,
                            ConnectionString = loggerOptions.LoggerConnectionstring,
                            LogsTableName = "Logs"
                        },
                        new ConsoleApplicationLoggerOutputSettings
                        {
                            MinimumLogLevel = LogLevel.Verbose
                        }
                    }
                });
            }).As <IApplicationLoggerSettings>().SingleInstance();

            containerBuilder.RegisterType <ExecutionContext>().As <IExecutionContext>().InstancePerLifetimeScope();
            containerBuilder.RegisterType <SerilogLoggerFactory>().As <ISerilogLoggerFactory>().InstancePerLifetimeScope();
            containerBuilder.RegisterType <SeriLogger>().As <ILogger>().InstancePerLifetimeScope();
        }
		public void InitTest()
		{
			base.InitDbContext();

			_backgroundService = Substitute.For<IBackgroundService>();
			_appraiserOrderRepository = new AppraiserOrderRepository(this.DbFactory);
			_orderRepository = new OrderRepository(this.DbFactory);
			_commitProvider = new CommitProvider(this.DbFactory);
			_userRepository = new UserRepository(this.DbFactory);
			_taskManager = new TaskManager(_backgroundService, _userRepository);
			_referenceManagement = new ReferenceManagement(new ReferenceRepository(this.DbFactory), new WebCacheService());
			_dateTimeManager = new DateTimeManager(_referenceManagement);
			_appraiserManagement = Substitute.For<IAppraiserManagement>();
			_configHelper = Substitute.For<IConfigurationHelper>();
			_orderManager = new OrderManager(
				_orderRepository,
				Substitute.For<IClientUserRepository>(),
				_referenceManagement,
				_appraiserManagement,
				_configHelper,
				Substitute.For<IAppraiserOrderRepository>(),
				Substitute.For<IChangeTrackingRepository>(),
				Substitute.For<IOrderHistoryManager>(),
				Substitute.For<IOrderDocumentsRepository>());

			_appraiserOrderDeliveryService = new AppraiserOrderDeliveryService(_taskManager, _appraiserOrderRepository, _commitProvider, _orderManager,
				new DateTimeManager(_referenceManagement), Substitute.For<IOrderHistoryManager>(), Substitute.For<IAppraiserOrderSetPointsRepository>(),
				Substitute.For<IAppraiserOrderListItemRepository>(),
				Substitute.For<IOrderPeriodicalNotificationManager>());
		}
Beispiel #25
0
        public static string GetMonitoringEndpointName(this IConfigurationHelper config, long jobId)
        {
            var jobsEndpointName = config.GetSettingOrDefault("Monitoring_JobsService_EndpointName", "sfa-das-payments-monitoring-jobs");

            return($"{jobsEndpointName}{jobId % 20}");
            //return $"{jobsEndpointName}0";
        }
Beispiel #26
0
   public MongoChatRepository(IConfigurationHelper configurationHelper,
 ISecurityManager securityManager)
   {
       _configurationHelper = configurationHelper;
         _securityManager = securityManager;
         _database = ConnectToDatabase();
   }
Beispiel #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RoslynManagerModel" /> class.
        /// </summary>
        /// <param name="pluginsIn">The plugins in.</param>
        /// <param name="notificationManagerIn">The notification manager in.</param>
        /// <param name="configHelper">The configuration helper.</param>
        public RoslynManagerModel(
            IEnumerable <IAnalysisPlugin> pluginsIn,
            INotificationManager notificationManagerIn,
            IConfigurationHelper configHelper,
            ISonarRestService rest)
        {
            this.roslynHomePath             = Path.Combine(configHelper.ApplicationPath, "Diagnostics");
            this.roslynExternalUserDiagPath = Path.Combine(this.roslynHomePath, "UserDiagnostics");
            this.roslynEmbbedDiagPath       = Path.Combine(this.roslynHomePath, "InternalDiagnostics");

            if (!Directory.Exists(this.roslynHomePath))
            {
                Directory.CreateDirectory(this.roslynHomePath);
            }

            if (!Directory.Exists(this.roslynExternalUserDiagPath))
            {
                Directory.CreateDirectory(this.roslynExternalUserDiagPath);
            }

            if (!Directory.Exists(this.roslynEmbbedDiagPath))
            {
                Directory.CreateDirectory(this.roslynEmbbedDiagPath);
            }

            this.rest                   = rest;
            this.confHelper             = configHelper;
            this.plugins                = pluginsIn;
            this.notificationManager    = notificationManagerIn;
            this.ExtensionDiagnostics   = new Dictionary <string, VSSonarExtensionDiagnostic>();
            this.embedVersionController = new EmbbedVersionController(this.notificationManager, rest, configHelper, this.roslynEmbbedDiagPath);

            // register model
            AssociationModel.RegisterNewModelInPool(this);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GooglUrlShorteningService"/> class.
 /// </summary>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="shortUrlCacheRepository">
 /// The short url cache repository.
 /// </param>
 /// <param name="configurationHelper">
 /// The configuration Helper.
 /// </param>
 public GooglUrlShorteningService(
     ILogger logger, 
     IShortUrlCacheRepository shortUrlCacheRepository, 
     IConfigurationHelper configurationHelper)
     : base(logger, shortUrlCacheRepository, configurationHelper)
 {
 }
Beispiel #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DeliveryRouteRepository"/> class.
 /// </summary>
 /// <param name="databaseFactory">IDatabaseFactory reference</param>
 public DeliveryRouteDataService(IDatabaseFactory <RouteDBContext> databaseFactory, ILoggingHelper loggingHelper, IConfigurationHelper configurationHelper)
     : base(databaseFactory)
 {
     // Store  injected dependencies
     this.loggingHelper       = loggingHelper;
     this.configurationHelper = configurationHelper;
 }
        public CloudMockApiStorageConfiguration(IConfigurationHelper configurationHelper)
        {
            this.configurationHelper = configurationHelper;

            storageConnectionString = new Lazy <string>(() => configurationHelper.GetApplicationSetting("CloudMockApi.StorageConnectionString"));
            tenantsTableName        = new Lazy <string>(() => configurationHelper.GetApplicationSetting("CloudMockApi.TenantsTableName"));
        }
Beispiel #31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginManagerModel" /> class.
        /// </summary>
        /// <param name="controller">The controller.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notifyManager">The notify manager.</param>
        /// <param name="helper">The helper.</param>
        public PluginManagerModel(
            IPluginController controller,
            IConfigurationHelper configurationHelper,
            INotificationManager notifyManager,
            IVsEnvironmentHelper helper)
        {
            this.notificationManager = notifyManager;
            this.Header = "Plugin Manager";
            this.configurationHelper   = configurationHelper;
            this.controller            = controller;
            this.vshelper              = helper;
            this.userPluginInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "vssonarextension", vshelper.VsVersion(), "plugins");

            if (!Directory.Exists(this.userPluginInstallPath))
            {
                Directory.CreateDirectory(this.userPluginInstallPath);
            }

            this.plugins = new List <IPlugin>();

            this.MenuPlugins         = new List <IMenuCommandPlugin>();
            this.AnalysisPlugins     = new List <IAnalysisPlugin>();
            this.SourceCodePlugins   = new List <ISourceVersionPlugin>();
            this.IssueTrackerPlugins = new List <IIssueTrackerPlugin>();

            var defaultPluginsFolder = Path.Combine(this.controller.ExtensionFolder, "plugins");

            this.InitPluginList(helper, null, defaultPluginsFolder);
            this.InitPluginList(helper, null, this.userPluginInstallPath);
            this.InitCommanding();

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
		public void SetUp()
		{
			_hudAppraiserContactInfoRepository = Substitute.For<IHUDAppraiserContactInfoRepository>();
			_hUDAppraiserLicensesRepository = Substitute.For<IHUDAppraiserLicensesRepository>();
			_configurationHelper = Substitute.For<IConfigurationHelper>();
			_target = new HUDAppraiserInformationService(_hudAppraiserContactInfoRepository, _hUDAppraiserLicensesRepository, _configurationHelper);
		}
 public PageAnalysisService()
 {
     _scoreService        = new ScoreService();
     _htmlHelper          = new HtmlHelper();
     _byteSizeHelper      = new ByteSizeHelper();
     _configurationHelper = new ConfigurationHelper();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="LicenseViewerViewModel" /> class.
        /// </summary>
        /// <param name="plugincontroller">The plugincontroller.</param>
        /// <param name="helper">The helper.</param>
        public LicenseViewerViewModel(
            PluginManagerModel plugincontroller,
            IConfigurationHelper helper)
        {
            this.Header = "License Manager";
            this.pluginModel = plugincontroller;
            this.confHelper = helper;

            this.ForeGroundColor = Colors.Black;
            this.ForeGroundColor = Colors.Black;
            this.AvailableLicenses = new ObservableCollection<VsLicense>();
            this.RefreshCommand = new RelayCommand(this.GetLicensesFromServer);
            this.GenerateTokenCommand = new RelayCommand(this.OnGenerateTokenCommand, () => this.SelectedLicense != null);

            try
            {
                this.GetLicensesFromServer();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            // register model so it can be updated
            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
 public ThirdPartyAddressLocationIntegrationService(IHttpHandler httpHandler, IConfigurationHelper configurationHelper, ILoggingHelper loggingHelper)
 {
     // Store injected dependencies
     this.httpHandler         = httpHandler;
     this.configurationHelper = configurationHelper;
     this.loggingHelper       = loggingHelper;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="IssuesSearchViewModel" /> class.
        /// </summary>
        /// <param name="searchModel">The search model.</param>
        /// <param name="notificationManager">The notification manager.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="restService">The rest service.</param>
        /// <param name="translator">The translator.</param>
        /// <param name="analyser">The analyser.</param>
        public IssuesSearchViewModel(
            IssuesSearchModel searchModel,
            INotificationManager notificationManager,
            IConfigurationHelper configurationHelper,
            ISonarRestService restService,
            ISQKeyTranslator translator,
            ISonarLocalAnalyser analyser,
            IList <IIssueTrackerPlugin> plugins)
        {
            this.restService         = restService;
            this.notificationManager = notificationManager;
            this.configurationHelper = configurationHelper;
            this.searchModel         = searchModel;
            this.Header            = "Issues Search";
            this.AvailableProjects = new List <Resource>();
            this.AssigneeList      = new ObservableCollection <User>();
            this.AvailableSearches = new ObservableCollection <string>();
            this.IssuesGridView    = new IssueGridViewModel("SearchView", false, configurationHelper, restService, notificationManager, translator);
            this.savedSearchModel  = new SearchModel(this.AvailableSearches);
            this.IssuesGridView.ContextMenuItems     = this.CreateRowContextMenu(restService, translator, analyser, plugins);
            this.IssuesGridView.ShowContextMenu      = true;
            this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout;
            this.SizeOfFlyout = 0;
            this.InitCommanding();

            this.ForeGroundColor   = Colors.Black;
            this.BackGroundColor   = Colors.White;
            this.CreatedBeforeDate = DateTime.Now;
            this.CreatedSinceDate  = DateTime.Now;

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ServerViewModel" /> class.
        /// </summary>
        /// <param name="vsenvironmenthelper">The vsenvironmenthelper.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="restservice">The restservice.</param>
        /// <param name="notificationManager">The notification manager.</param>
        /// <param name="translator">The translator.</param>
        /// <param name="analyser">The analyser.</param>
        public ServerViewModel(
            IVsEnvironmentHelper vsenvironmenthelper,
            IConfigurationHelper configurationHelper,
            ISonarRestService restservice,
            INotificationManager notificationManager,
            ISQKeyTranslator translator,
            ISonarLocalAnalyser analyser,
            IList <IIssueTrackerPlugin> issuetracketplugins)
        {
            this.analyser            = analyser;
            this.notificationMan     = notificationManager;
            this.vsenvironmenthelper = vsenvironmenthelper;
            this.configurationHelper = configurationHelper;
            this.restservice         = restservice;

            this.Header           = "Server Analysis";
            this.AlreadyOpenDiffs = new SortedSet <string>();
            this.IssuesGridView   = new IssueGridViewModel("ServerView", true, this.configurationHelper, this.restservice, this.notificationMan, translator);
            this.IssuesGridView.ContextMenuItems     = this.CreateRowContextMenu(restservice, translator, issuetracketplugins);
            this.IssuesGridView.ShowContextMenu      = true;
            this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout;
            this.InitCommanding();

            this.ForeGroundColor = Colors.Black;
            this.BackGroundColor = Colors.White;
            this.SizeOfFlyout    = 0;
            // register model
            AssociationModel.RegisterNewModelInPool(this);
        }
Beispiel #38
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GeneralConfigurationViewModel" /> class.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        /// <param name="restService">The rest service.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notificationManager">The notification manager.</param>
        public GeneralConfigurationViewModel(
            VSonarQubeOptionsViewModel viewModel,
            ISonarRestService restService,
            IConfigurationHelper configurationHelper,
            INotificationManager notificationManager)
        {
            this.Header              = "General Settings";
            this.UserName            = string.Empty;
            this.Password            = string.Empty;
            this.viewModel           = viewModel;
            this.restService         = restService;
            this.configurationHelper = configurationHelper;
            this.notificationManager = notificationManager;

            this.ClearCacheCommand     = new RelayCommand(this.OnClearCacheCommand);
            this.TestConnectionCommand = new RelayCommand <object>(this.OnTestAndSavePassword);
            this.ClearCredentials      = new RelayCommand(this.OnClearCredentials);

            this.BackGroundColor = Colors.White;
            this.ForeGroundColor = Colors.Black;

            this.GetCredentials();
            this.ReloadDataFromDisk(null);

            // register model
            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
 public ThirdPartyImport(IThirdPartyFileProcessUtility usrLoader, ILoggingHelper loggingHelper, IConfigurationHelper configurationHelper)
 {
     this.usrLoader           = usrLoader;
     this.loggingHelper       = loggingHelper;
     this.configurationHelper = configurationHelper;
     this.ServiceName         = configurationHelper.ReadAppSettingsConfigurationValues(BatchServiceName);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="IssuesSearchViewModel" /> class.
        /// </summary>
        /// <param name="searchModel">The search model.</param>
        /// <param name="notificationManager">The notification manager.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="restService">The rest service.</param>
        /// <param name="translator">The translator.</param>
        public IssuesSearchViewModel(
            IssuesSearchModel searchModel,
            INotificationManager notificationManager,
            IConfigurationHelper configurationHelper,
            ISonarRestService restService,
            ISQKeyTranslator translator)
        {
            this.notificationManager = notificationManager;
            this.configurationHelper = configurationHelper;
            this.searchModel         = searchModel;
            this.Header = "Issues Search";
            this.AvailableActionPlans = new ObservableCollection <SonarActionPlan>();
            this.UsersList            = new ObservableCollection <User>();
            this.IssuesGridView       = new IssueGridViewModel(true, "SearchView", false, configurationHelper, restService, notificationManager, translator);
            this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout;
            this.SizeOfFlyout = 0;

            this.InitCommanding();

            this.ForeGroundColor   = Colors.Black;
            this.BackGroundColor   = Colors.White;
            this.CreatedBeforeDate = DateTime.Now;
            this.CreatedSinceDate  = DateTime.Now;

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
 public PostsController(IPostsResource postsSvc, IUsersResource usersSvc, IViewCountResource viewCountSvc, IErrorSignaler errorSignaler, IConfigurationHelper configurationHelper)
 {
     _postsSvc = postsSvc;
     _usersSvc = usersSvc;
     _viewCountSvc = viewCountSvc;
     _errorSignaler = errorSignaler;
     _configurationHelper = configurationHelper;
 }
 public ProfileImageController(IUsersResource usersResource, IMediaResource mediaResource,
     IErrorSignaler errorSignaler, IConfigurationHelper configurationHelper)
 {
     _usersResource = usersResource;
     _mediaResource = mediaResource;
     _errorSignaler = errorSignaler;
     _configurationHelper = configurationHelper;
 }
Beispiel #43
0
		public AvmRequestsService(IConfigurationHelper configurationHelper, ICommitProvider commitProvider, IAvmRequestsRepository avmRequestsRepository, ITaskManager taskManager, IOrderManager orderManager, IDocumentService documentService)
		{
			_configurationHelper = configurationHelper;
			_commitProvider = commitProvider;
			_avmRequestsRepository = avmRequestsRepository;
			_taskManager = taskManager;
			_orderManager = orderManager;
			_documentService = documentService;
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="UrlShorteningServiceBase"/> class.
 /// </summary>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="shortUrlCacheRepository">
 /// The short url cache repository.
 /// </param>
 /// <param name="configurationHelper">
 /// The configuration Helper.
 /// </param>
 protected UrlShorteningServiceBase(
     ILogger logger, 
     IShortUrlCacheRepository shortUrlCacheRepository, 
     IConfigurationHelper configurationHelper)
 {
     this.logger = logger;
     this.shortUrlCacheRepository = shortUrlCacheRepository;
     this.configurationHelper = configurationHelper;
 }
Beispiel #45
0
 public MediaLogic(IMediaRepository mediaRepository, IAlbumRepository albumRepository, 
     IImageHelper imageHelper, IConfigurationHelper configurationHelper, IFileHelper fileHelper)
 {
     _mediaRepository = mediaRepository;
     _albumRepository = albumRepository;
     _imageHelper = imageHelper;
     _configurationHelper = configurationHelper;
     _fileHelper = fileHelper;
 }
Beispiel #46
0
		public UpdateOrderController(IOrderFulfillmentService orderFulfillmentService, IChangeTrackingRepository changeTrackingRepository,
			IAppraiserOrderDeliveryService appraiserOrderDeliveryService, ISecurityContext securityContext, IOrderService orderService, IConfigurationHelper configHelper)
		{
            _configHelper = configHelper;
			_orderFulfillmentService = orderFulfillmentService;
			_changeTrackingRepository = changeTrackingRepository;
			_appraiserOrderDeliveryService = appraiserOrderDeliveryService;
			_orderService = orderService;
		}
		public HUDAppraiserInformationService(IHUDAppraiserContactInfoRepository hudAppraiserContactInfoRepository,
																							IHUDAppraiserLicensesRepository hudAppraiserLicenseRepository,
																							IConfigurationHelper configurationHelper)
		{
			_hudAppraiserContactInfoRepository = hudAppraiserContactInfoRepository;
			_hudAppraiserLicenseRepository = hudAppraiserLicenseRepository;
			_configurationHelper = configurationHelper;

		}
Beispiel #48
0
 public PostsService(IPostsLogic postsLogic, ICommentsLogic commentsLogic, IPostLikesLogic postLikesLogic,
     IViewCountLogic viewCountLogic, IConfigurationHelper configurationHelper, IErrorSignaler errorSignaler)
 {
     _postsLogic = postsLogic;
     _commentsLogic = commentsLogic;
     _postLikesLogic = postLikesLogic;
     _viewCountLogic = viewCountLogic;
     _configurationHelper = configurationHelper;
     _errorSignaler = errorSignaler;
 }
Beispiel #49
0
		public SmsManager(IConfigurationHelper config,
											ISMSTemplateRepository smsRepository,
											IAppraiserOrderDeliveryService appraiserDelivery,
											ITaskManager taskManager)
		{
			_config = config;
			_smsRepository = smsRepository;
			_appraiserDelivery = appraiserDelivery;
			_taskManager = taskManager;
		}
        public ProceduralStorageCommand(
            IConfigurationHelper configurationHelper,
            IStorageAccess storageAccess)
        {
            this.m_ConfigurationHelper = configurationHelper;
            this.m_StorageAccess = storageAccess;

            this.IsCommand("test-storage", "Test the world configuration storage");
            this.m_ConfigurationHelper.Setup(this, x => this.m_ConfigurationName = x);
        }
        public ProceduralPlannerCommand(
            IConfigurationHelper configurationHelper,
            IGenerationPlanner generationPlanner)
        {
            this.m_ConfigurationHelper = configurationHelper;
            this.m_GenerationPlanner = generationPlanner;

            this.IsCommand("test-planner", "Test the procedural generation planning engine");
            this.m_ConfigurationHelper.Setup(this, x => this.m_ConfigurationName = x);
        }
        public DocumentGenerationService(IAppraiserUserService appraiserUserService, IReferenceManagement referenceManagement, IOrderManager orderManager, 
            IConfigurationHelper configManager, IGeneralInstructionManager generalInstructionManager, IAVMResponseManager avmResponseManager)
		{
			_appraiserUserService = appraiserUserService;
			_referenceManagement = referenceManagement;
			_orderManager = orderManager;
			_configManager = configManager;
			_generalInstructionManager = generalInstructionManager;
            _avmResponseManager = avmResponseManager;
		}
        public ProceduralTracingCommand(
            IConfigurationHelper configurationHelper,
            IAlgorithmTraceImageGeneration algorithmTraceImageGeneration)
        {
            this.m_ConfigurationHelper = configurationHelper;
            this.m_AlgorithmTraceImageGeneration = algorithmTraceImageGeneration;

            this.IsCommand("trace-generation", "Trace the world configuration into a set of images");
            this.m_ConfigurationHelper.Setup(this, x => this.m_ConfigurationName = x);
        }
		public SendAppraiserOrderInvitationEmail(IMailManager mailManager, IAppraiserUserRepository appraiserUserRepository,
			IAppraiserOrderRepository appraiserOrderRepository, IReferenceManagement referenceManager,
			IConfigurationHelper configurationHelper, IAppraisalFormsService formsService)
		{
			_mailManager = mailManager;
			_appraiserUserRepository = appraiserUserRepository;
			_appraiserOrderRepository = appraiserOrderRepository;
			_referenceManager = referenceManager;
			_configurationHelper = configurationHelper;
			_formsService = formsService;
		}
Beispiel #55
0
		public void InitTest()
		{
			_orderRepository = Substitute.For<IOrderRepository>();
			_orderHistoryManager = Substitute.For<IOrderHistoryManager>();
			_orderDocumentsRepository = Substitute.For<IOrderDocumentsRepository>();
			_appraiserOrderRepository = Substitute.For<IAppraiserOrderRepository>();
			_securityContext = Substitute.For<ISecurityContext>();
			_referenceManagement = Substitute.For<IReferenceManagement>();
			_documentService = Substitute.For<IDocumentService>();
			_businessDaysCalc = Substitute.For<IBusinessDaysCalc>();
			_appraiserUserRepository = Substitute.For<IAppraiserUserRepository>();
			_configurationHelper = Substitute.For<IConfigurationHelper>();

			_referenceManagement.GetTestOrderData().Returns(new Dictionary<OrderField, string>() 
			{
				{OrderField.AppraisalForm, "1"},
				{OrderField.AppraisalTypeId, "1"},
				{OrderField.BorrowerFirstName, "Borrower"},
				{OrderField.BorrowerLastName, "Test"},
				{OrderField.ClientCompanyBrancheId, "1"},
				{OrderField.ClientCompanyId, "1"},
				{OrderField.ContactName, ""},
				{OrderField.ContactPhone, "111-111-1111"},
				{OrderField.ContactRoleId, "1"},
				{OrderField.CreatedByClientUserId, "1"},
				{OrderField.GFEAmount, "130"},
				{OrderField.LoanNumber, "test"},
				{OrderField.LoanPurposeTypeId, "5"},
				{OrderField.LoanTypeId, "1"},
				{OrderField.OccupancyTypeId, "1"},
				{OrderField.OrderPublicId, "TEST_ORDER"},
				{OrderField.PropertyCity, "Anytown"},
				{OrderField.PropertyCounty, "Anycounty"},
				{OrderField.PropertyState, "CA"},
				{OrderField.PropertyStreet, "111 Main St"},
				{OrderField.PropertyTypeId, "1"},
				{OrderField.PropertyZip, "95630"},
				{OrderField.PurchaseContractFileName, "AGREEMENT TO PURCHASE REAL ESTATE.pdf"},
				{OrderField.PurchasePrice, "500000"}	
			});

			_target = new TestOrderManager(
				_orderRepository,
				_orderHistoryManager,
				_appraiserOrderRepository,
				_securityContext,
				_orderDocumentsRepository,
				_referenceManagement,
				_documentService,
				_businessDaysCalc,
				_appraiserUserRepository,
				_configurationHelper
				);
		}
		public OrderPeriodicalNotificationTask(IMailManager mailManager,
																					IConfigurationHelper configurationHelper,
																					IOrderPeriodicalNotificationManager orderPeriodicalManager,
																					IOrderManager orderManager
																					)
		{
			_mailManager = ValidationUtil.CheckOnNullAndThrowIfNull(mailManager);
			_configurationHelper = ValidationUtil.CheckOnNullAndThrowIfNull(configurationHelper);
			_orderPeriodicalManager = ValidationUtil.CheckOnNullAndThrowIfNull(orderPeriodicalManager);
			_orderManager = ValidationUtil.CheckOnNullAndThrowIfNull(orderManager);
		}
Beispiel #57
0
		public void SetUp()
		{
			_userManagement = Substitute.For<IUsersManagement>();
			_appraiserManagement = Substitute.For<IAppraiserManagement>();
			_referenceManager = Substitute.For<IReferenceManagement>();
			_emailRepository = Substitute.For<IEmailTempalteRepository>();
			_dvsManager = Substitute.For<IDVSUserManager>();
			_configManager = Substitute.For<IConfigurationHelper>();

			_target = new MailManager(_userManagement, _appraiserManagement, _referenceManager, _emailRepository, _dvsManager, _configManager);
		}		
Beispiel #58
0
		public OrderAssignmentService(IAppraiserUserRepository appraiserUserRepository, IOrderManager orderManager, ITaskManager taskManager,
			DateTimeManager dateTimeManager, IAppraiserOrderDeliveryService appraiserOrderDeliveryService, IConfigurationHelper configurationHelper,
			IAppraiserOrderRepository appraiserOrderRepository)
		{
			_appraiserUserRepository = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserUserRepository);
			_orderManager = ValidationUtil.CheckOnNullAndThrowIfNull(orderManager);
			_taskManager = ValidationUtil.CheckOnNullAndThrowIfNull(taskManager);
			_dateTimeManager = ValidationUtil.CheckOnNullAndThrowIfNull(dateTimeManager);
			_appraiserOrderDeliveryService = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserOrderDeliveryService);
			_configurationHelper = ValidationUtil.CheckOnNullAndThrowIfNull(configurationHelper);
			_appraiserOrderRepository = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserOrderRepository);
		}
Beispiel #59
0
		public MailManager(IUsersManagement userManagement, IAppraiserManagement appraiserManagement,
											IReferenceManagement referenceManager, IEmailTempalteRepository emailRepository,
											IDVSUserManager dvsUserManager,
											IConfigurationHelper configManager)
		{
			_userManagement = userManagement;
			_appraiserManagement = appraiserManagement;
			_referenceManager = referenceManager;
			_emailRepository = emailRepository;
			_dvsUserManager = dvsUserManager;
			_configManager = configManager;
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="EmbbedVersionController"/> class.
 /// </summary>
 /// <param name="notificationManager">The notification manager.</param>
 /// <param name="restService">The rest service.</param>
 /// <param name="configHelper">The configuration helper.</param>
 /// <param name="roslynDefaultPath">The roslyn default path.</param>
 public EmbbedVersionController(
     INotificationManager notificationManager,
     ISonarRestService restService,
     IConfigurationHelper configHelper,
     string roslynDefaultPath)
 {
     this.roslynHomeDiagPath = roslynDefaultPath;
     this.notificationManager = notificationManager;
     this.configHelper = configHelper;
     this.rest = restService;
     this.GenerateVersionData();
 }