public ProjectController(IRepository rep)
     : base(rep)
 {
     _projectService = new ProjectService(rep);
      _fileStore = new DiskFileStore();
     _layoutdb = new LayoutEntities();
 }
Esempio n. 2
0
        public FileManagementService(IFileRepository repository, IFileStore fileStore)
        {
            _repository = repository;
            _repository.FileDeleted += (s, e) => { DeletePhysicalFile(e.UploadedFile); };

            _fileStore = fileStore;
        }
Esempio n. 3
0
 public HomeController(IUserService userService, IUserMembershipService userMembershipService, IFileStore fileStore, IUnitOfWork unitOfWork)
     : base(unitOfWork)
 {
     _userService = userService;
     _userMembershipService = userMembershipService;
     _fileStore = fileStore;
 }
Esempio n. 4
0
 public static void AddFiles(IFileStore store,
                         IEnumerable<WeakReference> items)
 {
     var storeRef = new WeakReference(store);
       foreach (var i in items) {
     queue.Add(new Item(storeRef, i));
       }
 }
        public ThespianViewController(IThespianViewThespianService service, IFileStore fileStore)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            this.service = service;
            this.fileStore = fileStore;
        }
        public TeamViewController(ITeamViewEmployeeService service, IFileStore fileStore)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            this.service = service;
            this.fileStore = fileStore;
        }
        public CreateThespianPreCommand(IThespianManagementThespianValidatorResolver validatorResolver, IFileStore fileStore)
        {
            if (validatorResolver == null)
                throw new ArgumentNullException("validatorResolver");

            this.validatorResolver = validatorResolver;
            this.fileStore = fileStore;
        }
        public CreateTeamEmployeePreCommand(ITeamManagementEmployeeValidatorResolver validatorResolver, IFileStore fileStore)
        {
            if (validatorResolver == null)
                throw new ArgumentNullException("validatorResolver");

            this.validatorResolver = validatorResolver;
            this.fileStore = fileStore;
        }
Esempio n. 9
0
 public BatchPostHandler(
     IRepository<Batch> batches,
     BatchFactory batchFactory,
     IFileStore fileStore)
 {
     _batches = batches;
     _batchFactory = batchFactory;
     _fileStore = fileStore;
 }
Esempio n. 10
0
 public ReportsController(IUnitOfWork unitOfWork)
     : base(unitOfWork)
 {
     _categoryRepostitory = new CategoryRepostitory(unitOfWork);
     _tasklogRepository = new TasklogRepository(unitOfWork);
     _montReportDocRepository = new MontReportDocRepository(unitOfWork);
     _stateCategoryRepostitory = new StateCategoryRepostitory(unitOfWork);
     _tasknodeRep = new TaskRepository(unitOfWork);
     _fileStore = new DiskFileStore();
 }
Esempio n. 11
0
 public ToChucController(IToChucRepository tochucRepository,
     ILoaiHinhToChucRepository loaihinhtochucRepository,
     ITaiKhoanRepository taikhoanRepository,
     IFileStore fileStore)
 {
     this._tochucRepository = tochucRepository;
     this._loaihinhtochucRepository = loaihinhtochucRepository;
     this._taikhoanRepository = taikhoanRepository;
     this._fileStore = fileStore;
 }
Esempio n. 12
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="url"></param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="access"></param>
        /// <param name="management"></param>
        /// <param name="connectionString"></param>
        /// <param name="fileNamespace"></param>
        internal FedoraCommonsRepo(string url, string userName, string password, string access, string management, string connectionString, string fileNamespace, string identity="")
        {
            _metadataStore = new MySqlMetadataStore(connectionString);

            _fileStore = new FedoraFileStore(url, userName, password, access, management, fileNamespace);

            //_fileStore = new LocalFileSystemStore();

            _identity = identity;
        }
Esempio n. 13
0
 public ProjectController(IUnitOfWork unitOfWork)
     : base(unitOfWork)
 {
     _projectRepository = new ProjectRepository(unitOfWork);
     _categoryRepostitory =new CategoryRepostitory(unitOfWork);
     _tasklogRepository = new TasklogRepository(unitOfWork);
     _documentRepository = new DocumentRepository(unitOfWork);
     _fileStore = new DiskFileStore();
     _feeRepository = new PaidFeeRepository(unitOfWork);
     _userRepository = new UserRepository(unitOfWork);
 }
Esempio n. 14
0
 public PresentationService(
     IRepository<Batch> batches,
     IRepository<Template> templates,
     ILatexEngine latexEngine,
     IRazorEngine razorEngine,
     IFileStore fileStore)
 {
     _batches = batches;
     _templates = templates;
     _latexEngine = latexEngine;
     _razorEngine = razorEngine;
     _fileStore = fileStore;
 }
