Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ServicesFactory       serviceFactory = new ServicesFactory();
            IConvertToEventEntity convert        = serviceFactory.GetConvert("file");
            IMessageFormat        formatMessage;
            ITimeFormat           timeFormat;
            DateTime dateActual = DateTime.Now;

            foreach (EventEntity eventEntity in convert.ConvertToEventEntity())
            {
                formatMessage = serviceFactory.GetFormatMessage(
                    DateTimeUtilities.DateIsPreviousToToday(eventEntity.DateStart, dateActual));

                timeFormat = serviceFactory.GetTimeFormat(
                    DateTimeUtilities.GetTimeEnum(eventEntity.DateStart, dateActual));

                //se crea el mensaje.
                string message = formatMessage.CreateMessage(eventEntity, timeFormat);


                Console.WriteLine(message);
            }
        }