Пример #1
0
        public static void FindAndPublishExistFiles()
        {
            if (!Directory.Exists(Constants.DirectoryPath))
            {
                return;
            }

            var files = GetExistFiles();

            MessageSenderService.SendMessage(files);
        }
Пример #2
0
        private static void OnCreated(object sender, FileSystemEventArgs e)
        {
            Console.WriteLine("File: " + e.Name + " " + e.ChangeType);
            StatusSenderService.SendStatus($"Find new file - '{e.Name}'.");

            MessageSenderService.SendMessage(new List <FileViewModel>
            {
                new FileViewModel
                {
                    FullName = e.FullPath,
                    Title    = e.Name
                }
            });

            WaitingMessage();
        }