Esempio n. 15
0
 public CallbackController(
     DocumentsAPIConfiguration documentsAPIConfiguration,
     QueueSender queueSender,
     IFileStore fileStore,
     FileContentsService fileContentsService,
     ISecurityContext securityContext
     ) : base(securityContext)
 {
     this.DocumentsAPIConfiguration = documentsAPIConfiguration;
     this.QueueSender         = queueSender;
     this.FileStore           = fileStore;
     this.FileContentsService = fileContentsService;
     this.SecurityContext     = securityContext;
 }
Esempio n. 16
0
 public UserViewProvider(
     IShellSettings shellSettings,
     IPlatoUserStore <User> platoUserStore,
     UserManager <User> userManager,
     IUserPhotoStore <UserPhoto> userPhotoStore,
     ISitesFolder sitesFolder,
     IHostingEnvironment hostEnvironment,
     IFileStore fileStore)
 {
     _platoUserStore = platoUserStore;
     _userManager    = userManager;
     _userPhotoStore = userPhotoStore;
     _sitesFolder    = sitesFolder;
 }
Esempio n. 17
0
        private string Preprocess(IFileStore store, string path, string[] defines)
        {
            var builder = new StringBuilder();

            if (defines != null)
            {
                for (int i = 0; i < defines.Length; ++i)
                {
                    builder.AppendLine("#define " + defines[i] + " 1");
                }
            }
            Preprocess(builder, store, AssetPath.GetDirectoryName(path), AssetPath.GetFileName(path), 0);
            return(builder.ToString());
        }
Esempio n. 18
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="jsonConverter">Parameter to work with json converter</param>
        /// <param name="fileStore">Parameter to work with files</param>
        /// <param name="httpService">Parameter to work with http service</param>
        public FlightsListViewModel(
            IJsonConverter jsonConverter,
            IFileStore fileStore,
            IHttpService httpService)
        {
            _httpService   = httpService;
            _jsonConverter = jsonConverter;
            _fileStore     = fileStore;
            _flightsList   = new ObservableCollection <FlyInfoShow>();

            ShowInfoAboutFlightsCommand = new MvxCommand(() => ShowViewModel <AboutFlightsViewModel>());
            AddToFavoritesCommand       = new MvxCommand(AddToFavorites);
            ShowFlightDetailsCommand    = new MvxCommand <object>(ShowFlightDetails);
        }
Esempio n. 19
0
 public BackupService(ICloudBackupService cloudBackupService,
                      IFileStore fileStore,
                      ISettingsFacade settingsFacade,
                      IConnectivityAdapter connectivity,
                      IContextAdapter contextAdapter,
                      IMessenger messenger)
 {
     this.cloudBackupService = cloudBackupService;
     this.fileStore          = fileStore;
     this.settingsFacade     = settingsFacade;
     this.connectivity       = connectivity;
     this.contextAdapter     = contextAdapter;
     this.messenger          = messenger;
 }
Esempio n. 20
0
        /// <summary>
        /// Will process the report generated by the Compare methods by adding, removing and updating files to the <paramref name="destStore"/> file store.
        /// </summary>
        /// <param name="report">The report, generated by one of the Compare methods, to process.</param>
        /// <param name="sourcePath">The source directory to process.</param>
        /// <param name="destStore">The file store to process.</param>
        /// <param name="feedback">Provides a means to gather feedback from the mirroring process.</param>
        public static void MirrorSourceToDestination(
            IEnumerable <ICompareResult> report,
            string sourcePath,
            IFileStore destStore,
            Action <ICompareResult, double> feedback)
        {
            // **** initialize
            var total = (from x in report
                         where x.ItemType == CompareType.File &&
                         (x.Action == CompareAction.New || x.Action == CompareAction.Update || x.Action == CompareAction.Remove)
                         select x).Count();
            var count = 0;
            // **** save the original 'original filenames'
            var originalFilenames = ((IFileStoreAdvanced)destStore).GetOriginalFilenames();

            // **** delete REMOVE files from MIRROR
            foreach (var item in from x in report
                     where x.ItemType == CompareType.File && x.Action == CompareAction.Remove
                     select x)
            {
                if (feedback != null)
                {
                    feedback(item, (double)((double)count / (double)total));
                    ++count;
                }
                if (destStore.Contains(item.DestinationRootFilename))
                {
                    destStore.Delete(item.DestinationRootFilename);
                }
            }
            // **** add NEW and UPDATE files to SOURCE
            foreach (var item in from x in report
                     where x.ItemType == CompareType.File &&
                     (x.Action == CompareAction.New || x.Action == CompareAction.Update)
                     select x)
            {
                if (feedback != null)
                {
                    feedback(item, (double)((double)count / (double)total));
                    ++count;
                }
                destStore.Add(item.SourceRootFilename, item.SourceFullPath, item.SourceLastModifiedTimeUtc, item.SourceFileSizeInBytes);
            }
            // **** save store (finalize mirror process)
            feedback?.Invoke(null, 1);
            destStore.Save(false);
            // **** clear/restore the 'original filenames'
            ((IFileStoreAdvanced)destStore).ClearOriginalFilenames();
            ((IFileStoreAdvanced)destStore).SetOriginalFilenames(originalFilenames);
        }
 public RetrieveResourceServiceTests(DataStoreTestsFixture blobStorageFixture, SqlDataStoreTestsFixture sqlIndexStorageFixture)
 {
     EnsureArg.IsNotNull(sqlIndexStorageFixture, nameof(sqlIndexStorageFixture));
     EnsureArg.IsNotNull(blobStorageFixture, nameof(blobStorageFixture));
     _indexDataStore                = sqlIndexStorageFixture.IndexDataStore;
     _instanceStore                 = sqlIndexStorageFixture.InstanceStore;
     _fileStore                     = blobStorageFixture.FileStore;
     _retrieveTranscoder            = Substitute.For <ITranscoder>();
     _frameHandler                  = Substitute.For <IFrameHandler>();
     _retrieveTransferSyntaxHandler = new RetrieveTransferSyntaxHandler(NullLogger <RetrieveTransferSyntaxHandler> .Instance);
     _recyclableMemoryStreamManager = blobStorageFixture.RecyclableMemoryStreamManager;
     _retrieveResourceService       = new RetrieveResourceService(
         _instanceStore, _fileStore, _retrieveTranscoder, _frameHandler, _retrieveTransferSyntaxHandler, NullLogger <RetrieveResourceService> .Instance);
 }
