private static void OnEnterClick(DataProcess dataInfo) { while (true) { if (Console.ReadKey().Key == ConsoleKey.Enter) { dataInfo.Show(); } } }
static void Main(string[] args) { var path = PathInfo.GetInstance(); CreateDirectoriesIfNotExists(path); ClientConfig clientConfig = GetDataToNewObj <ClientConfig>(path.ClientConfigPath); SaveToFileConfig saveToFileConfig = GetDataToNewObj <SaveToFileConfig>(path.SaveToFileConfig); DataInfo Info = GetDataToNewObj <DataInfo>(path.DataInfo); ISaver xmlSaver = new XmlSaver(path.DataInfo); ISaver dataTxtSaver = new DataTxtSaver(path.PackagesFilePath); IShower consoleShower = new ConsoleShower(); Client client = new Client(clientConfig); DataProcess dataInfo = new DataProcess(Info, consoleShower, xmlSaver, dataTxtSaver, client); dataInfo.BeginReceivingData(saveToFileConfig.NeedsSaveDataToFile); OnEnterClick(dataInfo); }