示例#1
0
        private static void Main()
        {
            var appointmentBuilder = new AppointmentBuilder();

            try
            {
                var appointment = Scheduler.CreateAppointment(appointmentBuilder,
                                                              new DateTime(2010, 7, 7),
                                                              new DateTime(2011, 7, 7),
                                                              "Trek conversion",
                                                              new LocationImpl("Fargo, ND"),
                                                              new List <IContact>
                {
                    new ContactImpl("Denny", "Glover", "Gun", "Hollywood")
                });

                foreach (var contact in appointment.Attendees)
                {
                    WriteLine(contact);
                }

                WriteLine(appointment.Description);
                WriteLine(appointment.StartDate);
                WriteLine(appointment.EndDate);
                WriteLine(appointment.Location);
            }
            catch (InfoRequiredException infoRequiredEx)
            {
                PrintExceptions(infoRequiredEx);
            }

            ReadKey();
        }
示例#2
0
        public static Appointment CreateAppointment(
            [NotNull] AppointmentBuilder builder,
            DateTime startDateTime,
            DateTime endDateTime,
            [NotNull] string description,
            [NotNull] ILocation location,
            [NotNull] ICollection <IContact> attendees)
        {
            builder.BuildAppointment();
            builder.BuildDates(startDateTime, endDateTime);
            builder.BuildDescription(description);
            builder.BuildAttendees(attendees);
            builder.BuildLocation(location);

            return(builder.GetAppointment());
        }