Esempio n. 22
0
 public RetrieveResourceServiceTests()
 {
     _instanceStore                 = Substitute.For <IInstanceStore>();
     _fileStore                     = Substitute.For <IFileStore>();
     _retrieveTranscoder            = Substitute.For <ITranscoder>();
     _dicomFrameHandler             = Substitute.For <IFrameHandler>();
     _retrieveTransferSyntaxHandler = new RetrieveTransferSyntaxHandler(NullLogger <RetrieveTransferSyntaxHandler> .Instance);
     _logger = NullLogger <RetrieveResourceService> .Instance;
     _recyclableMemoryStreamManager = new RecyclableMemoryStreamManager();
     _dicomRequestContextAccessor   = Substitute.For <IDicomRequestContextAccessor>();
     _dicomRequestContextAccessor.RequestContext.DataPartitionEntry = new PartitionEntry(DefaultPartition.Key, DefaultPartition.Name);
     _retrieveResourceService = new RetrieveResourceService(
         _instanceStore, _fileStore, _retrieveTranscoder, _dicomFrameHandler, _retrieveTransferSyntaxHandler, _dicomRequestContextAccessor, _logger);
 }
Esempio n. 23
0
        public async Task UploadedFileRepository_MetadataFileMissing_GetFile_ReturnsNull()
        {
            // Given
            IFileStore fileStore = Substitute.For <IFileStore>();

            fileStore.GetMetadataFile(Arg.Any <FileIdentifier>()).Returns(new NotFoundFileInfo("_"));

            // When
            IUploadedFileRepository testObject    = new UploadedFileRepository(fileStore, null, null, FakeLogger.Get <UploadedFileRepository>());
            UploadedFile            returnedValue = await testObject.GetFile(FileIdentifier.CreateNew());

            // Then
            Assert.That(returnedValue, Is.Null);
        }
Esempio n. 24
0
        public HomeController(
            IFileViewIncrementer <File> fileViewIncrementer,
            IEntityFileStore <EntityFile> entityFileStore,
            IAuthorizationService authorizationService,
            IEntityService <Topic> entityService,
            IFileStore <File> fileStore)
        {
            _authorizationService = authorizationService;
            _fileViewIncrementer  = fileViewIncrementer;
            _entityFileStore      = entityFileStore;
            _entityService        = entityService;

            _fileStore = fileStore;
        }
Esempio n. 25
0
 public WPMessageHandler(IFileStore fileStore, IHttpContextAccessor httpContext, WPCacheService cache, WPUserService userService, WPProxySettings settings, WPProxySiteSettingsAccessor siteSettings) : base(new SocketsHttpHandler()
 {
     UseProxy               = false,
     AllowAutoRedirect      = false,
     AutomaticDecompression = DecompressionMethods.All,
     UseCookies             = false
 })
 {
     FileStore    = fileStore;
     Context      = httpContext;
     Cache        = cache;
     UserService  = userService;
     Settings     = settings;
     SiteSettings = siteSettings;
 }
Esempio n. 26
0
        public LetterController(
            IInMemoryLetterRenderer letterRenderer,
            IFileStore fileStore,
            IShellSettings shellSettings,
            ISitesFolder sitesFolder,
            IHostingEnvironment hostEnvironment)
        {
            _letterRenderer  = letterRenderer;
            _fileStore       = fileStore;
            _sitesFolder     = sitesFolder;
            _hostEnvironment = hostEnvironment;

            _pathToImages = fileStore.Combine(hostEnvironment.ContentRootPath, shellSettings.Location, "images");
            _urlToImages  = $"/sites/{shellSettings.Location.ToLower()}/images/";
        }
