public void StartAsyncTask(object workItemState) { IKernel kernel = KernelManager.GetKernel(); IConfig config = kernel.Get <IConfig>(); IPathHelper pathHelper = kernel.Get <IPathHelper>(); FullPathCleaner cleaner = new FullPathCleaner(s => Context.Server.MapPath(s)); string localPath = cleaner.CleanPath(Context.Request.Url.AbsolutePath); string repoFilePath = pathHelper.ConvertMdUriToLocalPath(Context.Request.Url.AbsolutePath, s => cleaner.CleanPath(s)); string fileToReturn = File.Exists(localPath) ? localPath : repoFilePath; // see if the file exists, if so we need to write it to the response if (File.Exists(fileToReturn)) { var objImage = System.Drawing.Bitmap.FromFile(fileToReturn); MemoryStream objMemoryStream = new MemoryStream(); objImage.Save(objMemoryStream, System.Drawing.Imaging.ImageFormat.Png); byte[] imageContent = new byte[objMemoryStream.Length]; objMemoryStream.Position = 0; objMemoryStream.Read(imageContent, 0, (int)objMemoryStream.Length); Context.Response.ContentType = "image/png"; Context.Response.BinaryWrite(imageContent); } else { Context.Response.StatusCode = 404; } Completed = true; Callback(this); }
public InspectInIndexStore(IContentLoader contentLoader, IPathHelper pathHelper, IFindUIConfiguration findUiConfiguration, LanguageRoutingFactory languageRoutingFactory) { _contentLoader = contentLoader; _pathHelper = pathHelper; _findUiConfiguration = findUiConfiguration; _languageRoutingFactory = languageRoutingFactory; }
public MarkdownBaseController(IConfig config, IMarkdownToHtml markdownToHtml, IContentRepository contentRepo, GitHelper gitHelper, IPathHelper pathHelper ) { if (config == null) { throw new ArgumentNullException("config"); } if (markdownToHtml == null) { throw new ArgumentNullException("markdownToHtml"); } if (contentRepo == null) { throw new ArgumentNullException("contentRepo"); } this.Config = config; this.MarkdownToHtml = markdownToHtml; this.ContentRepo = contentRepo; this.PathHelper = pathHelper; this.GitHelper = gitHelper; }
public MessageToBatchConverter( IAdjustmentLettersConfiguration config, IPathHelper pathHelper) { this.config = config; this.pathHelper = pathHelper; }
private UpidaContext() { this.propertyMetaFactory = new PropertyMetaFactory(this); this.pathHelper = new Upida.Validation.Impl.PathHelper(); this.checker = new Upida.Validation.Impl.Checker(); this.math = new Upida.Validation.Impl.Math(); }
public WeekPlanService( IJobProvider jobProvider, IMemberService memberService, IGroupService groupService, IDayAssignService dayAssignService, IJobStatusLogService jobStatusLogService, IPathHelper pathHelper, IManagementDepartmentService managementDepartmentService, IJobService jobService, IAppSettingHelper appSettingHelper, IJobStatusService jobStatusService) { this.jobProvider = jobProvider; this.memberService = memberService; this.groupService = groupService; this.dayAssignService = dayAssignService; this.jobStatusLogService = jobStatusLogService; this.pathHelper = pathHelper; this.managementDepartmentService = managementDepartmentService; this.jobService = jobService; this.appSettingHelper = appSettingHelper; this.jobStatusService = jobStatusService; logger = LogManager.GetLogger("MoveExpiriedJobsLog"); }
internal ProjectAnalyzer(AnalyzerManager manager, string projectPath) { Manager = manager; ProjectPath = projectPath; _projectDocument = GetProjectDocument(projectPath); // Get the paths _pathHelper = PathHelperFactory.GetPathHelper(projectPath, _projectDocument); // Preload/enforce referencing some required asemblies Copy copy = new Copy(); // Set global properties _globalProperties = new Dictionary <string, string> { { MsBuildProperties.SolutionDir, manager.SolutionDirectory ?? Path.GetDirectoryName(projectPath) }, { MsBuildProperties.MSBuildExtensionsPath, _pathHelper.ExtensionsPath }, { MsBuildProperties.MSBuildSDKsPath, _pathHelper.SDKsPath }, { MsBuildProperties.RoslynTargetsPath, _pathHelper.RoslynTargetsPath }, { MsBuildProperties.DesignTimeBuild, "true" }, { MsBuildProperties.BuildProjectReferences, "false" }, { MsBuildProperties.SkipCompilerExecution, "true" }, { MsBuildProperties.ProvideCommandLineArgs, "true" }, // Workaround for a problem with resource files, see https://github.com/dotnet/sdk/issues/346#issuecomment-257654120 { MsBuildProperties.GenerateResourceMSBuildArchitecture, "CurrentArchitecture" } }; // Create the logger if (manager.ProjectLogger != null) { _logger = new ConsoleLogger(manager.LoggerVerbosity, x => LoggerExtensions.LogInformation(manager.ProjectLogger, x), null, null); } }
/// <summary> /// Initializes new instance of the ValidationContext class /// </summary> public UpidaValidationContext(IUpidaContext context) { this.math = context.Math; this.pathHelper = context.PathHelper; this.checker = context.Checker; this.path = this.pathHelper.CreateNew(); this.isValid = true; }
public void SetUp() { _personDeserializerFactory = A.Fake <IPersonDeserializerFactory>(); _directoryHelper = A.Fake <IDirectoryHelper>(); _fileHelper = A.Fake <IFileHelper>(); _pathHelper = A.Fake <IPathHelper>(); _objectUnderTest = new PeopleCache(_personDeserializerFactory, _directoryHelper, _fileHelper, _pathHelper); }
public EndpointCache(IPathHelper pathHelper) { _pathHelper = pathHelper; if (_endpointsById == null) { _endpointsById = new Dictionary <string, Endpoint>(); } }
// private IBackgroundWorkerHelper backgroundWorkerHelper; public TestHelperFactory() { winHelperFactory = new WinHelperFactory(); messageHelper = new TestMessageHelper(); // redirectHelper = winHelperFactory.RedirectHelper; redirectHelper = new TestRedirectHelper(); pathHelper = winHelperFactory.PathHelper; }
public LogService(IPathHelper pathHelper) { _pathHelper = pathHelper; string logDir = pathHelper.GetLogDirectory(); if (!Directory.Exists(logDir)) Directory.CreateDirectory(logDir); }
public EndpointDefinitionFactory( IPathHelper pathHelper, IWcfClientBuilder wcfClientBuilder, IConfigHelper configHelper) { _pathHelper = pathHelper; _wcfClientBuilder = wcfClientBuilder; _configHelper = configHelper; }
public LootSplitterStepTwo( IGroupCalculatorService groupCalculatorService, IFormOpener formOpener, IPathHelper pathHelper) { _groupCalculatorService = groupCalculatorService; _formOpener = formOpener; _pathHelper = pathHelper; }
public ScaffolderDependencies( IPathHelper pathHelper, IFileWriter fileWriter, INamespaceHelper @namespace, INameHelper namer) { PathHelper = pathHelper; FileWriter = fileWriter; Namespace = @namespace; Namer = namer; }
public static TransferProgress From(string src, IPathHelper srcPathHelper, string dest, IPathHelper destPathHelper) { return(new TransferProgress() { Type = ProgressType.Running, Source = src, SourcePathHelper = srcPathHelper, Destination = dest, DestinationPathHelper = destPathHelper }); }
/// <summary> /// Add a slash "\" to front of input if not exists. /// </summary> public static string AppendFrontSlash(this IPathHelper pathHelper, string input) { if (input.StartsWith(pathHelper.Separator + "")) { return(input); } else { return(pathHelper.Separator + input); } }
/// <summary> /// Add a slash "\" to end of input if not exists. /// </summary> public static string AppendSlash(this IPathHelper pathHelper, string input) { if (input.EndsWith(pathHelper.Separator + "")) { return(input); } else { return(input + pathHelper.Separator); } }
public PeopleCache(IPersonDeserializerFactory personDeserializerFactory, IDirectoryHelper directoryHelper, IFileHelper fileHelper, IPathHelper pathHelper) { _fileNameBasedPeopleDictionary = new ConcurrentDictionary <string, IEnumerable <Person> >(); _personDeserializerFactory = personDeserializerFactory; _directoryHelper = directoryHelper; _fileHelper = fileHelper; _pathHelper = pathHelper; }
public void SetUp() { _directoryPathValidator = A.Fake <IDirectoryHelper>(); _notifier = A.Fake <INotifier>(); _pathHelper = A.Fake <IPathHelper>(); _directoryMonitor = A.Fake <IDirectoryMonitor>(); _peopleCache = A.Fake <IPeopleCache>(); _peopleAverageAgeEvaluator = A.Fake <IPeopleAverageAgeEvaluator>(); _averagePeopleAgePerCountrySerializer = A.Fake <ISerializer <AveragePeopleAgePerCountry> >(); _fileHelper = A.Fake <IFileHelper>(); _objectUnderTest = new AgeAggregatorService(_directoryPathValidator, _notifier, _pathHelper, _directoryMonitor, _peopleCache, _peopleAverageAgeEvaluator, _averagePeopleAgePerCountrySerializer, _fileHelper); }
public WordService(ISecurityUserService securityUserService, IFileSystemService fileSystemService, IPathHelper pathHelper, ICacheWrapper cache, IUnitOfWorkFactory unitOfWorkFactory) { _securityUserService = securityUserService; _fileSystemService = fileSystemService; _pathHelper = pathHelper; _cache = cache; _unitOfWorkFactory = unitOfWorkFactory; }
public HomeController(ILogger <HomeController> logger, IUserService userService, MazeBuilder mazeBuilder, IMapper mapper, IPathHelper pathHelper) { _logger = logger; _userService = userService; _mazeBuilder = mazeBuilder; _mapper = mapper; _pathHelper = pathHelper; }
public AdminController( IProductService productService, IImageHandler imageHandler, IPathHelper pathHelper, ICategoryService categoryService, IOrderService orderService) { this.productService = productService; this.imageHandler = imageHandler; this.pathHelper = pathHelper; this.categoryService = categoryService; this.orderService = orderService; }
public static string RemoveExtension(this IPathHelper pathHelper, string input) { string extenion = pathHelper.GetExtension(input); if (!String.IsNullOrEmpty(extenion)) { return(input.Substring(0, input.LastIndexOf(extenion))); } else { return(input); } }
public HistoryService( IJobStatusLogService jobStatusLogService, IJobService jobService, IPathHelper pathHelper, IMemberService memberService, IDayAssignService dayAssignService) { this.jobStatusLogService = jobStatusLogService; this.jobService = jobService; this.pathHelper = pathHelper; this.memberService = memberService; this.dayAssignService = dayAssignService; }
/// <summary> /// Return the first directory found from the input. /// (E.g. ExtractFirstDir("\temp\1\2",0) will return "Temp") /// </summary> public static string ExtractFirstDir(this IPathHelper pathHelper, string input, Int32 startIndex) { if (input.Length < startIndex) { return(""); } Int32 idx = input.IndexOf(pathHelper.Separator, startIndex); if (idx == -1) { return(input.Substring(startIndex)); } return(input.Substring(startIndex, idx - startIndex)); }
public UserController(IUserRepository userRepository, IMapper mapper, IUserService userService, ICurrencyService currencyService, IBankAccountRepository bankAccountRepository, ILogger <UserController> logger, IPathHelper pathHelper, ISmsService smsService) { _userRepository = userRepository; _mapper = mapper; _userService = userService; _currencyService = currencyService; _bankAccountRepository = bankAccountRepository; _logger = logger; _pathHelper = pathHelper; _smsService = smsService; }
public AgeAggregatorService(IDirectoryHelper directoryPathValidator, INotifier notifier, IPathHelper pathHelper, IDirectoryMonitor directoryMonitor, IPeopleCache peopleCache, IPeopleAverageAgeEvaluator peopleAverageAgeEvaluator, ISerializer <AveragePeopleAgePerCountry> averagePeopleAgePerCountrySerializer, IFileHelper fileHelper) { _directoryPathValidator = directoryPathValidator; _notifier = notifier; _pathHelper = pathHelper; _directoryMonitor = directoryMonitor; _peopleCache = peopleCache; _peopleAverageAgeEvaluator = peopleAverageAgeEvaluator; _averagePeopleAgePerCountrySerializer = averagePeopleAgePerCountrySerializer; _fileHelper = fileHelper; }
public MemberService( IRepository <Member> memberRepository, IAuthenticationService authenticationService, IFileHelper fileHelper, IPathHelper pathHelper, IManagementDepartmentService managementDepartmentService, ISecurityService securityService, IAppSettingHelper appSettingHelper) { this.memberRepository = memberRepository; this.authenticationService = authenticationService; this.fileHelper = fileHelper; this.pathHelper = pathHelper; this.managementDepartmentService = managementDepartmentService; this.securityService = securityService; this.appSettingHelper = appSettingHelper; logger = LogManager.GetLogger("SyncMembersLog"); }
/// <summary> /// Ctor /// </summary> /// <param name="appSettingsConfig"></param> /// <param name="logger"></param> /// <param name="httpContextAccessor"></param> /// <param name="fileSystem"></param> /// <param name="pathHelper"></param> public LogFilesHealthCheck(AppSettingsConfig appSettingsConfig, ILogger <LogFilesHealthCheck> logger, IHttpContextAccessor httpContextAccessor, IFileSystem fileSystem, IPathHelper pathHelper) { _appSettingsConfig = appSettingsConfig; _logger = logger; _httpContextAccessor = httpContextAccessor; _fileSystem = fileSystem; _pathHelper = pathHelper; // Initialize Health Check AppSettings var apiRegex = _appSettingsConfig.HealthCheckSettings.ApiRegex; _apiRegex = new Regex(apiRegex); var jobsRegex = _appSettingsConfig.HealthCheckSettings.JobsRegex; _jobsRegex = new Regex(jobsRegex); var mobileRegex = _appSettingsConfig.HealthCheckSettings.MobileRegex; _mobileRegex = new Regex(mobileRegex); _logFilesDatePattern = _appSettingsConfig.HealthCheckSettings.LogFilesDatePattern; _mobileLogFilesDatePattern = _appSettingsConfig.HealthCheckSettings.MobileLogFilesDatePattern; }
public AdjustmentLettersRequestProcessor( ILifetimeScope component, IExchangePublisher <CreateBatchAdjustmentLettersResponse> publisher, IMessageToBatchConverter requestSplitter, ILetterGenerator letterGenerator, IFileWriter fileWriter, IPathHelper pathHelper, IFileReader fileReader, IAsposeWrapper asposeWrapper, IReferenceDbContext dbContext = null) { this.component = component; this.publisher = publisher; this.messageConverter = requestSplitter; this.letterGenerator = letterGenerator; this.fileWriter = fileWriter; this.pathHelper = pathHelper; this.fileReader = fileReader; this.asposeWrapper = asposeWrapper; this.dbContext = dbContext; }
public SshCredsManager(EnvironmentConfiguration config, IKeyVaultManager keyVaultManager, ICredentialLookup credentialLookup, IShellRunner shellRunner, IVmManager vmManager, IPathHelper appFolderFinder, ILogger <SshCredsManager> logger, IOSHandler osHandler, IMachineIpManager machineIpManager) { this.config = config; this.keyVaultManager = keyVaultManager; this.credentialLookup = credentialLookup; this.shellRunner = shellRunner; this.vmManager = vmManager; this.appFolderFinder = appFolderFinder; this.logger = logger; this.osHandler = osHandler; this.machineIpManager = machineIpManager; sshHostLookup = new Lazy <Task <string> >(() => vmManager.GetPublicIp(config.PublicIpName)); sshStateLoad = new Lazy <Task <SshState> >(() => LoadSshState()); }
public void Setup() { _pathHelper = _mock.StrictMock(typeof(IPathHelper)) as IPathHelper; _pather = new Pather(_pathHelper); }
public OpenIdConfigService(IPathHelper pathHelper, ICacheWrapper cache) { _pathHelper = pathHelper; _cache = cache; }
public MarkdownController(IConfig config, IMarkdownToHtml markdownToHtml, IContentRepository contentRepo, GitHelper gitHelper, IPathHelper pathHelper) : base(config, markdownToHtml, contentRepo, gitHelper, pathHelper) { }
public ShareService(IPathHelper pathHelper, IHashService hashService) { _pathHelper = pathHelper; _hashService = hashService; }
public Pather(IPathHelper pathHelper) { _pathHelper = pathHelper; }
public FileContentRepository(IPathHelper pathHelper) { _pathHelper = pathHelper; }
public DashboardController(IUsersRepository repository, IPathHelper path) { _users = repository; _path = path; }
public IconService(IPathHelper pathHelper) { this._pathHelper = pathHelper; }