Exemplo n.º 1
0
        private void StartFileReader(FileDirector director)
        {
            Logger.Log($"Core.StartFileReader start");

            string file = _adapter.GetFileName(director.Extension);
            //if (!File.Exists(file))
            //    throw new Exception("File not exsist");
            IReader reader = _factory.BuildReader(director);

            try
            {
                IEnumerable <LogElement> toAdd = reader.Open(file);
                _dataContainer.Add(toAdd);
                _adapter.BindData(_dataContainer);
                Logger.Log($"Core.StartFileReader done");
            }
            catch (Exception ex)
            {
                Logger.Log(ex.Message);
            }
        }
Exemplo n.º 2
0
 internal IReader BuildReader(FileDirector director)
 {
     return(new FileReader(director.RegEx));
 }