Esempio n. 27
0
 public StoreOrchestrator(
     IDicomRequestContextAccessor contextAccessor,
     IFileStore fileStore,
     IMetadataStore metadataStore,
     IIndexDataStore indexDataStore,
     IDeleteService deleteService,
     IQueryTagService queryTagService)
 {
     _contextAccessor = EnsureArg.IsNotNull(contextAccessor, nameof(contextAccessor));
     _fileStore       = EnsureArg.IsNotNull(fileStore, nameof(fileStore));
     _metadataStore   = EnsureArg.IsNotNull(metadataStore, nameof(metadataStore));
     _indexDataStore  = EnsureArg.IsNotNull(indexDataStore, nameof(indexDataStore));
     _deleteService   = EnsureArg.IsNotNull(deleteService, nameof(deleteService));
     _queryTagService = EnsureArg.IsNotNull(queryTagService, nameof(queryTagService));
 }
Esempio n. 28
0
 public void Dispose()
 {
     lock (this)
     {
         if (_packages != null)
         {
             foreach (Package p in _packages.Values)
             {
                 p.Dispose();
             }
         }
         _packages          = null;
         _cachedFileStorage = null;
     }
 }
Esempio n. 29
0
 internal void Start()
 {
     if (DataInMemory)
     {
         FileStore         = new FileStoreMemory();
         PackageCollection = new JSONMemoryStore <Package>();
     }
     else
     {
         //TODO: allow different types of stores (e.g.: mongodb)
         FileStore         = new FileStoreFilesystem(ConfigurationStore);
         PackageCollection = new JSONStore <Package>(ConfigurationStore.DatabaseFile.Value);
     }
     PackageDAO = new PackageDAO(PackageCollection, FileStore);
 }
Esempio n. 30
0
 internal void Start()
 {
     if (DataInMemory)
     {
         FileStore = new FileStoreMemory();
         PackageCollection = new JSONMemoryStore<Package>();
     }
     else
     {
         //TODO: allow different types of stores (e.g.: mongodb)
         FileStore = new FileStoreFilesystem(ConfigurationStore);
         PackageCollection = new JSONStore<Package>(ConfigurationStore.DatabaseFile.Value);
     }
     PackageDAO = new PackageDAO(PackageCollection, FileStore);
 }
Esempio n. 31
0
        public NotesController(IKntService service, IOptions <AppSettings> appSettings, IFileStore fileStore)
        {
            _service     = service;
            _appSettings = appSettings.Value;
            _fileStore   = fileStore;

            if (string.IsNullOrEmpty(_service.RepositoryRef.ResourcesContainerCacheRootPath))
            {
                _service.RepositoryRef.ResourcesContainerCacheRootPath = _fileStore.GetResourcesContainerRootPath();
            }
            if (string.IsNullOrEmpty(_service.RepositoryRef.ResourcesContainerCacheRootUrl))
            {
                _service.RepositoryRef.ResourcesContainerCacheRootUrl = _fileStore.GetResourcesContainerRootUrl();
            }
        }
Esempio n. 32
0
        public void Load(IFileStore store)
        {
            var kvp = new KeyValuePairs();

            using (var stream = store.OpenTextFile(m_path))
            {
                kvp.Load(stream);
            }

            m_modelPath       = kvp.GetString("model", null);
            m_altModelPath    = kvp.GetString("alt_model", m_modelPath);
            m_editorModelPath = kvp.GetString("editor_model", null);

            m_height      = kvp.GetInteger("height", 1);
            m_placeable   = kvp.GetBool("placeable", false);
            m_replaceable = kvp.GetBool("replaceable", false);

            m_solidity = new bool[6];
            bool solid = kvp.GetBool("solid", false);

            m_solidity[0] = kvp.GetBool("solid_front", solid);
            m_solidity[1] = kvp.GetBool("solid_right", solid);
            m_solidity[2] = kvp.GetBool("solid_back", solid);
            m_solidity[3] = kvp.GetBool("solid_left", solid);
            m_solidity[4] = kvp.GetBool("solid_top", solid);
            m_solidity[5] = kvp.GetBool("solid_bottom", solid);

            m_opacity = new bool[6];
            bool opaque = kvp.GetBool("opaque", false);

            m_opacity[0] = kvp.GetBool("opaque_front", opaque);
            m_opacity[1] = kvp.GetBool("opaque_right", opaque);
            m_opacity[2] = kvp.GetBool("opaque_back", opaque);
            m_opacity[3] = kvp.GetBool("opaque_left", opaque);
            m_opacity[4] = kvp.GetBool("opaque_top", opaque);
            m_opacity[5] = kvp.GetBool("opaque_bottom", opaque);

            m_forwardIncline = kvp.GetInteger("incline_forward", 0);
            m_rightIncline   = kvp.GetInteger("incline_right", 0);
            m_allowPlacement = kvp.GetBool("allow_placement", true);

            var behaviour = kvp.GetString("behaviour", "generic");

            m_behaviour = TileBehaviour.CreateFromName(behaviour, this, kvp);

            m_renderPass  = kvp.GetEnum("render_pass", RenderPass.Opaque);
            m_castShadows = kvp.GetBool("cast_shadows", true);
        }
