コード例 #1
0
 public ClientThread([NotNull] DistLogger logger, [NotNull] Settings mySettings, [NotNull] ThreadId threadId)
 {
     _logger     = logger;
     _mySettings = mySettings;
     _threadId   = threadId;
     logger.Info("initalizing logger", threadId);
 }
コード例 #2
0
 public CalcExecutor([NotNull] ThreadId threadId, [NotNull] DistLogger logger, [NotNull] Settings mySettings)
 {
     _threadId   = threadId;
     _mySettings = mySettings;
     _logger     = logger;
 }
コード例 #3
0
 public CalcDirectoryPreparer([NotNull] Settings settings, [NotNull] DistLogger logger, [NotNull] ThreadId threadId)
 {
     _settings = settings;
     _logger   = logger;
     _threadId = threadId;
 }
コード例 #4
0
        public static List <MsgFile> ReadMsgFiles(bool addFullFiles,
                                                  [NotNull][ItemNotNull] List <FileInfo> filteredFiles,
                                                  [NotNull] DirectoryInfo baseDir, [NotNull] DistLogger logger, [NotNull] ThreadId threadId)
        {
            var  lpgFiles  = new List <MsgFile>();
            long totalSize = 0;

            foreach (var fi in filteredFiles)
            {
                var relativeDirectory = "";
                if (fi.DirectoryName?.Length > baseDir.FullName.Length)
                {
                    relativeDirectory = fi.DirectoryName.Substring(baseDir.FullName.Length).Trim().Trim('\\');
                }

                MsgFile jf = new MsgFile(fi, relativeDirectory);
                if (addFullFiles)
                {
                    jf.FileContent = File.ReadAllBytes(fi.FullName);
                }

                totalSize += fi.Length;
                lpgFiles.Add(jf);
            }

            string prettySize = AutomationUtili.MakePrettySize(totalSize);

            logger.Info("Collected files with " + prettySize, threadId);
            return(lpgFiles);
        }