Пример #1
0
 public ModelsCreate(LogInfo logInfo, Writer <LogInfo> writerLogInfo,
                     Writer <IpAddressCompany> writerIpAddress, IpAddressCompany ipAddressCompany, InfoAboutFile infoAboutFile)
 {
     this.infoAboutFile    = infoAboutFile;
     this.ipAddressCompany = ipAddressCompany;
     this.logInfo          = logInfo;
     this.writerLogInfo    = writerLogInfo;
     this.writerIpAddress  = writerIpAddress;
 }
Пример #2
0
        private InfoAboutFile ModelInfoAboutFileFill(TempInfoFiles item, string title)
        {
            InfoAboutFile infoAboutFile = new InfoAboutFile()
            {
                PathName = item.PathName,
                Size     = item.Size,
                Title    = title
            };

            return(infoAboutFile);
        }
Пример #3
0
        static void Main(string[] args)
        {
            const string pathToLogFile = @"../../LogIsHere/tariscope.access.log";

            List <string> ipList       = new List <string>();
            List <string> fileNameList = new List <string>();

            LogInfo                   logInfo          = new LogInfo();
            IpAddressCompany          ipAddressCompany = new IpAddressCompany();
            InfoAboutFile             infoAboutFile    = new InfoAboutFile();
            Writer <LogInfo>          writerLogInfo    = new Writer <LogInfo>(new LogFileContext());
            Writer <IpAddressCompany> writerIpAddress  = new Writer <IpAddressCompany>(new LogFileContext());
            ModelsCreate <LogInfo>    create           = new ModelsCreate <LogInfo>(logInfo, writerLogInfo, writerIpAddress, ipAddressCompany, infoAboutFile);

            create.CreatModel(pathToLogFile);
        }
Пример #4
0
        private async Task RunTasksAsync(InfoAboutFile infoAboutFile)
        {
            List <TempInfoFiles> list;

            using (LogFileContext context = new LogFileContext())
            {
                list = context.logInfo.Select(x => new TempInfoFiles {
                    PathName = x.Path, Size = x.Size
                }).ToList();
            }
            int  countTread = 2;
            Task task0      = GetTitleAsync(list, 0, 1 * list.Count / countTread);
            Task task1      = GetTitleAsync(list, 1 * list.Count / countTread, 2 * list.Count / countTread);

            await Task.WhenAll(task0, task1);
        }