Esempio n. 33
0
        public EmailFileInviteService(
            ICapturedRouterUrlHelper capturedRouterUrlHelper,
            IHtmlLocalizer htmlLocalizer,
            IContextFacade contextFacade,
            IFileStore <File> fileStore,
            IEmailManager emailManager,
            ILocaleStore localeStore)
        {
            _capturedRouterUrlHelper = capturedRouterUrlHelper;
            _contextFacade           = contextFacade;
            _emailManager            = emailManager;
            _localeStore             = localeStore;
            _fileStore = fileStore;

            T = htmlLocalizer;
        }
Esempio n. 34
0
        public MediaController(
            IMediaStore <Models.Media> mediaStore,
            IHostingEnvironment hostEnvironment,
            IFileStore fileStore)
        {
            _mediaStore = mediaStore;
            _fileStore  = fileStore;

            if (_pathToEmptyImage == null)
            {
                _pathToEmptyImage = _fileStore.Combine(hostEnvironment.ContentRootPath,
                                                       "wwwroot",
                                                       "images",
                                                       "photo.png");
            }
        }
Esempio n. 35
0
        public StoreOrchestrator(
            IFileStore fileStore,
            IMetadataStore metadataStore,
            IIndexDataStore indexDataStore,
            IDeleteService deleteService)
        {
            EnsureArg.IsNotNull(fileStore, nameof(fileStore));
            EnsureArg.IsNotNull(metadataStore, nameof(metadataStore));
            EnsureArg.IsNotNull(indexDataStore, nameof(indexDataStore));
            EnsureArg.IsNotNull(deleteService, nameof(deleteService));

            _fileStore      = fileStore;
            _metadataStore  = metadataStore;
            _indexDataStore = indexDataStore;
            _deleteService  = deleteService;
        }
Esempio n. 36
0
        public LetterController(
            IInMemoryLetterRenderer letterRenderer,
            IHostingEnvironment hostEnvironment,
            IShellSettings shellSettings,
            ISitesFolder sitesFolder,
            IFileStore fileStore)
        {
            _letterRenderer = letterRenderer;
            _sitesFolder    = sitesFolder;
            _fileStore      = fileStore;

            _pathToImages = fileStore.Combine(
                hostEnvironment.ContentRootPath,
                shellSettings.Location,
                "images");
        }
