Пример #1
0
 /// <summary>
 /// Для исключения дублей в колекции
 /// Путь для анализа папки на PDF Work
 /// </summary>
 /// <param name="path"></param>
 public async void CountPdfWork(string path)
 {
     if (Directory.Exists(path))
     {
         PdfFileWork.Clear();
         UpdateOn(PdfFileWork);
         await Task.Run(delegate
         {
             var filelogica = new FileLogica();
             lock (Lock)
             {
                 var file = FileLogica.FileinfoMass("*.pdf", path);
                 foreach (var fileInfo in file)
                 {
                     PdfFileWork.Add(new PdfModelPrint
                     {
                         Icon = filelogica.Extracticonfile(fileInfo.FullName),
                         Name = fileInfo.Name,
                         Path = fileInfo.FullName
                     });
                 }
                 UpdateOff(PdfFileWork);
             }
         });
     }
 }
Пример #2
0
 /// <summary>
 /// Путь для анализа папки на PDF Temp
 /// </summary>
 /// <param name="path"></param>
 public async void CountPdfTemp(string path)
 {
     try
     {
         if (Directory.Exists(path))
         {
             PdfFileTemp.Clear();
             UpdateOn(PdfFileTemp);
             var filelogica = new FileLogica();
             await Task.Run(delegate
             {
                 lock (Lock)
                 {
                     var file = FileLogica.FileinfoMass("*.pdf", path);
                     foreach (var fileInfo in file)
                     {
                         PdfFileTemp.Add(new PdfModelPrint
                         {
                             Icon = filelogica.Extracticonfile(fileInfo.FullName),
                             Name = fileInfo.Name,
                             Path = fileInfo.FullName
                         });
                     }
                 }
                 UpdateOff(PdfFileTemp);
             });
         }
     }
     catch (Exception e)
     {
         Console.Write(e);
     }
 }
Пример #3
0
 /// <summary>
 /// Добавление Отчета Excel
 /// </summary>
 /// <param name="pathdirectoryreport">Полный путь ук файлу</param>
 public void UpdateColectFile(string pathdirectoryreport)
 {
     if (Directory.Exists(pathdirectoryreport))
     {
         var filelogica = new FileLogica();
         ReportXlsxel.Clear();
         foreach (var file in FileLogica.FileinfoMass(pathdirectoryreport))
         {
             ReportXlsxel.Add(new ReportXlsxProperty {
                 Icon = filelogica.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName
             });
         }
     }
 }
Пример #4
0
 /// <summary>
 /// Метод добавление в Модель Объектов!!!
 /// </summary>
 /// <param name="path">Путь к файлам</param>
 public void AddXmlFile(string path)
 {
     XmlFiles.Clear();
     lock (Lock)
     {
         var filelogica = new FileLogica();
         Directory.CreateDirectory(path);
         foreach (var file in FileLogica.FileinfoMass(path))
         {
             XmlFiles.Add(new ListViewModelXmlFileGenerateProperty {
                 Icon = filelogica.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName
             });
         }
     }
 }
Пример #5
0
 /// <summary>
 /// Метод добавляющий файлы!!!
 /// </summary>
 /// <param name="pathFileXml"></param>
 public void AddFileXml(string pathFileXml)
 {
     if (Directory.Exists(pathFileXml))
     {
         var fileLogic = new FileLogica();
         XmlFileZnach.Clear();
         foreach (var file in FileLogica.FileinfoMass(pathFileXml))
         {
             XmlFileZnach.Add(new ReportJournalProperty()
             {
                 Icon = fileLogic.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName
             });
         }
     }
 }
Пример #6
0
 /// <summary>
 /// Метод добавляющий журналы!!!
 /// </summary>
 /// <param name="pathJournalXml">Путь к Журналам с ошибками</param>
 public void AddJournal(string pathJournalXml)
 {
     if (Directory.Exists(pathJournalXml))
     {
         var fileLogic = new FileLogica();
         XmlReportJournal.Clear();
         foreach (var file in FileLogica.FileinfoMass(pathJournalXml))
         {
             XmlReportJournal.Add(new ReportJournalProperty()
             {
                 Icon = fileLogic.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName, InfoFile = ModelInfoFile.FirstOrDefault(x => x.ModelNameFileXml == file.Name)?.FileInfoFile
             });
         }
     }
 }