internal override void Compare(IFileComparer fileComparer) { if (ChildEntries.Count > 0) { foreach (var entry in ChildEntries) { entry.Compare(fileComparer); foreach (var status in entry.CompareStatuses) { CompareStatuses.Add(status); } } } else { if (Left != null && Right != null) { CompareStatuses.Add(CompareStatus.Equal); } else if (Left != null) { CompareStatuses.Add(CompareStatus.LeftOrphant); } else { CompareStatuses.Add(CompareStatus.RightOrphant); } } }
//public KetQuaThiSinh ChamBai(IInputCham input) //{ // BienDichFactory cpFac = new BienDichFactory(); // IBienDich compiler = cpFac.GetBienDichObjectByNgonNgu(input.Language); // KetQuaThiSinh kq = new KetQuaThiSinh(); // kq.Input = input; // String outFileName = Path.GetFileNameWithoutExtension(input.SourceCode) + ".exe"; // string outFilePath = Path.Combine(Path.GetDirectoryName(input.SourceCode), outFileName); // kq.KetQuaBienDich = compiler.BienDich(input.SourceCode, outFilePath); // if (kq.KetQuaBienDich.BienDichThanhCong) // { // ChamBaiFactory chamFac = new ChamBaiFactory(); // IChamDiem chamDiem = chamFac.GetChamDiemObject(outFilePath); // kq.KetQuaCham = chamDiem.Cham(outFilePath, input.TestCases, input.FileComparer); // } // return kq; //} public KetQuaThiSinh ChamBai(string sourceCode, List<ITestCase> tescase, IFileComparer ss) { //_FileManager = new FileManager(); //TODO: get code ext String codeFilePath = _FileManager.GetNextTempFile(".cpp"); StreamWriter f = File.CreateText(codeFilePath); f.Write(sourceCode); f.Close(); string exeFilePath = Path.ChangeExtension(codeFilePath, ".exe"); KetQuaThiSinh kq = new KetQuaThiSinh(); kq.KetQuaBienDich = _BienDich.BienDich(codeFilePath, exeFilePath); if (!kq.KetQuaBienDich.BienDichThanhCong) return kq; kq.KetQuaCham = _ChamDiem.Cham(kq.KetQuaBienDich.FilePath, tescase, ss); return kq; }
/// <summary> /// Performs a compare operation using the specified FileComparer with the two files at the specified location. /// </summary> /// <param name="location"></param> public void Compare(ItemLocation location, IFileComparer fileComparer) { File left = Left.GetFileAtLocation(location); File right = Right.GetFileAtLocation(location); //TODO: Show a message saying that one of the files does not exist. if (left == null || right == null) { return; } try { fileComparer.Compare(left, right); } catch (Exception) { } }
internal override void Compare(IFileComparer fileComparer) { CompareStatus status; if (Left == null) { status = CompareStatus.RightOrphant; } else if (Right == null) { status = CompareStatus.LeftOrphant; } else { status = fileComparer.Compare(Left.FullPath, Right.FullPath); } CompareStatuses.Clear(); CompareStatuses.Add(status); }
public FileSynchronizer( IAppConfig appConfig, ILogger <FileSynchronizer> logger, IDirectoryStructureComparer directoryStructureComparer, IFileComparer fileComparer, IFileCopier fileCopier, IFileDeleter fileDeleter, IFileMerger fileMerger, IFileFilter fileFilter) { _appConfig = appConfig ?? throw new ArgumentNullException(nameof(appConfig)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _directoryStructureComparer = directoryStructureComparer ?? throw new ArgumentNullException(nameof(directoryStructureComparer)); _fileComparer = fileComparer ?? throw new ArgumentNullException(nameof(fileComparer)); _fileCopier = fileCopier ?? throw new ArgumentNullException(nameof(fileCopier)); _fileDeleter = fileDeleter ?? throw new ArgumentNullException(nameof(fileDeleter)); _fileMerger = fileMerger ?? throw new ArgumentNullException(nameof(fileMerger)); _fileFilter = fileFilter; _srcFileSystem = _appConfig.Src; _destFileSystem = _appConfig.Dest; }
protected Scanner(ScanOptions scanOptions) { var fileComparerFactory = new FileComparerFactory(); _options = scanOptions; _fileComparer = fileComparerFactory.Create(scanOptions.FileCompareType); }
public SimpleFileCopier(ILogger <SimpleFileCopier> logger, IFileComparer fileComparer) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _fileComparer = fileComparer ?? throw new ArgumentNullException(nameof(fileComparer)); }
internal abstract void Compare(IFileComparer filecomparer);
public UpdatedAssemblyFinder(IFolderComparer folderComparer, IFileComparer fileComparer) { this.folderComparer = folderComparer; this.fileComparer = fileComparer; }
public MainWindow() { _fileComparer = new FileComparer(); InitializeComponent(); }
public NeedToCopyUpdatedOnlyChecker(IFileComparer fileComparer, IFileSystem fileSystem, IConfirmationChecker confirmationChecker) { _fileComparer = fileComparer; _confirmationChecker = confirmationChecker; _fileSystem = fileSystem; }
public KetQuaCham Cham(string FileBaiLamCLASS, List<ITestCase> lstTestcase, IFileComparer soSanh) { throw new NotImplementedException(); }