Esempio n. 37
0
        private static Dictionary <string, DataHolder> GatherInformation(IFileStore fileStore, System.Threading.CancellationToken cancelToken)
        {
            if (cancelToken.IsCancellationRequested)
            {
                return(null);
            }
            var gatheredInfo = new Dictionary <string, DataHolder>();
            var uniquePaths  = new HashSet <string>();

            // add all files & process unique directories
            foreach (var storeItem in fileStore.GetAll())
            {
                if (cancelToken.IsCancellationRequested)
                {
                    return(null);
                }
                gatheredInfo.Add(storeItem.RootFilename,
                                 new DataHolder()
                {
                    ItemType            = CompareType.File,
                    Name                = storeItem.RootFilename,
                    LastModifiedTimeUtc = NormalizeDateTime(storeItem.RootFileLastModifiedTimeUtc),
                    SizeInBytes         = storeItem.FileSize
                });
                var pathName = System.IO.Path.GetDirectoryName(storeItem.RootFilename);
                if (!uniquePaths.Contains(pathName))
                {
                    uniquePaths.Add(pathName);
                }
            }
            // add all sub-directories (this, may, include the root path "")
            foreach (var directoryName in uniquePaths)
            {
                if (cancelToken.IsCancellationRequested)
                {
                    return(null);
                }
                gatheredInfo.Add(NormalizeName("", directoryName),
                                 new DataHolder()
                {
                    ItemType = CompareType.Directory,
                    Name     = NormalizeName("", directoryName)
                });
            }
            // return gathered results
            return(gatheredInfo);
        }
        public static void Synchronize(IFileStore store, FileSupportEventArgs e)
        {
            // Если не известно имя файла, выходим.
              if (string.IsNullOrEmpty(e.ActualFileName) && string.IsNullOrEmpty(e.OldFileName))
            return;

              // Формируем путь к файлу в хранилище с учетом устанавливаемой директории.
              // Если имя файла не известно, оно не должно использоваться ниже.
              string actualRelativePath = e.ActualFileName != null ? Path.Combine(e.ActualDirectory ?? "", e.ActualFileName) : null;
              string oldRelativePath = e.OldFileName != null ? Path.Combine(e.OldDirectory ?? "", e.OldFileName) : null;

              // За один вызов может измениться либо имя файла, либо директория.

              // Новый файл.
              // Если в "сырых данных" указано имя файла с полным путем и старое имя пустое, то значит это новый файл.
              if (Path.IsPathRooted(e.RawFileName) && string.IsNullOrEmpty(e.OldFileName) && File.Exists(e.RawFileName))
              {
            store.AddFile(e.RawFileName, actualRelativePath);
              }
              // Удаление файла.
              // Если актуальное имя пустое, а старое есть в хранилище, удалим файл.
              else if (string.IsNullOrEmpty(e.ActualFileName) && store.Files.Contains(oldRelativePath))
              {
            store.DeleteFile(oldRelativePath);
              }
              // Переименование файла.
              else if (!string.IsNullOrEmpty(e.ActualFileName) && !string.IsNullOrEmpty(e.OldFileName)
            && e.ActualFileName != e.OldFileName && e.ActualFileName == e.RawFileName)
              {
            store.MoveFile(oldRelativePath, actualRelativePath);
              }
              // Перемещение файла в другой каталог.
              else if (e.ActualFileName == e.OldFileName && e.ActualDirectory != e.OldDirectory && e.ActualFileName == e.RawFileName)
              {
            store.MoveFile(oldRelativePath, actualRelativePath);
              }
              // Замена на файл с тем же именем.
              else if (Path.IsPathRooted(e.RawFileName) && !string.IsNullOrEmpty(e.OldFileName) && !string.IsNullOrEmpty(e.ActualFileName)
            && e.ActualDirectory == e.OldDirectory && File.Exists(e.RawFileName))
              {
            #warning Если ввести несуществующий файл, потом заменить на существующий, то файла не будет в хранилище, не заменится.
            // Заменяем файл, имя остается тем же.
            store.ReplaceFile(oldRelativePath, e.RawFileName);
            // Меняем имя файла.
            store.MoveFile(oldRelativePath, actualRelativePath);
              }
        }
Esempio n. 39
0
    static public (int statusCode, AttemptContinueWithCompositionEventReport responseReport) AttemptContinueWithCompositionEventAndCommit(
        CompositionLogRecordInFile.CompositionEvent compositionLogEvent,
        IFileStore processStoreFileStore,
        Action <string>?testContinueLogger = null)
    {
        var beginTime = CommonConversion.TimeStringViewForReport(DateTimeOffset.UtcNow);

        var totalStopwatch = System.Diagnostics.Stopwatch.StartNew();

        var testContinueResult = PersistentProcess.PersistentProcessLiveRepresentation.TestContinueWithCompositionEvent(
            compositionLogEvent: compositionLogEvent,
            fileStoreReader: processStoreFileStore,
            logger: testContinueLogger);

        var projectionResult = IProcessStoreReader.ProjectFileStoreReaderForAppendedCompositionLogEvent(
            originalFileStore: processStoreFileStore,
            compositionLogEvent: compositionLogEvent);

        if (testContinueResult.Ok?.projectedFiles == null)
        {
            return(statusCode : 400, new AttemptContinueWithCompositionEventReport
                   (
                       beginTime : beginTime,
                       compositionEvent : compositionLogEvent,
                       storeReductionReport : null,
                       storeReductionTimeSpentMilli : null,
                       totalTimeSpentMilli : (int)totalStopwatch.ElapsedMilliseconds,
                       result : Result <string, string> .err(testContinueResult.Err !)
                   ));
        }

        foreach (var projectedFilePathAndContent in testContinueResult.Ok.projectedFiles)
        {
            processStoreFileStore.SetFileContent(
                projectedFilePathAndContent.filePath, projectedFilePathAndContent.fileContent);
        }

        return(statusCode : 200, new AttemptContinueWithCompositionEventReport
               (
                   beginTime : beginTime,
                   compositionEvent : compositionLogEvent,
                   storeReductionReport : null,
                   storeReductionTimeSpentMilli : null,
                   totalTimeSpentMilli : (int)totalStopwatch.ElapsedMilliseconds,
                   result : Result <string, string> .ok("Successfully applied this composition event to the process.")
               ));
    }
Esempio n. 40
0
 public UserService(
     UserManager <BaseIdentityUser> userManager,
     IGroupService groupService,
     IPositionService positionService,
     IJwtFactory jwtFactory,
     IFileStore fileStore,
     IConfiguration configuration,
     IMapper mapper)
 {
     _userManager        = userManager;
     _positionService    = positionService;
     _groupService       = groupService;
     _jwtFactory         = jwtFactory;
     _fileStore          = fileStore;
     _serverFileRootPath = configuration["AvatarFileOption:ServerFileStorePath"];
     _mapper             = mapper;
 }
