CalendarSystem.Common.CommandProcessor.ProcessAddCommand C# (CSharp) Метод

ProcessAddCommand() приватный Метод

private ProcessAddCommand ( Command command ) : string
command Command
Результат string
        private string ProcessAddCommand(Command command)
        {
            DateTime eventDate = DateTime.ParseExact(
                command.Arguments[0], 
                DateTimeFormat, 
                CultureInfo.InvariantCulture);
            Event newEvent = new Event();
            newEvent.Date = eventDate;
            newEvent.Title = command.Arguments[1];
            
            if (command.Arguments.Length == 3)
            {
                newEvent.Location = command.Arguments[2];
            }
            else
            {
                newEvent.Location = null;
            }

            this.eventsManager.AddEvent(newEvent);

            return EventAddedMessage;
        }
    }