public MainViewModel(
     IFileReaderProvider fileReaderProvider,
     ICoverMatrixManager coverMatrixManager,
     IExcelWriter excelWriter,
     IValidateService validateService,
     IGroupingManager groupingManager,
     ITxtExporter txtExporter,
     IFileChecker fileChecker,
     IFileReader fileReader,
     IOpenFileDialog openFileDialog) : base(validateService)
 {
     Progress              = new ProgressBarModel();
     _txtExportert         = txtExporter;
     _fileChecker          = fileChecker;
     _fileReader           = fileReader;
     _openFileDialog       = openFileDialog;
     _fileReaderProvider   = fileReaderProvider;
     _coverMatrixManager   = coverMatrixManager;
     _excelWriter          = excelWriter;
     RunIndicatorVisible   = false;
     ExcelIndicatorVisible = false;
     CmdCancelComputeData  = new DelegateCommand(async() => await CancelComputeData(), () => CancelEnabled);
     CmdComputeData        = new DelegateCommand(async() => await ComputeData(), RunEnableCheck);
     CmdReadFile           = new DelegateCommand(ReadFile, () => RunButtonIndicatorVisible);
     CmdExportToExcel      = new DelegateCommand(async() => await ExportToExcel(), () => CanEnable);
     CmdExportTstToTxt     = new DelegateCommand(async() => await ExportToTxt(CoverResult.TestMatrix, "_Obiekty_testowe"), () => CanEnable);
     CmdExportTrnToTxt     = new DelegateCommand(async() => await ExportToTxt(CoverResult.DataMatrix, "_Obiekty_treningowe"), () => CanEnable);
     MethodsDelegates      = groupingManager.GetGroupingMethods();
     SelectedMethod        = MethodsDelegates.FirstOrDefault();
 }
示例#2
0
 public FileLoaderHandler(IFileChecker fileChecker, IFileManager fileManager, ILogger <FileLoaderHandler> logger, IApiSettings settings)
 {
     _fileManager = fileManager;
     _fileChecker = fileChecker;
     _logger      = logger;
     _settings    = settings;
 }
示例#3
0
 public FileReaderProvider
     (IDataReader dataReader,
     IAttributeColumnConverter attributeColumnConverter,
     ITrainingObjectsConverter trainingObjectsConverter,
     IFileChecker fileChecker)
 {
     _dataReader = dataReader;
     _attributeColumnConverter = attributeColumnConverter;
     _trainingObjectsConverter = trainingObjectsConverter;
     _fileChecker = fileChecker;
 }
示例#4
0
 public LogTruncater(IPerfmonCounters perfmonCounters, IFileChecker fileChecker, ISetBroken setBroken, IReplayConfiguration configuration, ITruncationConfiguration truncationConfig, IReplicaInstanceContext replicaInstanceContext, ManualOneShotEvent shuttingDownEvent) : base(TimeSpan.Zero, TimeSpan.FromMilliseconds((double)RegistryParameters.LogTruncationTimerDuration), "LogTruncater")
 {
     this.m_perfmonCounters        = perfmonCounters;
     this.m_fileChecker            = fileChecker;
     this.m_configuration          = configuration;
     this.m_truncationConfig       = truncationConfig;
     this.m_replicaInstanceContext = replicaInstanceContext;
     this.m_shuttingDownEvent      = shuttingDownEvent;
     this.m_localInspectorGen      = this.m_configuration.ReplayState.InspectorGenerationNumber;
     this.m_localReplayerGen       = this.m_configuration.ReplayState.ReplayGenerationNumber;
     this.m_perfmonCounters.TruncatedGenerationNumber = this.m_genTruncatedLocally;
     LogTruncater.Tracer.TraceDebug <IReplayConfiguration>((long)this.GetHashCode(), "LogTruncater initialized - configuration = {0}", configuration);
 }