Esempio n. 41
0
        public void Reload(IFileStore store)
        {
            var kvp = new KeyValuePairs();

            using (var reader = store.OpenTextFile(m_path))
            {
                kvp.Load(reader);
            }

            ID               = kvp.GetInteger("id", 0);
            Title            = kvp.GetString("title", null);
            ContentPath      = kvp.GetString("content_path", DefaultContentPath);
            Button0Prompt    = kvp.GetString("button0_prompt", "A");
            Button1Prompt    = kvp.GetString("button1_prompt", "B");
            UnlockCampaign   = kvp.GetString("unlock_campaign", null);
            UnlockLevelCount = kvp.GetInteger("unlock_level_count", 0);
        }
Esempio n. 42
0
 public UserService(
     UserManager <BaseIdentityUser> userManager,
     RoleManager <BaseIdentityRole> roleManager,
     IRepository <GroupEntity, Guid> groupRepository,
     IJwtFactory jwtFactory,
     IFileStore fileStore,
     IConfiguration configuration,
     IMapper mapper)
 {
     _userManager        = userManager;
     _roleManager        = roleManager;
     _groupRepository    = groupRepository;
     _jwtFactory         = jwtFactory;
     _fileStore          = fileStore;
     _serverFileRootPath = configuration["AvatarFileOption:ServerFileStorePath"];
     _mapper             = mapper;
 }
Esempio n. 43
0
 public BackupService(ICloudBackupService cloudBackupService,
                      IFileStore fileStore,
                      ISettingsFacade settingsFacade,
                      IConnectivityAdapter connectivity,
                      IContextAdapter contextAdapter,
                      IMessenger messenger,
                      IToastService toastService)
 {
     this.cloudBackupService = cloudBackupService;
     this.fileStore          = fileStore;
     this.settingsFacade     = settingsFacade;
     this.connectivity       = connectivity;
     this.contextAdapter     = contextAdapter;
     this.messenger          = messenger;
     this.toastService       = toastService;
     UserAccount             = cloudBackupService.UserAccount;
 }
Esempio n. 44
0
 public QuestionViewProvider(
     IEntityFileStore <EntityFile> entityFileStore,
     IFileStore <File> fileStore,
     IHttpContextAccessor httpContextAccessor,
     IFileGuidFactory guidBuilder,
     IEntityStore <Question> entityStore,
     IFeatureFacade featureFacade,
     IContextFacade contextFacade)
 {
     _request         = httpContextAccessor.HttpContext.Request;
     _entityFileStore = entityFileStore;
     _fileStore       = fileStore;
     _contextFacade   = contextFacade;
     _featureFacade   = featureFacade;
     _guidBuilder     = guidBuilder;
     _entityStore     = entityStore;
 }
        public RetrieveResourceServiceTests(DataStoreTestsFixture blobStorageFixture, SqlDataStoreTestsFixture sqlIndexStorageFixture)
        {
            EnsureArg.IsNotNull(sqlIndexStorageFixture, nameof(sqlIndexStorageFixture));
            EnsureArg.IsNotNull(blobStorageFixture, nameof(blobStorageFixture));
            _instanceStore      = sqlIndexStorageFixture.InstanceStore;
            _indexDataStore     = sqlIndexStorageFixture.IndexDataStore;
            _fileStore          = blobStorageFixture.FileStore;
            _retrieveTranscoder = Substitute.For <ITranscoder>();
            _frameHandler       = Substitute.For <IFrameHandler>();

            _dicomRequestContextAccessor = Substitute.For <IDicomRequestContextAccessor>();
            _dicomRequestContextAccessor.RequestContext.DataPartitionEntry = new PartitionEntry(DefaultPartition.Key, DefaultPartition.Name);

            _retrieveTransferSyntaxHandler = new RetrieveTransferSyntaxHandler(NullLogger <RetrieveTransferSyntaxHandler> .Instance);
            _recyclableMemoryStreamManager = blobStorageFixture.RecyclableMemoryStreamManager;
            _retrieveResourceService       = new RetrieveResourceService(
                _instanceStore, _fileStore, _retrieveTranscoder, _frameHandler, _retrieveTransferSyntaxHandler, _dicomRequestContextAccessor, NullLogger <RetrieveResourceService> .Instance);
        }
