aspNetEmail

iCalendar Class

iCalendar/vCalendar format writer which is suitable as an exchange format between applications or systems

For a list of all members of this type, see iCalendar Members.

System.Object
   iCalendarComponent
      iCalendar

public class iCalendar : iCalendarComponent

Remarks

The iCalender class supports both vCal and iCal format. From a specification format, iCalendar has 2 versions. According to the internet standards, vCal is commonly referred to as iCalendar version 1.0. iCal, is commonly referred to as iCalender v2.0. More information on the RFCs can be found at:

Example

[CS]
            static void Main()
            {
                //new iCalendar
                iCalendar ic = LoadCalendar(); 
             
                //load the EmailMessage from the web.config or app.config  file
                EmailMessage m = new EmailMessage( true, false );
                m.Subject = "Appointment";
             
                m.AddCalendar( ic );
             
                m.Send();
            }
             
            public static iCalendar LoadCalendar() 
            {
                iCalendar  ic = new iCalendar();            
             
                //create the organizer
                ic.Event.Organizer.FullName = "Doe, J. MR";
                ic.Event.Organizer.Email = "john@example.com";
             
                //set the timezone
                ic.TimeZone.TimeZoneIndex = TimeZoneHelper.EasternTimeUSAndCanadaGMTm0500;
             
                //define the event
                ic.Event.Summary.Text = "Meeting Request";
                ic.Event.Description.Text = "This meeting request is to discuss the design specs of the project.";
             
                ic.Event.Location.Text = "Conf rm 100. Building 20, Main Campus";
                ic.Event.DateStart.Date = new DateTime(2004, 10, 21, 14, 0, 0);
                ic.Event.DateEnd.Date = new DateTime(2004, 10, 21, 15, 0, 0);            
             
                //mark the time as busy (not available to free-busy searches).
                ic.Event.TimeTransparency.TransparencyType = TransparencyType.Opaque;
             
                //set this a high priority event
                ic.Event.Priority.PriorityType  = PriorityType.High; 
             
                //make the event private
                ic.Event.Classification.ClassificationType = ClassificationType.Private;
             
                ic.Event.Categories.Add( CategoryType.MEETING );
             
                //Add the Attendee
                Attendee att1 = new Attendee( );
                att1.FullName = "Dave Jones";
                att1.Email = "dave@example.com";
                att1.ParticipationStatus = ParticipationStatus.NEEDSACTION;
                att1.Role = RoleType.REQ_PARTICIPANT;            
                att1.RSVP = true;
                ic.Event.Attendees.Add( att1 );
             
                //set an alarm
                Alarm a = new DisplayAlarm( "This is a reminder of the upcoming specs meeting." );
                // repeat the alarm for 10 times (snooze)
                a.Repeat.Count = 10;
             
                // triggers 30 minutes before the event starts            
                a.Trigger.RelativeTrigger.Negative = true;
                a.Trigger.RelativeTrigger.TimeSpan = new TimeSpan( 0, 30, 0 );
             
                // delay period after which the alarm will repeat
                a.DelayPeriod.TimeSpan = new TimeSpan( 0, 10, 0 );            
                    
                ic.Event.Alarms.Add( a );
             
                
                return ic;
            }
                
[Visual Basic]
            Shared Sub Main()
               'new iCalendar
               Dim ic As iCalendar = LoadCalendar()
               
               'load the EmailMessage from the web.config or app.config  file
               Dim m As New EmailMessage(True, False)
               m.Subject = "Appointment"
               
               m.AddCalendar(ic)
               
               m.Send()
            End Sub 'Main
             
             
            Public Shared Function LoadCalendar() As iCalendar
               Dim ic As New iCalendar()
               
               'create the organizer
               ic.Event.Organizer.FullName = "Doe, J. MR"
               ic.Event.Organizer.Email = "john@example.com"
               
               'set the timezone
               ic.TimeZone.TimeZoneIndex = TimeZoneHelper.EasternTimeUSAndCanadaGMTm0500
               
               'define the event
               ic.Event.Summary.Text = "Meeting Request"
               ic.Event.Description.Text = "This meeting request is to discuss the design specs of the project."
               
               ic.Event.Location.Text = "Conf rm 100. Building 20, Main Campus"
               ic.Event.DateStart.Date = New DateTime(2004, 10, 21, 14, 0, 0)
               ic.Event.DateEnd.Date = New DateTime(2004, 10, 21, 15, 0, 0)
               
               'mark the time as busy (not available to free-busy searches).
               ic.Event.TimeTransparency.TransparencyType = TransparencyType.Opaque
               
               'set this a high priority event
               ic.Event.Priority.PriorityType = PriorityType.High
               
               'make the event private
               ic.Event.Classification.ClassificationType = ClassificationType.Private
               
               ic.Event.Categories.Add(CategoryType.MEETING)
               
               'Add the Attendee
               Dim att1 As New Attendee()
               att1.FullName = "Dave Jones"
               att1.Email = "dave@example.com"
               att1.ParticipationStatus = ParticipationStatus.NEEDSACTION
               att1.Role = RoleType.REQ_PARTICIPANT
               att1.RSVP = True
               ic.Event.Attendees.Add(att1)
               
               'set an alarm
               Dim a = New DisplayAlarm("This is a reminder of the upcoming specs meeting.")
               ' repeat the alarm for 10 times (snooze)
               a.Repeat.Count = 10
               
               ' triggers 30 minutes before the event starts            
               a.Trigger.RelativeTrigger.Negative = True
               a.Trigger.RelativeTrigger.TimeSpan = New TimeSpan(0, 30, 0)
               
               ' delay period after which the alarm will repeat
               a.DelayPeriod.TimeSpan = New TimeSpan(0, 10, 0)
               
               ic.Event.Alarms.Add(a)
               
               
               Return ic
            End Function 'LoadCalendar
                

Requirements

Namespace: aspNetEmail.Calendaring

Assembly: aspNetEmail (in aspNetEmail.dll)

See Also

iCalendar Members | aspNetEmail.Calendaring Namespace