コード例 #1
0
        public void simple_calendar_test()
        {
            // Arrange
            CalendarEventRequest cEvent = new CalendarEventRequest();
            cEvent.PRODID = "-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN";
            cEvent.DateStart = DateTime.Parse("7/26/2014 7:30AM").ToString("yyyyMMdd\\THHmmss");
            cEvent.DateEnd = DateTime.Parse("7/26/2014 11:30AM").ToString("yyyyMMdd\\THHmmss");
            cEvent.Description = "Important Reminders \n•	Please arrive at the course at least 30 minutes prior to Shotgun start time.\n•	CASH ONLY for payment of green fees and guest fees!!!\n•	Slow play is not permitted. Please be courteous to all golfers and keep on pace.\nIf you have any questions please contact either:\n•	[email protected] - 760-777-7090";
            cEvent.Location = "Classic Club Golf Course - Palm Desert";
            cEvent.Priority = 2;
            cEvent.Subject = "Classic Club Golf Course";
            cEvent.UID = "*****@*****.**";
            cEvent.Version = "1.0";
            cEvent.FileName = "Classic Club Golf Course";

            ICalendar simple = new SimpleCalendar(cEvent);

            Calendar calendar = new Calendar(simple);

            // Act
            calendar.Save();

            // Assert
            //Console.WriteLine(actual);
        }
コード例 #2
0
        public ActionResult Create(MessageModel model)
        {
            string filePath = Server.MapPath("~/ics/Demo Message.ics");

            // Store the file path in the model that will be passed to the Mailer object.
            model.FileName = filePath;

            // First thing to do is populate the CalendarEventRequest object.
            CalendarEventRequest cEvent = new CalendarEventRequest();
            cEvent.PRODID = "-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN";
            cEvent.Version = "2.0";

            cEvent.DateStart = model.StartDate.ToString("yyyyMMdd\\THHmmss");
            cEvent.DateEnd = model.EndDate.ToString("yyyyMMdd\\THHmmss");
            cEvent.Description = model.Message;
            cEvent.Location = model.Location;
            cEvent.Priority = 3;
            cEvent.Subject = model.Subject;
            cEvent.FileName = filePath;

            try
            {
                // Now create an instance of the calendar object you want to use.  In this case
                // I just want to send a basic simple calendar message.
                ICalendar simple = new SimpleCalendar(cEvent);

                // Now create the Calendar instance and pass it the ICalendar interface implementation.
                Calendar calendar = new Calendar(simple);

                // This will save the ics file to disk where the Mailer object can retrieve it.
                calendar.Save();

                /******* Begin Mailer Functions *********/
                // Don't forget to update your web.config/smtp settings.
                Mailer.Success(model).Send();
            }
            catch (Exception ex)
            {
                string msg = string.Empty;

                if (ex.InnerException != null)
                {
                    msg = ex.InnerException.Message + " - ";
                }

                msg += ex.Message;

                ModelState.AddModelError("", msg);
                return RedirectToAction("Create");
            }

            return View("MessageSuccess");
        }
コード例 #3
0
        public void MyTestMethod()
        {
            // Arrange
            CalendarEventRequest cEvent = new CalendarEventRequest();
            cEvent.PRODID = "-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN";
            cEvent.DateEnd = DateTime.Parse("7/21/2014 9:39PM").ToString("yyyyMMdd\\THHmmss\\Z");
            cEvent.DateStart = DateTime.Parse("7/21/2014 8:39PM").ToString("yyyyMMdd\\THHmmss\\Z");
            cEvent.Description = "This is the description that will end up as the body of the message.<br />This is more stuff.\n";
            cEvent.Location = "This is the location";
            cEvent.Priority = 2;
            cEvent.Subject = "This is the subject";
            cEvent.UID = "*****@*****.**";
            cEvent.Version = "1.0";
            cEvent.FileName = "Recurring Golf Course";
            cEvent.IsRecurring = true;  // this is the new property used in the FullCalendar

            ICalendar simple = new FullCalendar(cEvent);

            Calendar calendar = new Calendar(simple);

            // Act
            calendar.Save();
        }
コード例 #4
0
ファイル: FullCalendar.cs プロジェクト: kahanu/iCalendarSharp
 public FullCalendar(CalendarEventRequest request)
 {
     this._request = request;
 }
コード例 #5
0
 public SimpleCalendar(CalendarEventRequest request)
 {
     this._request = request;
 }