bool IFileCollector.Replace(IFileContext context, string file, FileInfo replacement, FileNameMode comparisonMode) { bool found = false; foreach (var item in _files) { if (FileReference.Equals(context, item.Value[0], file, string.Empty, comparisonMode)) { item.Value[1] = replacement; found = true; } } return(found); }
public static bool Equals(IFileContext context, FileInfo file, string otherFileName, string otherFileExtension, FileNameMode comparisonMode) { if (!string.IsNullOrWhiteSpace(otherFileExtension)) { if (!string.Equals(file.Extension, "." + otherFileExtension)) { return(false); } } if (!string.IsNullOrWhiteSpace(otherFileName)) { switch (comparisonMode) { case FileNameMode.Default: { if (!string.Equals(file.Name, otherFileName)) { return(false); } } break; case FileNameMode.NonLiteral: { if (file.Name.IndexOf(otherFileName, System.StringComparison.OrdinalIgnoreCase) == -1) { return(false); } } break; case FileNameMode.NonLiteralIncludePath: { if (context.GetRelativePath(file.FullName).IndexOf(otherFileName, System.StringComparison.OrdinalIgnoreCase) == -1) { return(false); } } break; } } return(true); }
public void changeContext(ContextType type) { if (type == ContextType.USB) { ctx = new USBFileContext(); } else if (type == ContextType.Netwerk) { ctx = new NetwerkContext(); } else if (type == ContextType.Test) { ctx = new NetwerkContext(); } else { ctx = null; throw new InvalidOperationException(); } }
public FileRepository(IFileContext ctx) { this.ctx = ctx; }
public FamilyService(IFileContext fileContext) { this.fileContext = fileContext; }
protected FileRepository(IFileContextFactory fileContextFactory) { _fileContext = fileContextFactory.GetFileContext <T>(FileName); }
public UserFileRepo(IFileContext fileLoader) { _fileLoader = fileLoader; _users = _fileLoader.Read(); }
public FileRepo(IFileContext context) { _Context = context; }
public Context(IFileContext fileContext) { this.FileContext = fileContext; }
public FileRepository(IFileContext context) { _context = context; }
public AuthService() { var filePath = FileContext.FindFilePath(); _fileContext = new FileContext(filePath); }
public AdultService(IFileContext fileContext) { _fileContext = fileContext; }
public AdultsController(IFileContext fileContext) { _fileContextProvider = fileContext; }
/// <summary> /// Creates a new instance of a <see cref="HttpTraceRepository"/> /// </summary> public HttpTraceRepository(IFileContext fileContext) { this.Context = fileContext; }
public FamilyMembersService() { FileContext = new FileContext(); }
public bool Equals(IFileContext context, FileInfo file) { return(Equals(context, file, this.FileName, this.Extension, this.Mode)); }