示例#5
0
        protected override void OnLoad(EventArgs e)
        {
            const string md5File = "Services\\md5.map";

            SetFormVisibility(false);
            LoadServices();
            LoadSettings();

            _fileMd5Map               = new FileMd5Service(md5File);
            Runner                    = new FileChecker(_listServices, _fileMd5Map);
            Runner.StartUploading    += (sender, args) => ShowNotification(args.Type.ToString(), args.FileName, args.Provider?.Icon);
            Runner.FinishedUploading += (sender, args) => ShowNotification($"Finished {args.Type}ing", args.FileName, args.Provider?.Icon);
            Runner.ErrorUploading    += (sender, args) => ShowNotification($"Error {args.Type}ing", args.FileName + Environment.NewLine + args.Exception.Message, args?.Provider?.Icon);

            Runner.Run(CancellationToken.None);

            base.OnLoad(e);
        }
示例#6
0
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (_filesEnumerator == null)
            {
                return;
            }

            string searchText   = e.Argument.ToString();
            string encodingName = _selectedEncoding;
            bool   multiline    = _multilineSearch;

            IFileChecker fileChecker = null;

            if (_multilineSearch)
            {
                fileChecker = new FileCheckerMultiLine(searchText, encodingName, _maxSearchTextLength);
            }
            else
            {
                searchText  = searchText.Replace(Environment.NewLine, "");
                fileChecker = new FileCheckerSingleLine(searchText, encodingName);
            }

            List <string> files    = new List <string>();
            string        filePath = _filesEnumerator.GetNext();

            while (filePath != null)
            {
                if (backgroundWorker.CancellationPending == true)
                {
                    e.Result = files.ToArray();
                    return;
                }

                if (fileChecker.Contains(filePath))
                {
                    files.Add(filePath);
                }

                filePath = _filesEnumerator.GetNext();
            }
            e.Result = files.ToArray();
        }
        // Token: 0x06001E04 RID: 7684 RVA: 0x000898BC File Offset: 0x00087ABC
        public long MinRequiredGen(IFileChecker fileChecker, IReplayConfiguration config)
        {
            long num = fileChecker.FileState.LowestGenerationRequired;

            if (!config.CircularLoggingEnabled && fileChecker.FileState.LastGenerationBackedUp != 0L)
            {
                num = Math.Min(num, fileChecker.FileState.LastGenerationBackedUp);
            }
            long copyNotificationGenerationNumber = config.ReplayState.CopyNotificationGenerationNumber;

            if (copyNotificationGenerationNumber <= (long)this.MinLogsToPreserve)
            {
                return(0L);
            }
            long num2 = (long)(this.MinLogsToPreserve / 10);

            if (num <= num2)
            {
                return(0L);
            }
            return(Math.Min(copyNotificationGenerationNumber - (long)this.MinLogsToPreserve, num - num2));
        }
示例#8
0
 public FileCheckerImplementation(IFileChecker fileDetails)
 {
     _fileChecker = fileDetails;
 }
 public InputFileValidator(IFileChecker fileChecker, ITextFileChecker textFileChecker, IPermissionChecker permissionChecker)
 {
     _fileChecker        = fileChecker;
     _textFileChecker    = textFileChecker;
     _permissionsChecker = permissionChecker;
 }
示例#10
0
 public ImageService(IImageSaver saver, IFileChecker checker)
 {
     this._saver   = saver;
     this._checker = checker;
 }
 public InputFileValidator(IFileChecker fileChecker, ITextFileChecker textFileChecker, IPermissionChecker permissionChecker)
 {
     _fileChecker = fileChecker;
     _textFileChecker = textFileChecker;
     _permissionsChecker = permissionChecker;
 }
示例#12
0
 public DirWalker(IFileChecker fileChecker, IFileParser fileParser)
 {
     FileChecker = fileChecker;
     FileParser  = fileParser;
 }
示例#13
0
 public OutputFileValidator(IFileChecker fileChecker, IFileCreate fileCreate)
 {
     _fileChecker = fileChecker;
     _fileCreate  = fileCreate;
 }
 public OutputFileValidator(IFileChecker fileChecker, IFileCreate fileCreate)
 {
     _fileChecker = fileChecker;
     _fileCreate = fileCreate;
 }