コード例 #1
0
 public static void PrintEvent(Event eventToPrint)
 {
     if (eventToPrint != null)
     {
         Output.Append(eventToPrint + "\n");
     }
 }
コード例 #2
0
        public void AddEvent(DateTime date, string title, string location)
        {
            Event newEvent = new Event(date, title, location);

            this.eventsByTitle.Add(title.ToLower(), newEvent);
            this.eventsByDate.Add(newEvent);

            Messages.EventAdded();
        }
コード例 #3
0
        /// <summary>
        /// Adds an event.
        /// </summary>
        /// <param name="date">The date.</param>
        /// <param name="title">The title.</param>
        /// <param name="location">The location.</param>
        public void AddEvent(DateTime date, string title, string location)
        {
            Event newEvent = new Event(date, title, location);
            string eventTitleLowerCase = newEvent.Title.ToLowerInvariant();

            this.eventsByTitle.Add(eventTitleLowerCase, newEvent);
            this.eventsByDate.Add(newEvent.Date, newEvent);

            Messages.EventAdded();
        }