Esempio n. 46
0
        public EditProfileViewProvider(
            IUserPhotoStore <UserPhoto> userPhotoStore,
            IPlatoUserStore <User> platoUserStore,
            IHostingEnvironment hostEnvironment,
            IShellSettings shellSettings,
            UserManager <User> userManager,
            ISitesFolder sitesFolder,
            IFileStore fileStore)
        {
            _platoUserStore = platoUserStore;
            _userPhotoStore = userPhotoStore;
            _sitesFolder    = sitesFolder;
            _userManager    = userManager;

            // paths
            _pathToImages = fileStore.Combine(hostEnvironment.ContentRootPath, shellSettings.Location, "images");
            _urlToImages  = $"/sites/{shellSettings.Location.ToLower()}/images/";
        }
 public DangKyGiayPhepController(IFileStore fileStore, IHoSoGiayPhepRepository gphdRepository, IDangKyHoatDongRepository dkhdRepository,
     IThongTinChungRespository ttcRespository, ILoaiHinhToChucRepository lhtcRepository, IToChucRepository tochucRespository,
     INangLucKeKhaiRespository nanglucRespository, IThietBiRepository thietbiRespository,
     INhanLucRepository nhanlucRespository, IHoatDongRepository hoatdongRespository,
     IBaoCaoHoatDongRepository baocaohdRespository, IBaoCaoCongTrinhRespository baocaoctRespository)
 {
     _fileStore = fileStore;
     _hsgpRepository = gphdRepository;
     _dkhdRespository = dkhdRepository;
     _ttcRespository = ttcRespository;
     _loaihinhtochucRepository = lhtcRepository;
     _tochucRespository = tochucRespository;
     _nanglucRespository = nanglucRespository;
     _thietbiRespository = thietbiRespository;
     _nhanlucRespository = nhanlucRespository;
     _hoatdongRespository = hoatdongRespository;
     _bchdRespository = baocaohdRespository;
     _bcctRespository = baocaoctRespository;
 }
 public PersistImageCommand(IFileStore fileStore, IResizeImageService resizeImageService)
 {
     this.fileStore = fileStore;
     this.resizeImageService = resizeImageService;
 }
Esempio n. 49
0
 public void SetCacheFile(IFileStore store)
 {
     if (_store != null) {
     _store.Dispose();
     _store = null;
     _storeReader = null;
     _storeWriter = null;
       }
       try {
     _store = store;
     if (_store == null) return;
     _store.Init();
     _storeReader = new FileStoreReader(store);
     _storeWriter = new FileStoreWriter(store);
       }
       catch (Exception ex) {
     WarnFormat("FileStore is not available; failed to load [{0}]:{1}", store, ex);
     store = null;
       }
 }
Esempio n. 50
0
        /// <summary>
        /// Загрузка главной сущности.
        /// </summary>
        public void Load(string fileName)
        {
            if (fileStore != null)
            fileStore.Dispose();

              LoadedFileName = fileName;

              fileStore = FileStoreCreator.Create(fileName);

              string descriptionFileName = Path.Combine(fileStore.StoreDirectory, DescriptionFileName);
              MainItem = XmlSaverLoader.Load<IWixMainEntity>(descriptionFileName, MainItem.GetType());

              // Для элементов не для чтения, если они поддерживают работу с файлом, добавим обработчик события.
              foreach (IFileSupport item in RootItem.Items.Descendants().Where(v => !v.IsReadOnly).OfType<IFileSupport>())
            item.FileChanged += BuilderModel_FileChanged;

              State = ModelState.Saved;
        }
Esempio n. 51
0
 public UtilityController(IFileStore fileStore)
 {
     this._fileStore = fileStore;
 }
Esempio n. 52
0
 public FileStoreLogWrapper(IFileStore store)
 {
     this.store = store;
 }
Esempio n. 53
0
 public FileManager(IFileStore store)
 {
     _FileStore = store;
 }
Esempio n. 54
0
 public FileStoreWriter(IFileStore store)
 {
     _store = store;
 }
Esempio n. 55
0
 public OneDriveService(IFileStore fileStore, IOneDriveAuthenticator oneDriveAuthenticator)
 {
     this.fileStore = fileStore;
     this.oneDriveAuthenticator = oneDriveAuthenticator;
 }
Esempio n. 56
0
 public DownloadGetHandler(IFileStore fileStore)
 {
     _fileStore = fileStore;
 }
Esempio n. 57
0
 public ProductController(IProductManager productManager, IClassesManager classesManager, IFileStore fileStore)
 {
     _ProductManager = productManager;
     _ClassesManager = classesManager;
     _FileStore = fileStore;
 }
Esempio n. 58
0
 public BuilderModel()
 {
     selectedItem = null;
       MainItem = CreateMainEntity();
       itemsCountDictionaryByType = new Dictionary<Type, int>();
       // Создаем хранилище файлов.
       fileStore = FileStoreCreator.Create();
       // Создадим сообщения о построении и привяжем
       // делегат уведомления об изменении свойства BuildMessages.
       BuildMessages = new ObservableCollection<BuildMessage>();
       IsBuilding = false;
       State = ModelState.New;
 }
 public ResizeImageService(IFileStore fileStore)
 {
     this.fileStore = fileStore;
 }
 public PersistImageCommand(IFileStore fileStore, IResizeImageService resizeImageService, IPersistImageValidatorResolver validatorResolver)
 {
     this.fileStore = fileStore;
     this.resizeImageService = resizeImageService;
     this.validatorResolver = validatorResolver;
 }