コード例 #1
0
        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);
        }
コード例 #2
0
 public InspectInIndexStore(IContentLoader contentLoader, IPathHelper pathHelper, IFindUIConfiguration findUiConfiguration, LanguageRoutingFactory languageRoutingFactory)
 {
     _contentLoader          = contentLoader;
     _pathHelper             = pathHelper;
     _findUiConfiguration    = findUiConfiguration;
     _languageRoutingFactory = languageRoutingFactory;
 }
コード例 #3
0
        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;
        }
コード例 #4
0
 public MessageToBatchConverter(
     IAdjustmentLettersConfiguration config,
     IPathHelper pathHelper)
 {
     this.config     = config;
     this.pathHelper = pathHelper;
 }
コード例 #5
0
 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();
 }
コード例 #6
0
        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");
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
 /// <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;
 }
コード例 #9
0
 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);
 }
コード例 #10
0
ファイル: EndpointCache.cs プロジェクト: 21robin12/wcfpad
        public EndpointCache(IPathHelper pathHelper)
        {
            _pathHelper = pathHelper;

            if (_endpointsById == null)
            {
                _endpointsById = new Dictionary <string, Endpoint>();
            }
        }
コード例 #11
0
//		private IBackgroundWorkerHelper backgroundWorkerHelper;

        public TestHelperFactory()
        {
            winHelperFactory = new WinHelperFactory();

            messageHelper = new TestMessageHelper();
//			redirectHelper = winHelperFactory.RedirectHelper;
            redirectHelper = new TestRedirectHelper();
            pathHelper     = winHelperFactory.PathHelper;
        }
コード例 #12
0
ファイル: LogService.cs プロジェクト: altaricka/vDesign
        public LogService(IPathHelper pathHelper)
        {
            _pathHelper = pathHelper;

            string logDir = pathHelper.GetLogDirectory();

            if (!Directory.Exists(logDir))
                Directory.CreateDirectory(logDir);
        }
コード例 #13
0
 public EndpointDefinitionFactory(
     IPathHelper pathHelper,
     IWcfClientBuilder wcfClientBuilder,
     IConfigHelper configHelper)
 {
     _pathHelper       = pathHelper;
     _wcfClientBuilder = wcfClientBuilder;
     _configHelper     = configHelper;
 }
コード例 #14
0
 public LootSplitterStepTwo(
     IGroupCalculatorService groupCalculatorService,
     IFormOpener formOpener,
     IPathHelper pathHelper)
 {
     _groupCalculatorService = groupCalculatorService;
     _formOpener             = formOpener;
     _pathHelper             = pathHelper;
 }
コード例 #15
0
 public ScaffolderDependencies(
     IPathHelper pathHelper,
     IFileWriter fileWriter,
     INamespaceHelper @namespace,
     INameHelper namer)
 {
     PathHelper = pathHelper;
     FileWriter = fileWriter;
     Namespace  = @namespace;
     Namer      = namer;
 }
コード例 #16
0
 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
     });
 }
コード例 #17
0
 /// <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);
     }
 }
コード例 #18
0
 /// <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);
     }
 }
コード例 #19
0
 public PeopleCache(IPersonDeserializerFactory personDeserializerFactory,
                    IDirectoryHelper directoryHelper,
                    IFileHelper fileHelper,
                    IPathHelper pathHelper)
 {
     _fileNameBasedPeopleDictionary = new ConcurrentDictionary <string, IEnumerable <Person> >();
     _personDeserializerFactory     = personDeserializerFactory;
     _directoryHelper = directoryHelper;
     _fileHelper      = fileHelper;
     _pathHelper      = pathHelper;
 }
コード例 #20
0
 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);
 }
コード例 #21
0
ファイル: WordService.cs プロジェクト: altaricka/vDesign
 public WordService(ISecurityUserService securityUserService,
     IFileSystemService fileSystemService,
     IPathHelper pathHelper,
     ICacheWrapper cache,
     IUnitOfWorkFactory unitOfWorkFactory)
 {
     _securityUserService = securityUserService;
     _fileSystemService = fileSystemService;
     _pathHelper = pathHelper;
     _cache = cache;
     _unitOfWorkFactory = unitOfWorkFactory;
 }
コード例 #22
0
 public HomeController(ILogger <HomeController> logger,
                       IUserService userService,
                       MazeBuilder mazeBuilder,
                       IMapper mapper,
                       IPathHelper pathHelper)
 {
     _logger      = logger;
     _userService = userService;
     _mazeBuilder = mazeBuilder;
     _mapper      = mapper;
     _pathHelper  = pathHelper;
 }
コード例 #23
0
ファイル: AdminController.cs プロジェクト: kolev9605/rentx
 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;
 }
コード例 #24
0
        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);
            }
        }
コード例 #25
0
 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;
 }
コード例 #26
0
        /// <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));
        }
コード例 #27
0
 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;
 }
コード例 #28
0
        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;
        }
コード例 #29
0
 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;
 }
コード例 #30
0
ファイル: MemberService.cs プロジェクト: Ejendomsdrift/edrift
        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");
        }
コード例 #31
0
        /// <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;
        }
コード例 #32
0
 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;
 }
コード例 #33
0
 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());
 }
コード例 #34
0
 public void Setup()
 {
     _pathHelper = _mock.StrictMock(typeof(IPathHelper)) as IPathHelper;
     _pather = new Pather(_pathHelper);
 }
コード例 #35
0
 public OpenIdConfigService(IPathHelper pathHelper, ICacheWrapper cache)
 {
     _pathHelper = pathHelper;
     _cache = cache;
 }
コード例 #36
0
 public MarkdownController(IConfig config, IMarkdownToHtml markdownToHtml, IContentRepository contentRepo, GitHelper gitHelper, IPathHelper pathHelper)
     : base(config, markdownToHtml, contentRepo, gitHelper, pathHelper)
 {
 }
コード例 #37
0
ファイル: ShareService.cs プロジェクト: TGebreyes/trackyt.net
 public ShareService(IPathHelper pathHelper, IHashService hashService)
 {
     _pathHelper = pathHelper;
     _hashService = hashService;
 }
コード例 #38
0
ファイル: Pather.cs プロジェクト: jestin/ToolPathGenerator
 public Pather(IPathHelper pathHelper)
 {
     _pathHelper = pathHelper;
 }
コード例 #39
0
 public FileContentRepository(IPathHelper pathHelper)
 {
     _pathHelper = pathHelper;
 }
コード例 #40
0
 public DashboardController(IUsersRepository repository, IPathHelper path)
 {
     _users = repository;
     _path = path;
 }
コード例 #41
0
ファイル: IconService.cs プロジェクト: altaricka/vDesign
 public IconService(IPathHelper pathHelper)
 {
     this._pathHelper = pathHelper;
 }