class file split
This commit is contained in:
@@ -123,6 +123,56 @@
|
||||
<Compile Include="Utility\ICSClasses.cs" />
|
||||
<Compile Include="Utility\ICSObject.cs" />
|
||||
<Compile Include="Utility\ICSObjectConst.cs" />
|
||||
<Compile Include="Utility\ICSProperties\AccessClass.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Action.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Attachment.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Attendee.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Begin.cs" />
|
||||
<Compile Include="Utility\ICSProperties\CalendarScale.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Categories.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Comment.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Contact.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Description.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTCompleted.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTCreated.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTDue.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTEnd.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTException.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTRecurrence.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTStamp.cs" />
|
||||
<Compile Include="Utility\ICSProperties\DTStart.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Duration.cs" />
|
||||
<Compile Include="Utility\ICSProperties\End.cs" />
|
||||
<Compile Include="Utility\ICSProperties\FreeBusyTime.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Geo.cs" />
|
||||
<Compile Include="Utility\ICSProperties\IANAProperty.cs" />
|
||||
<Compile Include="Utility\ICSProperties\LastModified.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Location.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Method.cs" />
|
||||
<Compile Include="Utility\ICSProperties\NonStandardProperty.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Organizer.cs" />
|
||||
<Compile Include="Utility\ICSProperties\PercentComplete.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Priority.cs" />
|
||||
<Compile Include="Utility\ICSProperties\ProductID.cs" />
|
||||
<Compile Include="Utility\ICSProperties\RecurrenceID.cs" />
|
||||
<Compile Include="Utility\ICSProperties\RecurrenceRule.cs" />
|
||||
<Compile Include="Utility\ICSProperties\RelatedTo.cs" />
|
||||
<Compile Include="Utility\ICSProperties\RepeatCount.cs" />
|
||||
<Compile Include="Utility\ICSProperties\RequestStatus.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Resources.cs" />
|
||||
<Compile Include="Utility\ICSProperties\SequenceNumber.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Status.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Summary.cs" />
|
||||
<Compile Include="Utility\ICSProperties\TimeTransparency.cs" />
|
||||
<Compile Include="Utility\ICSProperties\TimeZoneIdentifier.cs" />
|
||||
<Compile Include="Utility\ICSProperties\TimeZoneName.cs" />
|
||||
<Compile Include="Utility\ICSProperties\TimeZoneOffsetFrom.cs" />
|
||||
<Compile Include="Utility\ICSProperties\TimeZoneOffsetTo.cs" />
|
||||
<Compile Include="Utility\ICSProperties\TimeZoneUrl.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Trigger.cs" />
|
||||
<Compile Include="Utility\ICSProperties\UniqueID.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Url.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Version.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFMessage.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFRecord.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFShortRecord.cs" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -232,202 +232,202 @@ namespace CampusAppWP8.Utility
|
||||
}
|
||||
|
||||
public static ICSValueDesc Root = new ICSValueDesc("ROOT", new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSClasses.Begin), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSProperties.Begin), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VCALENDAR, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.VERSION, typeof(ICSClasses.Version), null),
|
||||
new ICSElemDesc(ICSTag.PRODUCT_ID, typeof(ICSClasses.ProductID), null),
|
||||
new ICSElemDesc(ICSTag.CAL_SCALE, typeof(ICSClasses.CalendarScale), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.VERSION, typeof(ICSProperties.Version), null),
|
||||
new ICSElemDesc(ICSTag.PRODUCT_ID, typeof(ICSProperties.ProductID), null),
|
||||
new ICSElemDesc(ICSTag.CAL_SCALE, typeof(ICSProperties.CalendarScale), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSValue.GREGORIAN, null)
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.METHOD, typeof(ICSClasses.Method), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.METHOD, typeof(ICSProperties.Method), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VCALENDAR, null)
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSClasses.Begin), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSProperties.Begin), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VEVENT, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSClasses.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSClasses.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSClasses.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.ACCESS_CLASS, typeof(ICSClasses.AccessClass), null),
|
||||
new ICSElemDesc(ICSTag.DT_CREATED, typeof(ICSClasses.DTCreated), null),
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSClasses.Description), null),
|
||||
new ICSElemDesc(ICSTag.GEO, typeof(ICSClasses.Geo), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSClasses.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.LOCATION, typeof(ICSClasses.Location), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSClasses.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.PRIORITY, typeof(ICSClasses.Priority), null),
|
||||
new ICSElemDesc(ICSTag.SEQ, typeof(ICSClasses.SequenceNumber), null),
|
||||
new ICSElemDesc(ICSTag.STATUS, typeof(ICSClasses.Status), null),
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSClasses.Summary), null),
|
||||
new ICSElemDesc(ICSTag.TRANSP, typeof(ICSClasses.TimeTransparency), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSClasses.Url), null),
|
||||
new ICSElemDesc(ICSTag.RECURRENCE_ID, typeof(ICSClasses.RecurrenceID), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSClasses.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.DT_END, typeof(ICSClasses.DTEnd), null),
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSClasses.Duration), null),
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSClasses.Attachment), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSClasses.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.CATEGORIES, typeof(ICSClasses.Categories), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSClasses.Comment), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSClasses.Contact), null),
|
||||
new ICSElemDesc(ICSTag.EXDATE, typeof(ICSClasses.DTException), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSClasses.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.RELATED, typeof(ICSClasses.RelatedTo), null),
|
||||
new ICSElemDesc(ICSTag.RESOURCES, typeof(ICSClasses.Resources), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSClasses.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSClasses.Begin), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSProperties.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSProperties.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSProperties.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.ACCESS_CLASS, typeof(ICSProperties.AccessClass), null),
|
||||
new ICSElemDesc(ICSTag.DT_CREATED, typeof(ICSProperties.DTCreated), null),
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSProperties.Description), null),
|
||||
new ICSElemDesc(ICSTag.GEO, typeof(ICSProperties.Geo), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSProperties.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.LOCATION, typeof(ICSProperties.Location), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSProperties.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.PRIORITY, typeof(ICSProperties.Priority), null),
|
||||
new ICSElemDesc(ICSTag.SEQ, typeof(ICSProperties.SequenceNumber), null),
|
||||
new ICSElemDesc(ICSTag.STATUS, typeof(ICSProperties.Status), null),
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSProperties.Summary), null),
|
||||
new ICSElemDesc(ICSTag.TRANSP, typeof(ICSProperties.TimeTransparency), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSProperties.Url), null),
|
||||
new ICSElemDesc(ICSTag.RECURRENCE_ID, typeof(ICSProperties.RecurrenceID), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSProperties.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.DT_END, typeof(ICSProperties.DTEnd), null),
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSProperties.Duration), null),
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSProperties.Attachment), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSProperties.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.CATEGORIES, typeof(ICSProperties.Categories), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSProperties.Comment), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSProperties.Contact), null),
|
||||
new ICSElemDesc(ICSTag.EXDATE, typeof(ICSProperties.DTException), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSProperties.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.RELATED, typeof(ICSProperties.RelatedTo), null),
|
||||
new ICSElemDesc(ICSTag.RESOURCES, typeof(ICSProperties.Resources), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSProperties.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSProperties.Begin), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VALARM, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.ACTION, typeof(ICSClasses.Action), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSElemDesc(ICSTag.ACTION, typeof(ICSProperties.Action), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSValueDesc(ICSValue.AUDIO, null),
|
||||
new ICSValueDesc(ICSValue.DISP, null),
|
||||
new ICSValueDesc(ICSValue.EMAIL, null)
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.TRIGGER, typeof(ICSClasses.Trigger), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSClasses.Duration), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.REPEAT, typeof(ICSClasses.RepeatCount), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSClasses.Attachment), null), // audio, email
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSClasses.Description), null),// display, eamil
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSClasses.Summary), null), // email
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSClasses.Attendee), null), // email
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSElemDesc(ICSTag.TRIGGER, typeof(ICSProperties.Trigger), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSProperties.Duration), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.REPEAT, typeof(ICSProperties.RepeatCount), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSProperties.Attachment), null), // audio, email
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSProperties.Description), null),// display, eamil
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSProperties.Summary), null), // email
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSProperties.Attendee), null), // email
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSValueDesc(ICSTag.VALARM, null)
|
||||
})
|
||||
})
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VEVENT, null)
|
||||
})
|
||||
}),
|
||||
new ICSValueDesc(ICSTag.VTODO, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSClasses.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSClasses.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.ACCESS_CLASS, typeof(ICSClasses.AccessClass), null),
|
||||
new ICSElemDesc(ICSTag.COMPLETED, typeof(ICSClasses.DTCompleted), null),
|
||||
new ICSElemDesc(ICSTag.DT_CREATED, typeof(ICSClasses.DTCreated), null),
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSClasses.Description), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSClasses.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.GEO, typeof(ICSClasses.Geo), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSClasses.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.LOCATION, typeof(ICSClasses.Location), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSClasses.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.PERCENT, typeof(ICSClasses.PercentComplete), null),
|
||||
new ICSElemDesc(ICSTag.PRIORITY, typeof(ICSClasses.Priority), null),
|
||||
new ICSElemDesc(ICSTag.RECURRENCE_ID, typeof(ICSClasses.RecurrenceID), null),
|
||||
new ICSElemDesc(ICSTag.SEQ, typeof(ICSClasses.SequenceNumber), null),
|
||||
new ICSElemDesc(ICSTag.STATUS, typeof(ICSClasses.Status), null),
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSClasses.Summary), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSClasses.Url), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSClasses.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.DUE, typeof(ICSClasses.DTDue), null),
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSClasses.Duration), null),
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSClasses.Attachment), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSClasses.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.CATEGORIES, typeof(ICSClasses.Categories), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSClasses.Comment), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSClasses.Contact), null),
|
||||
new ICSElemDesc(ICSTag.EXDATE, typeof(ICSClasses.DTException), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSClasses.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.RELATED, typeof(ICSClasses.RelatedTo), null),
|
||||
new ICSElemDesc(ICSTag.RESOURCES, typeof(ICSClasses.Resources), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSClasses.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSClasses.Begin), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSProperties.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSProperties.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.ACCESS_CLASS, typeof(ICSProperties.AccessClass), null),
|
||||
new ICSElemDesc(ICSTag.COMPLETED, typeof(ICSProperties.DTCompleted), null),
|
||||
new ICSElemDesc(ICSTag.DT_CREATED, typeof(ICSProperties.DTCreated), null),
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSProperties.Description), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSProperties.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.GEO, typeof(ICSProperties.Geo), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSProperties.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.LOCATION, typeof(ICSProperties.Location), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSProperties.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.PERCENT, typeof(ICSProperties.PercentComplete), null),
|
||||
new ICSElemDesc(ICSTag.PRIORITY, typeof(ICSProperties.Priority), null),
|
||||
new ICSElemDesc(ICSTag.RECURRENCE_ID, typeof(ICSProperties.RecurrenceID), null),
|
||||
new ICSElemDesc(ICSTag.SEQ, typeof(ICSProperties.SequenceNumber), null),
|
||||
new ICSElemDesc(ICSTag.STATUS, typeof(ICSProperties.Status), null),
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSProperties.Summary), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSProperties.Url), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSProperties.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.DUE, typeof(ICSProperties.DTDue), null),
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSProperties.Duration), null),
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSProperties.Attachment), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSProperties.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.CATEGORIES, typeof(ICSProperties.Categories), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSProperties.Comment), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSProperties.Contact), null),
|
||||
new ICSElemDesc(ICSTag.EXDATE, typeof(ICSProperties.DTException), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSProperties.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.RELATED, typeof(ICSProperties.RelatedTo), null),
|
||||
new ICSElemDesc(ICSTag.RESOURCES, typeof(ICSProperties.Resources), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSProperties.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSProperties.Begin), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VALARM, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.ACTION, typeof(ICSClasses.Action), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSElemDesc(ICSTag.ACTION, typeof(ICSProperties.Action), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSValueDesc(ICSValue.AUDIO, null),
|
||||
new ICSValueDesc(ICSValue.DISP, null),
|
||||
new ICSValueDesc(ICSValue.EMAIL, null)
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.TRIGGER, typeof(ICSClasses.Trigger), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSClasses.Duration), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.REPEAT, typeof(ICSClasses.RepeatCount), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSClasses.Attachment), null), // audio, email
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSClasses.Description), null),// display, eamil
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSClasses.Summary), null), // email
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSClasses.Attendee), null), // email
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSElemDesc(ICSTag.TRIGGER, typeof(ICSProperties.Trigger), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.DURATION, typeof(ICSProperties.Duration), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.REPEAT, typeof(ICSProperties.RepeatCount), null), // audio, display, email
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSProperties.Attachment), null), // audio, email
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSProperties.Description), null),// display, eamil
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSProperties.Summary), null), // email
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSProperties.Attendee), null), // email
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] { // audio, display, email
|
||||
new ICSValueDesc(ICSTag.VALARM, null)
|
||||
})
|
||||
})
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VTODO, null)
|
||||
})
|
||||
}),
|
||||
new ICSValueDesc(ICSTag.VJOURNAL, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSClasses.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSClasses.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.ACCESS_CLASS, typeof(ICSClasses.AccessClass), null),
|
||||
new ICSElemDesc(ICSTag.DT_CREATED, typeof(ICSClasses.DTCreated), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSClasses.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSClasses.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSClasses.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.RECURRENCE_ID, typeof(ICSClasses.RecurrenceID), null),
|
||||
new ICSElemDesc(ICSTag.SEQ, typeof(ICSClasses.SequenceNumber), null),
|
||||
new ICSElemDesc(ICSTag.STATUS, typeof(ICSClasses.Status), null),
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSClasses.Summary), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSClasses.Url), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSClasses.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSClasses.Attachment), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSClasses.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.CATEGORIES, typeof(ICSClasses.Categories), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSClasses.Comment), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSClasses.Contact), null),
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSClasses.Description), null),
|
||||
new ICSElemDesc(ICSTag.EXDATE, typeof(ICSClasses.DTException), null),
|
||||
new ICSElemDesc(ICSTag.RELATED, typeof(ICSClasses.RelatedTo), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSClasses.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSClasses.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSProperties.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSProperties.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.ACCESS_CLASS, typeof(ICSProperties.AccessClass), null),
|
||||
new ICSElemDesc(ICSTag.DT_CREATED, typeof(ICSProperties.DTCreated), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSProperties.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSProperties.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSProperties.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.RECURRENCE_ID, typeof(ICSProperties.RecurrenceID), null),
|
||||
new ICSElemDesc(ICSTag.SEQ, typeof(ICSProperties.SequenceNumber), null),
|
||||
new ICSElemDesc(ICSTag.STATUS, typeof(ICSProperties.Status), null),
|
||||
new ICSElemDesc(ICSTag.SUMMARY, typeof(ICSProperties.Summary), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSProperties.Url), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSProperties.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.ATTACHMENT, typeof(ICSProperties.Attachment), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSProperties.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.CATEGORIES, typeof(ICSProperties.Categories), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSProperties.Comment), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSProperties.Contact), null),
|
||||
new ICSElemDesc(ICSTag.DESCRIPTION, typeof(ICSProperties.Description), null),
|
||||
new ICSElemDesc(ICSTag.EXDATE, typeof(ICSProperties.DTException), null),
|
||||
new ICSElemDesc(ICSTag.RELATED, typeof(ICSProperties.RelatedTo), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSProperties.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSProperties.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VJOURNAL, null)
|
||||
})
|
||||
}),
|
||||
new ICSValueDesc(ICSTag.VFREEBUSY, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSClasses.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSClasses.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSClasses.Contact), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSClasses.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.DT_END, typeof(ICSClasses.DTEnd), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSClasses.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSClasses.Url), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSClasses.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSClasses.Comment), null),
|
||||
new ICSElemDesc(ICSTag.FREEBUSY, typeof(ICSClasses.FreeBusyTime), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSClasses.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_STAMP, typeof(ICSProperties.DTStamp), null),
|
||||
new ICSElemDesc(ICSTag.UNIQUE_ID, typeof(ICSProperties.UniqueID), null),
|
||||
new ICSElemDesc(ICSTag.CONTACT, typeof(ICSProperties.Contact), null),
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSProperties.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.DT_END, typeof(ICSProperties.DTEnd), null),
|
||||
new ICSElemDesc(ICSTag.ORGANIZER, typeof(ICSProperties.Organizer), null),
|
||||
new ICSElemDesc(ICSTag.URL, typeof(ICSProperties.Url), null),
|
||||
new ICSElemDesc(ICSTag.ATTENDEE, typeof(ICSProperties.Attendee), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSProperties.Comment), null),
|
||||
new ICSElemDesc(ICSTag.FREEBUSY, typeof(ICSProperties.FreeBusyTime), null),
|
||||
new ICSElemDesc(ICSTag.RSTATUS, typeof(ICSProperties.RequestStatus), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VFREEBUSY, null)
|
||||
})
|
||||
}),
|
||||
new ICSValueDesc(ICSTag.VTIMEZONE, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_ID, typeof(ICSClasses.TimeZoneIdentifier), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSClasses.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_URL, typeof(ICSClasses.TimeZoneUrl), null),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSClasses.Begin), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_ID, typeof(ICSProperties.TimeZoneIdentifier), null),
|
||||
new ICSElemDesc(ICSTag.DT_MODIFIED, typeof(ICSProperties.LastModified), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_URL, typeof(ICSProperties.TimeZoneUrl), null),
|
||||
new ICSElemDesc(ICSTag.BEGIN, typeof(ICSProperties.Begin), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.STANDARD, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSClasses.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_TO, typeof(ICSClasses.TimeZoneOffsetTo), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_FROM, typeof(ICSClasses.TimeZoneOffsetFrom), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSClasses.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSClasses.Comment), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSClasses.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_NAME, typeof(ICSClasses.TimeZoneName), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSProperties.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_TO, typeof(ICSProperties.TimeZoneOffsetTo), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_FROM, typeof(ICSProperties.TimeZoneOffsetFrom), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSProperties.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSProperties.Comment), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSProperties.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_NAME, typeof(ICSProperties.TimeZoneName), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.STANDARD, null)
|
||||
})
|
||||
}),
|
||||
new ICSValueDesc(ICSTag.DAYLIGHT, new ICSElemDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSClasses.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_TO, typeof(ICSClasses.TimeZoneOffsetTo), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_FROM, typeof(ICSClasses.TimeZoneOffsetFrom), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSClasses.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSClasses.Comment), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSClasses.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_NAME, typeof(ICSClasses.TimeZoneName), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.DT_START, typeof(ICSProperties.DTStart), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_TO, typeof(ICSProperties.TimeZoneOffsetTo), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_OFFSET_FROM, typeof(ICSProperties.TimeZoneOffsetFrom), null),
|
||||
new ICSElemDesc(ICSTag.RRULE, typeof(ICSProperties.RecurrenceRule), null),
|
||||
new ICSElemDesc(ICSTag.COMMENT, typeof(ICSProperties.Comment), null),
|
||||
new ICSElemDesc(ICSTag.RDATE, typeof(ICSProperties.DTRecurrence), null),
|
||||
new ICSElemDesc(ICSTag.TIME_ZONE_NAME, typeof(ICSProperties.TimeZoneName), null),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.STANDARD, null)
|
||||
})
|
||||
})
|
||||
}),
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSClasses.End), new ICSValueDesc[] {
|
||||
new ICSElemDesc(ICSTag.END, typeof(ICSProperties.End), new ICSValueDesc[] {
|
||||
new ICSValueDesc(ICSTag.VTIMEZONE, null)
|
||||
})
|
||||
})
|
||||
|
||||
106
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/AccessClass.cs
Normal file
106
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/AccessClass.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="AccessClass.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Access class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.3"/>
|
||||
public class AccessClass : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.ACCESS_CLASS;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>List of values. </summary>
|
||||
public readonly List<string> ValueList = null;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="AccessClass" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public AccessClass()
|
||||
{
|
||||
this.ValueList = new List<string>();
|
||||
this.ValueList.AddRange(new string[]
|
||||
{
|
||||
ICSValue.PUBLIC,
|
||||
ICSValue.PRIVATE,
|
||||
ICSValue.CONFIDENTIAL
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (this.ValueList.IndexOf(value) >= 0)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("in (" + Name + ") is no param supported");
|
||||
}
|
||||
|
||||
if (this.ValueList.IndexOf(valueStr) >= 0)
|
||||
{
|
||||
this.value = valueStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + valueStr + ") is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
return Name + ":" + this.value;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return AccessClass.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
111
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Action.cs
Normal file
111
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Action.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Action.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Action property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.6.1"/>
|
||||
public class Action : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.ACTION;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
public static readonly List<string> PValues
|
||||
= new List<string>(new string[]
|
||||
{
|
||||
ICSValue.AUDIO,
|
||||
ICSValue.DISP,
|
||||
ICSValue.EMAIL
|
||||
});
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Action" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Action()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (PValues.IndexOf(value) >= 0)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported value");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
int pos = PValues.IndexOf(valueStr);
|
||||
|
||||
if (pos >= 0)
|
||||
{
|
||||
this.value = valueStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsuported value (" + valueStr + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Action.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
215
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Attachment.cs
Normal file
215
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Attachment.cs
Normal file
@@ -0,0 +1,215 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Attachment.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Attachment property class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.1"/>
|
||||
public class Attachment : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.ATTACHMENT;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(ICSParam.FORMAT_TYPE, null),
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.ENCODING,
|
||||
new string[] { ICSParamValue.BIT8, ICSParamValue.BASE64 }),
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.VALUE_TYPE,
|
||||
new string[] { ICSParamValue.BINARY })
|
||||
});
|
||||
|
||||
/// <summary>Type of the value. </summary>
|
||||
private string valueType = string.Empty;
|
||||
|
||||
/// <summary>Type of the encoding. </summary>
|
||||
private string encodingType = string.Empty;
|
||||
|
||||
/// <summary>Type of the format. </summary>
|
||||
private string formatType = string.Empty;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private byte[] value;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Attachment" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Attachment()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value bytes. </summary>
|
||||
/// <value>The value bytes. </value>
|
||||
public byte[] ValueBytes
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value string. </summary>
|
||||
/// <value>The value string. </value>
|
||||
public string ValueString
|
||||
{
|
||||
get
|
||||
{
|
||||
return Encoding.UTF8.GetString(this.value, 0, this.value.Length);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = Encoding.UTF8.GetBytes(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the type of the encoding. </summary>
|
||||
/// <value>The type of the encoding. </value>
|
||||
public string EncodingType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.encodingType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value.Equals(ICSParamValue.BIT8) || value.Equals(ICSParamValue.BASE64))
|
||||
{
|
||||
this.encodingType = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the type of the value. </summary>
|
||||
/// <value>The type of the value. </value>
|
||||
public string ValueType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value.Equals(ICSParamValue.BINARY))
|
||||
{
|
||||
this.valueType = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the type of the format. </summary>
|
||||
/// <value>The type of the format. </value>
|
||||
public string FormatType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.formatType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.formatType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
foreach (string param in paramStrList)
|
||||
{
|
||||
string[] p = param.Split('=');
|
||||
|
||||
if (p.Length != 2)
|
||||
{
|
||||
throw new NotSupportedException("the number of '=' in the parameter (" + param + ") is less or greater then 1");
|
||||
}
|
||||
|
||||
switch (p[0])
|
||||
{
|
||||
case ICSParam.FORMAT_TYPE:
|
||||
this.formatType = p[1];
|
||||
break;
|
||||
case ICSParam.ENCODING:
|
||||
this.encodingType = p[1];
|
||||
break;
|
||||
case ICSParam.VALUE_TYPE:
|
||||
this.valueType = p[1];
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("Parameter with tag (" + p[0] + ") is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
if (this.encodingType.Equals(ICSParamValue.BASE64))
|
||||
{
|
||||
this.value = Convert.FromBase64String(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = Encoding.UTF8.GetBytes(valueStr);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (this.formatType.Equals(string.Empty) == false)
|
||||
{
|
||||
retValue += ";" + ICSParam.FORMAT_TYPE + "=" + this.formatType;
|
||||
}
|
||||
|
||||
if (this.encodingType.Equals(string.Empty) == false)
|
||||
{
|
||||
retValue += ";" + ICSParam.ENCODING + "=" + this.encodingType;
|
||||
}
|
||||
|
||||
if (this.valueType.Equals(string.Empty) == false)
|
||||
{
|
||||
retValue += ";" + ICSParam.VALUE_TYPE + "=" + this.valueType;
|
||||
}
|
||||
|
||||
retValue += ":" + Encoding.UTF8.GetString(this.value, 0, this.value.Length);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Attachment.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
186
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Attendee.cs
Normal file
186
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Attendee.cs
Normal file
@@ -0,0 +1,186 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Attendee.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Attendee property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.1"/>
|
||||
public class Attendee : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.ATTENDEE;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.CALENDAR_USER_TYPE,
|
||||
new string[] { ICSParamValue.INDIVIDUAL, ICSParamValue.GROUP, ICSParamValue.RESOURCE, ICSParamValue.ROOM, ICSParamValue.UNKNOWN }),
|
||||
new Tuple<string, string[]>(ICSParam.MEMBER, null),
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.PARTICIPATION_ROLE,
|
||||
new string[] { ICSParamValue.CHAIR, ICSParamValue.REQ_PARTICIPANT, ICSParamValue.OPT_PARTICIPANT, ICSParamValue.NON_PARTICIPANT }),
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.PARTICIPATION_STATUS,
|
||||
new string[] { ICSParamValue.NEEDS_ACTION, ICSParamValue.ACCEPTED, ICSParamValue.DECLINED, ICSParamValue.TENTATIVE, ICSParamValue.DELEGATED, ICSParamValue.COMPLETED, ICSParamValue.IN_PROCESS }),
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.REPLY_EXPECTATION,
|
||||
new string[] { ICSParamValue.TRUE, ICSParamValue.FALSE }),
|
||||
new Tuple<string, string[]>(ICSParam.DELEGATEES, null),
|
||||
new Tuple<string, string[]>(ICSParam.DELEGATORS, null),
|
||||
new Tuple<string, string[]>(ICSParam.SENT_BY, null),
|
||||
new Tuple<string, string[]>(ICSParam.COMMON_NAME, null),
|
||||
new Tuple<string, string[]>(ICSParam.DIR_REFERENCE, null),
|
||||
new Tuple<string, string[]>(ICSParam.LANGUAGE, null)
|
||||
});
|
||||
|
||||
/// <summary>List of parameters. </summary>
|
||||
private List<Tuple<string, string>> paramList = null;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Attendee" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Attendee()
|
||||
{
|
||||
this.paramList = new List<Tuple<string, string>>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the parameter. </summary>
|
||||
/// <value>The parameter. </value>
|
||||
public List<Tuple<string, string>> Param
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.paramList;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
for (int i = 0; i < value.Count(); i++)
|
||||
{
|
||||
if (!ICSClasses.CheckParamAndParamValue(value[i].Item1, value[i].Item2, PParams.ToArray()))
|
||||
{
|
||||
throw new NotSupportedException("param (" + value[i] + ") is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
this.paramList = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
for (int i = 0; i < paramStrList.Count(); i++)
|
||||
{
|
||||
string[] p = paramStrList[i].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported param format (" + paramStrList + ") in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(p[0], p[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + paramStrList[i] + ") in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
for (int i = 0; i < this.paramList.Count(); i++)
|
||||
{
|
||||
retValue += ";" + this.paramList[i].Item1 + "=" + this.paramList[i].Item2;
|
||||
}
|
||||
|
||||
retValue += ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Adds a parameter to value string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
public void AddParam(string paramStr, string valueStr)
|
||||
{
|
||||
if (ICSClasses.CheckParamAndParamValue(paramStr, valueStr, PParams.ToArray()))
|
||||
{
|
||||
this.RemoveParam(paramStr);
|
||||
|
||||
this.paramList.Add(new Tuple<string, string>(paramStr, valueStr));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Removes the parameter described by parameter string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public void RemoveParam(string paramStr)
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(paramStr, this.paramList.ToArray());
|
||||
|
||||
if (pos >= 0)
|
||||
{
|
||||
this.paramList.RemoveAt(pos);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Attendee.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
115
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Begin.cs
Normal file
115
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Begin.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Begin.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Begin property class</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013.</remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545"/>
|
||||
public class Begin : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name. </summary>
|
||||
public static readonly string Name = ICSTag.BEGIN;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
public static readonly List<string> PValues
|
||||
= new List<string>(new string[]
|
||||
{
|
||||
ICSTag.VCALENDAR,
|
||||
ICSTag.VEVENT,
|
||||
ICSTag.VTODO,
|
||||
ICSTag.VJOURNAL,
|
||||
ICSTag.VFREEBUSY,
|
||||
ICSTag.VTIMEZONE,
|
||||
ICSTag.STANDARD,
|
||||
ICSTag.DAYLIGHT,
|
||||
ICSTag.VALARM
|
||||
});
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Begin" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Begin()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (PValues.IndexOf(value) >= 0)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
if (PValues.IndexOf(valueStr) >= 0)
|
||||
{
|
||||
this.value = valueStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value " + valueStr + ") is not suppiorted");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Begin.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
107
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/CalendarScale.cs
Normal file
107
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/CalendarScale.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="CalendarScale.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Calendar scale. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.7.1"/>
|
||||
public class CalendarScale : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.CAL_SCALE;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
public static readonly List<string> PValues
|
||||
= new List<string>(new string[]
|
||||
{
|
||||
ICSValue.GREGORIAN
|
||||
});
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="CalendarScale" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public CalendarScale()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (PValues.IndexOf(value) >= 0)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
if (PValues.IndexOf(valueStr) >= 0)
|
||||
{
|
||||
this.value = valueStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value " + valueStr + ") is not suppiorted");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return CalendarScale.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
158
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Categories.cs
Normal file
158
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Categories.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Categories.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Categories property class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.2"/>
|
||||
public class Categories : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.CATEGORIES;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(ICSParam.LANGUAGE, null)
|
||||
});
|
||||
|
||||
/// <summary>List of values. </summary>
|
||||
private List<string> valueList = null;
|
||||
|
||||
/// <summary>Type of the language. </summary>
|
||||
private string languageType = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Categories" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Categories()
|
||||
{
|
||||
this.valueList = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public List<string> Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueList;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.valueList = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the language. </summary>
|
||||
/// <value>The language. </value>
|
||||
public string Language
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.languageType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.languageType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList.Count() > 1)
|
||||
{
|
||||
throw new NotSupportedException("in (" + Name + ") is only the (" + ICSParam.LANGUAGE + ") param supported");
|
||||
}
|
||||
else if (paramStrList.Count() == 1)
|
||||
{
|
||||
string[] p = paramStrList[0].Split('=');
|
||||
|
||||
if (p.Length != 2)
|
||||
{
|
||||
throw new NotSupportedException("the number of '=' in the parameter (" + paramStrList[0] + ") is less or greater then 1");
|
||||
}
|
||||
|
||||
switch (p[0])
|
||||
{
|
||||
case ICSParam.LANGUAGE:
|
||||
this.languageType = p[1];
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("Parameter with tag (" + p[0] + ") is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
this.valueList.AddRange(valueStr.Split(','));
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (this.languageType.Equals(string.Empty) == false)
|
||||
{
|
||||
retValue += ";" + ICSParam.LANGUAGE + "=" + this.languageType;
|
||||
}
|
||||
|
||||
retValue += ":" + this.valueList.First();
|
||||
|
||||
for (int i = 1; i < this.valueList.Count(); i++)
|
||||
{
|
||||
retValue += "," + this.valueList[i];
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Adds a category. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="categoryName">Name of the category.</param>
|
||||
public void AddCategory(string categoryName)
|
||||
{
|
||||
if (this.valueList.IndexOf(categoryName) < 0)
|
||||
{
|
||||
this.valueList.Add(categoryName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Removes the category described by categoryName. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="categoryName">Name of the category.</param>
|
||||
public void RemoveCategory(string categoryName)
|
||||
{
|
||||
this.valueList.Remove(categoryName);
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Categories.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
158
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Comment.cs
Normal file
158
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Comment.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Comment.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Comment property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.4"/>
|
||||
public class Comment : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.COMMENT;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(ICSParam.ALT_REPRESENTATION, null),
|
||||
new Tuple<string, string[]>(ICSParam.LANGUAGE, null)
|
||||
});
|
||||
|
||||
/// <summary>The alternative representation. </summary>
|
||||
private string altrep = string.Empty;
|
||||
|
||||
/// <summary>Type of the language. </summary>
|
||||
private string languageType = string.Empty;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Comment" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Comment()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the alternate representation. </summary>
|
||||
/// <value>The alternate representation. </value>
|
||||
public string AltRepresentation
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.altrep;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.altrep = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the language. </summary>
|
||||
/// <value>The language. </value>
|
||||
public string Language
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.languageType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.languageType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
foreach (string param in paramStrList)
|
||||
{
|
||||
string[] p = param.Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new NotSupportedException("the number of '=' in the parameter (" + param + ") is less or greater then 1");
|
||||
}
|
||||
|
||||
switch (p[0])
|
||||
{
|
||||
case ICSParam.LANGUAGE:
|
||||
this.languageType = p[1];
|
||||
break;
|
||||
case ICSParam.ALT_REPRESENTATION:
|
||||
// TODO: test, remove DQUOTES "
|
||||
this.altrep = p[1];
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException("Parameter with tag (" + p[0] + ") is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (this.altrep.Equals(string.Empty) == false)
|
||||
{
|
||||
// TODO: add DQUOTES "
|
||||
retValue += ";" + ICSParam.ALT_REPRESENTATION + "=" + this.altrep;
|
||||
}
|
||||
|
||||
if (this.languageType.Equals(string.Empty) == false)
|
||||
{
|
||||
retValue += ";" + ICSParam.LANGUAGE + "=" + this.languageType;
|
||||
}
|
||||
|
||||
retValue += ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Comment.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Contact.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Contact.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Contact.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Contact property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.2"/>
|
||||
public class Contact : Comment // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.CONTACT;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Contact" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Contact()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Contact.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
102
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTCompleted.cs
Normal file
102
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTCompleted.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTCompleted.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTCompleted property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.1"/>
|
||||
public class DTCompleted : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.COMPLETED;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>Date/Time of the value. </summary>
|
||||
private DateTime value = DateTime.MinValue;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTCompleted" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTCompleted()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the Date/Time of the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public DateTime Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
if (paramStr == null || paramStr.Equals(string.Empty))
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = ICSClasses.UTCStringToDateTime(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + ICSClasses.DateTimeToString(this.value);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTCompleted.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
86
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTCreated.cs
Normal file
86
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTCreated.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTCreated.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTCreated property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.7.1"/>
|
||||
public class DTCreated : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.DT_CREATED;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>Date/Time of the value. </summary>
|
||||
private DateTime value = DateTime.MinValue;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTCreated" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTCreated()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the Date/Time of the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public DateTime Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there are no params supported");
|
||||
}
|
||||
|
||||
this.value = ICSClasses.UTCStringToDateTime(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + ICSClasses.DateTimeToString(this.value);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTCreated.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTDue.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTDue.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTDue.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTDue property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.3"/>
|
||||
public class DTDue : DTEnd // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.DUE;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTDue" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTDue()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTDue.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
224
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTEnd.cs
Normal file
224
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTEnd.cs
Normal file
@@ -0,0 +1,224 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTEnd.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTEnd property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.2"/>
|
||||
public class DTEnd : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.DT_END;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.VALUE_TYPE,
|
||||
new string[] { ICSParamValue.DATE_TIME, ICSParamValue.DATE }),
|
||||
new Tuple<string, string[]>(ICSParam.TIME_ZONE_ID, null)
|
||||
});
|
||||
|
||||
/// <summary>Date/Time of the value. </summary>
|
||||
private DateTime value = DateTime.MinValue;
|
||||
|
||||
/// <summary>List of parameters. </summary>
|
||||
private List<Tuple<string, string>> paramList = null;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTEnd" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTEnd()
|
||||
{
|
||||
this.paramList = new List<Tuple<string, string>>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the Date/Time of the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public DateTime Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value indicating whether this object is date. </summary>
|
||||
/// <value>true if this object is date, false if not. </value>
|
||||
public bool IsDate
|
||||
{
|
||||
get
|
||||
{
|
||||
bool isDate = false;
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos >= 0 && this.paramList[pos].Item2.Equals(ICSParamValue.DATE))
|
||||
{
|
||||
isDate = true;
|
||||
}
|
||||
|
||||
return isDate;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(ICSParam.VALUE_TYPE, (value == true) ? ICSParamValue.DATE : ICSParamValue.DATE_TIME));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.paramList[pos] = new Tuple<string, string>(ICSParam.VALUE_TYPE, (value == true) ? ICSParamValue.DATE : ICSParamValue.DATE_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the time zone. </summary>
|
||||
/// <value>The time zone. </value>
|
||||
public string TimeZone
|
||||
{
|
||||
get
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(ICSParam.TIME_ZONE_ID, this.paramList.ToArray());
|
||||
|
||||
if (pos >= 0)
|
||||
{
|
||||
return this.paramList[pos].Item2;
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(ICSParam.TIME_ZONE_ID, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(ICSParam.TIME_ZONE_ID, value));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.paramList[pos] = new Tuple<string, string>(ICSParam.TIME_ZONE_ID, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
if (paramStrList.Count() > 2)
|
||||
{
|
||||
throw new NotSupportedException("too many params in (" + Name + ")");
|
||||
}
|
||||
|
||||
for (int i = 0; i < paramStrList.Count(); i++)
|
||||
{
|
||||
string[] p = paramStrList[i].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("incorrect param string (" + paramStrList[0] + ")");
|
||||
}
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(p[0], this.paramList.ToArray());
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(p[0], p[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FormatException("param (" + p[0] + ") sould only occure once");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("param (" + p[0] + ") is not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool tempIsDate = ICSClasses.IsDate(valueStr);
|
||||
bool isDate = false;
|
||||
int posVal = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (posVal >= 0 && this.paramList[posVal].Item2.Equals(ICSParamValue.DATE))
|
||||
{
|
||||
isDate = true;
|
||||
}
|
||||
|
||||
if (isDate != tempIsDate)
|
||||
{
|
||||
throw new NotSupportedException("time value has not the same type as declared in param in(" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = ICSClasses.UTCStringToDateTime(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
for (int i = 0; i < this.paramList.Count(); i++)
|
||||
{
|
||||
retValue += ";" + this.paramList[i].Item1 + "=" + this.paramList[i].Item2;
|
||||
}
|
||||
|
||||
retValue += ":";
|
||||
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
bool isDate = false;
|
||||
|
||||
if (pos >= 0 && this.paramList[pos].Item2.Equals(ICSParamValue.DATE))
|
||||
{
|
||||
isDate = true;
|
||||
}
|
||||
|
||||
retValue += ICSClasses.DateTimeToString(this.value, isDate);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTEnd.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTException.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTException property class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.5.1"/>
|
||||
public class DTException : DTEnd // because structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.EXDATE;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTException" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTException()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTException.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
247
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTRecurrence.cs
Normal file
247
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTRecurrence.cs
Normal file
@@ -0,0 +1,247 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTRecurrence.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTRecurrence property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.5.2"/>
|
||||
public class DTRecurrence : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.RDATE;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.VALUE_TYPE,
|
||||
new string[] { ICSParamValue.DATE_TIME, ICSParamValue.DATE, ICSParamValue.PERIOD }),
|
||||
new Tuple<string, string[]>(ICSParam.TIME_ZONE_ID, null)
|
||||
});
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
private List<Tuple<DateTime, DateTime, TimeSpan, bool>> values = null;
|
||||
|
||||
/// <summary>List of parameters. </summary>
|
||||
private List<Tuple<string, string>> paramList = null;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTRecurrence" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTRecurrence()
|
||||
{
|
||||
this.values = new List<Tuple<DateTime, DateTime, TimeSpan, bool>>();
|
||||
this.paramList = new List<Tuple<string, string>>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public List<Tuple<DateTime, DateTime, TimeSpan, bool>> Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.values;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.values = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the type of the value. </summary>
|
||||
/// <value>The type of the value. </value>
|
||||
public string ValueType
|
||||
{
|
||||
get
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.paramList[pos].Item2;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (ICSClasses.CheckParamAndParamValue(ICSParam.VALUE_TYPE, value, PParams.ToArray()))
|
||||
{
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(ICSParam.VALUE_TYPE, value));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.paramList[pos] = new Tuple<string, string>(ICSParam.VALUE_TYPE, value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("param value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException"> Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <exception cref="NotImplementedException">Thrown when the requested operation is unimplemented.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
if (paramStrList.Count() > 1)
|
||||
{
|
||||
throw new NotSupportedException("there is only 1 param supported");
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] p = paramStrList[0].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported param format (" + paramStrList + ") in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(p[0], p[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + paramStrList[0] + ") in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string[] valSplit = valueStr.Split(',');
|
||||
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0
|
||||
|| this.paramList[pos].Item2.Equals(ICSParamValue.DATE_TIME)
|
||||
|| this.paramList[pos].Item2.Equals(ICSParamValue.DATE))
|
||||
{
|
||||
for (int i = 0; i < valSplit.Count(); i++)
|
||||
{
|
||||
this.values.Add(new Tuple<DateTime, DateTime, TimeSpan, bool>(ICSClasses.UTCStringToDateTime(valSplit[i]), DateTime.MinValue, TimeSpan.Zero, false));
|
||||
}
|
||||
}
|
||||
else if (this.paramList[pos].Item2.Equals(ICSParamValue.PERIOD))
|
||||
{
|
||||
for (int i = 0; i < valSplit.Count(); i++)
|
||||
{
|
||||
string[] subVal = valSplit[i].Split('/');
|
||||
|
||||
if (subVal.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported format in (" + valSplit[i] + ")");
|
||||
}
|
||||
|
||||
bool isNegative = false;
|
||||
|
||||
if (subVal[1][0].Equals('-') || subVal[1][0].Equals('+'))
|
||||
{
|
||||
isNegative = subVal[1][0].Equals('-');
|
||||
subVal[1] = subVal[1].Remove(0, 1);
|
||||
}
|
||||
|
||||
this.values.Add(
|
||||
new Tuple<DateTime, DateTime, TimeSpan, bool>(
|
||||
ICSClasses.UTCStringToDateTime(subVal[0]),
|
||||
subVal[1][0].Equals('P') == false ? ICSClasses.UTCStringToDateTime(subVal[1]) : DateTime.MinValue,
|
||||
subVal[1][0].Equals('P') == true ? ICSClasses.StringToTimeSpan(subVal[1]) : TimeSpan.Zero,
|
||||
isNegative));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException("unhandled value type");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
for (int i = 0; i < this.paramList.Count(); i++)
|
||||
{
|
||||
retValue += ";" + this.paramList[i].Item1 + "=" + this.paramList[i].Item2;
|
||||
}
|
||||
|
||||
retValue += ":";
|
||||
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
for (int i = 0; i < this.values.Count(); i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
retValue += ',';
|
||||
}
|
||||
|
||||
if (pos < 0 || this.paramList[pos].Item2.Equals(ICSParamValue.DATE_TIME))
|
||||
{
|
||||
retValue += ICSClasses.DateTimeToString(this.values[i].Item1);
|
||||
}
|
||||
else if (this.paramList[pos].Item2.Equals(ICSParamValue.DATE))
|
||||
{
|
||||
retValue += ICSClasses.DateTimeToString(this.values[i].Item1, true);
|
||||
}
|
||||
else if (this.paramList[pos].Item2.Equals(ICSParamValue.PERIOD))
|
||||
{
|
||||
retValue += ICSClasses.DateTimeToString(this.values[i].Item1) + "/";
|
||||
|
||||
if (this.values[i].Item3.Equals(TimeSpan.Zero))
|
||||
{
|
||||
retValue += ICSClasses.DateTimeToString(this.values[i].Item2);
|
||||
}
|
||||
else
|
||||
{
|
||||
retValue += ICSClasses.TimeSpanToString(this.values[i].Item3, this.values[i].Item4);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value type is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTRecurrence.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTStamp.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTStamp.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTStamp.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTStamp property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.7.2"/>
|
||||
public class DTStamp : DTCreated // because has same structure
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.DT_STAMP;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTStamp" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTStamp()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTStamp.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTStart.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/DTStart.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="DTStart.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>DTStart property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.4"/>
|
||||
public class DTStart : DTEnd // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.DT_START;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DTStart" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public DTStart()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return DTStart.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Description.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Description property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.5"/>
|
||||
public class Description : Comment // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.DESCRIPTION;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Description" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Description()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Description.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
118
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Duration.cs
Normal file
118
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Duration.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Duration.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Duration property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.5"/>
|
||||
public class Duration : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.DURATION;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private TimeSpan value = TimeSpan.Zero;
|
||||
|
||||
/// <summary>true if this object is negative. </summary>
|
||||
private bool isNegative = false;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Duration" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Duration()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public TimeSpan Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value indicating whether this object is negative. </summary>
|
||||
/// <value>true if this object is negative, false if not. </value>
|
||||
public bool IsNegative
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isNegative;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.isNegative = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("params are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (valueStr[0].Equals('-') || valueStr[0].Equals('+'))
|
||||
{
|
||||
this.isNegative = valueStr[0].Equals('-');
|
||||
valueStr = valueStr.Remove(0, 1);
|
||||
}
|
||||
|
||||
this.value = ICSClasses.StringToTimeSpan(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + ICSClasses.TimeSpanToString(this.value, this.isNegative);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Duration.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
56
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/End.cs
Normal file
56
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/End.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="End.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>End property class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545"/>
|
||||
public class End : Begin // same
|
||||
{
|
||||
/// <summary>The name. </summary>
|
||||
public static new readonly string Name = ICSTag.END;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static new readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
public static new readonly List<string> PValues
|
||||
= new List<string>(new string[]
|
||||
{
|
||||
ICSTag.VCALENDAR,
|
||||
ICSTag.VEVENT,
|
||||
ICSTag.VTODO,
|
||||
ICSTag.VJOURNAL,
|
||||
ICSTag.VFREEBUSY,
|
||||
ICSTag.VTIMEZONE,
|
||||
ICSTag.STANDARD,
|
||||
ICSTag.DAYLIGHT,
|
||||
ICSTag.VALARM
|
||||
});
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="End" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public End()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return End.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
222
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/FreeBusyTime.cs
Normal file
222
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/FreeBusyTime.cs
Normal file
@@ -0,0 +1,222 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="FreeBusyTime.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Free busy time property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.6"/>
|
||||
public class FreeBusyTime : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.FREEBUSY;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.FREE_BUSY_TIME_TYPE,
|
||||
new string[] { ICSParamValue.FREE, ICSParamValue.BUSY, ICSParamValue.BUSY_UNAVAILABLE, ICSParamValue.BUSY_TENTATIVE })
|
||||
});
|
||||
|
||||
/// <summary>Type of the free busy. </summary>
|
||||
private string freebusyType = string.Empty;
|
||||
|
||||
/// <summary>List of values. </summary>
|
||||
private List<Tuple<DateTime, TimeSpan, DateTime, bool>> valueList = null;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="FreeBusyTime" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public FreeBusyTime()
|
||||
{
|
||||
this.valueList = new List<Tuple<DateTime, TimeSpan, DateTime, bool>>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a list of values. </summary>
|
||||
/// <value>A List of values. </value>
|
||||
public List<Tuple<DateTime, TimeSpan, DateTime, bool>> ValueList
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueList;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.valueList = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the type of the free busy. </summary>
|
||||
/// <value>The type of the free busy. </value>
|
||||
public string FreeBusyType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.freebusyType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!ICSClasses.CheckParamAndParamValue(ICSParam.FREE_BUSY_TIME_TYPE, value, PParams.ToArray()))
|
||||
{
|
||||
throw new NotSupportedException("param value (" + value + ") is not supported");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.freebusyType = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
if (paramStrList.Count() > 1)
|
||||
{
|
||||
throw new NotSupportedException("there is only 1 param in (" + Name + ") supported");
|
||||
}
|
||||
|
||||
string[] p = paramStrList[0].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("parameter string (" + paramStrList[0] + ") is wrong");
|
||||
}
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
if (this.freebusyType.Equals(string.Empty))
|
||||
{
|
||||
this.freebusyType = p[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FormatException("param (" + p[0] + ") sould only occure once");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + p[0] + ")");
|
||||
}
|
||||
}
|
||||
|
||||
string[] valSplit = valueStr.Split(',');
|
||||
|
||||
for (int i = 0; i < valueStr.Count(); i++)
|
||||
{
|
||||
string[] subSplit = valSplit[i].Split('/');
|
||||
|
||||
if (subSplit.Count() != 2)
|
||||
{
|
||||
throw new FormatException("value has a unsupported format (" + valSplit[i] + ")");
|
||||
}
|
||||
|
||||
DateTime partDTStart = ICSClasses.UTCStringToDateTime(subSplit[0]);
|
||||
TimeSpan partTSDur = TimeSpan.Zero;
|
||||
DateTime partDTEnd = DateTime.MinValue;
|
||||
bool partTSDurNegative = false;
|
||||
|
||||
if (subSplit[1][subSplit[1].Length - 1].Equals('Z')
|
||||
|| (subSplit[1][subSplit[1].Length - 1] >= '0' && subSplit[1][subSplit[1].Length - 1] <= '9'))
|
||||
{
|
||||
partDTEnd = ICSClasses.UTCStringToDateTime(subSplit[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (subSplit[1][0].Equals('-') || subSplit[1][0].Equals('+'))
|
||||
{
|
||||
partTSDurNegative = subSplit[1][0].Equals('-');
|
||||
subSplit[1] = subSplit[1].Remove(0, 1);
|
||||
}
|
||||
|
||||
partTSDur = ICSClasses.StringToTimeSpan(subSplit[1]);
|
||||
}
|
||||
|
||||
this.valueList.Add(new Tuple<DateTime, TimeSpan, DateTime, bool>(partDTStart, partTSDur, partDTEnd, partTSDurNegative));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (!this.freebusyType.Equals(string.Empty))
|
||||
{
|
||||
retValue += ICSParam.FREE_BUSY_TIME_TYPE + "=" + this.freebusyType;
|
||||
}
|
||||
|
||||
retValue += ":";
|
||||
|
||||
for (int i = 0; i < this.valueList.Count(); i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
retValue += ",";
|
||||
}
|
||||
|
||||
retValue += ICSClasses.DateTimeToString(this.valueList[i].Item1) + "/";
|
||||
|
||||
if (this.valueList[i].Item2.Equals(TimeSpan.Zero))
|
||||
{
|
||||
retValue += ICSClasses.DateTimeToString(this.valueList[i].Item3);
|
||||
}
|
||||
else
|
||||
{
|
||||
retValue += ICSClasses.TimeSpanToString(this.valueList[i].Item2, this.valueList[i].Item4);
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Adds a value. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="datetimeStart"> Date/Time of the start.</param>
|
||||
/// <param name="timespanDur"> The duration.</param>
|
||||
/// <param name="isNegative">(Optional) the is negative.</param>
|
||||
public void AddValue(DateTime datetimeStart, TimeSpan timespanDur, bool isNegative = false)
|
||||
{
|
||||
this.valueList.Add(new Tuple<DateTime, TimeSpan, DateTime, bool>(datetimeStart, timespanDur, DateTime.MinValue, isNegative));
|
||||
}
|
||||
|
||||
/// <summary>Adds a value. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="datetimeStart">Date/Time of the start.</param>
|
||||
/// <param name="datetimeEnd"> Date/Time of the end.</param>
|
||||
public void AddValue(DateTime datetimeStart, DateTime datetimeEnd)
|
||||
{
|
||||
this.ValueList.Add(new Tuple<DateTime, TimeSpan, DateTime, bool>(datetimeStart, TimeSpan.Zero, datetimeEnd, false));
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return FreeBusyTime.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
119
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Geo.cs
Normal file
119
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Geo.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Geo.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Geo property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.6"/>
|
||||
public class Geo : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.GEO;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private Tuple<float, float> value = null;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Geo" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Geo()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public Tuple<float, float> Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
if (paramStr == null || paramStr.Equals(string.Empty))
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
string[] valSplit = valueStr.Split(';');
|
||||
|
||||
if (valSplit.Count() != 2)
|
||||
{
|
||||
throw new FormatException("there are not 2 float values, seperated by ';', in the value string");
|
||||
}
|
||||
|
||||
this.value = new Tuple<float, float>(float.Parse(valSplit[0]), float.Parse(valSplit[1]));
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (this.value == null)
|
||||
{
|
||||
throw new NotSupportedException("there is no value set for (" + Name + ")");
|
||||
}
|
||||
|
||||
retValue += ":" + this.value.Item1.ToString() + ";" + this.value.Item2.ToString();
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Geo.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="IANAProperty.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
/// <summary>IANA property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public class IANAProperty
|
||||
{
|
||||
// 3.8.8.1.
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="LastModified.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Last modified property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.7.3"/>
|
||||
public class LastModified : DTCreated // because has same structure
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.DT_MODIFIED;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="LastModified" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public LastModified()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return LastModified.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Location.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Location.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Location.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Location property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.7"/>
|
||||
public class Location : Comment // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.LOCATION;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Location" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Location()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Location.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
86
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Method.cs
Normal file
86
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Method.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Method.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Method property class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.7.2"/>
|
||||
public class Method : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.METHOD;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Method" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Method()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Method.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="NonStandardProperty.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
/// <summary>Non standard property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public class NonStandardProperty
|
||||
{
|
||||
// 3.8.8.2.
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
47
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Organizer.cs
Normal file
47
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Organizer.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Organizer.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Organizer property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.3"/>
|
||||
public class Organizer : Attendee // nearly the same structure
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.ORGANIZER;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static new readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(ICSParam.COMMON_NAME, null),
|
||||
new Tuple<string, string[]>(ICSParam.DIR_REFERENCE, null),
|
||||
new Tuple<string, string[]>(ICSParam.SENT_BY, null),
|
||||
new Tuple<string, string[]>(ICSParam.LANGUAGE, null)
|
||||
});
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Organizer" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Organizer()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Organizer.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PercentComplete.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Percent complete. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.8"/>
|
||||
public class PercentComplete : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.PERCENT;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private int value = -1;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="PercentComplete" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public PercentComplete()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public int Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if ((value >= 0) && (value <= 100))
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value must be in rang of [0..100] in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
if (paramStr == null || paramStr.Equals(string.Empty))
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = int.Parse(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (this.value < 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no value set for (" + Name + ")");
|
||||
}
|
||||
|
||||
retValue += ":" + this.value.ToString();
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return PercentComplete.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
125
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Priority.cs
Normal file
125
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Priority.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Priority.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Priority property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.9"/>
|
||||
public class Priority : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.PRIORITY;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private int value = -1;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Priority" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Priority()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public int Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value >= 0 && value <= 9)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value must be in rage of [0..9] in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
if (paramStr == null || paramStr.Equals(string.Empty))
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException"> Thrown when the requested operation is not
|
||||
/// supported.</exception>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Thrown when one or more arguments are outside the
|
||||
/// required range.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = int.Parse(valueStr);
|
||||
|
||||
if ((this.value < 0) || (this.value > 9))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value must be in the range of [0..9] in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (this.value < 0 || this.value > 9)
|
||||
{
|
||||
throw new NotSupportedException("there is no value set for (" + Name + ")");
|
||||
}
|
||||
|
||||
retValue += ":" + this.value.ToString();
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Priority.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
86
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/ProductID.cs
Normal file
86
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/ProductID.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="ProductID.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Product identifier. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.7.3"/>
|
||||
public class ProductID : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.PRODUCT_ID;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string>> PParams
|
||||
= new List<Tuple<string, string>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="ProductID" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public ProductID()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return ProductID.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="RecurrenceID.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Recurrence identifier property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.4"/>
|
||||
public class RecurrenceID : DTEnd // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.RECURRENCE_ID;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="RecurrenceID" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public RecurrenceID()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return RecurrenceID.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="RecurrenceRule.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Recurrence rule property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.5.3"/>
|
||||
public class RecurrenceRule : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.RRULE;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PValues
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSValue.FREQ,
|
||||
new string[] { ICSValueValue.SECONDLY, ICSValueValue.MINUTELY, ICSValueValue.HOURLY, ICSValueValue.DAILY, ICSValueValue.WEEKLY, ICSValueValue.MONTHLY, ICSValueValue.YEARLY }),
|
||||
new Tuple<string, string[]>(
|
||||
ICSValue.UNTIL,
|
||||
new string[] { ICSValueValue.DATE, ICSValueValue.DATE_TIME }),
|
||||
new Tuple<string, string[]>(ICSValue.COUNT, null),
|
||||
new Tuple<string, string[]>(ICSValue.INTERVAL, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_SECOND, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_MINUTE, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_HOUR, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_DAY, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_MONTH_DAY, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_YEAR_DAY, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_WEEK_NO, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_MONTH, null),
|
||||
new Tuple<string, string[]>(ICSValue.BY_SET_POS, null),
|
||||
new Tuple<string, string[]>(
|
||||
ICSValue.WKST,
|
||||
new string[] { ICSValueValue.DAY_SU, ICSValueValue.DAY_MO, ICSValueValue.DAY_TU, ICSValueValue.DAY_WE, ICSValueValue.DAY_TH, ICSValueValue.DAY_FR, ICSValueValue.DAY_SA })
|
||||
});
|
||||
|
||||
/// <summary>The values. </summary>
|
||||
private List<Tuple<string, List<string>>> values = null;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="RecurrenceRule" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public RecurrenceRule()
|
||||
{
|
||||
this.values = new List<Tuple<string, List<string>>>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public List<Tuple<string, List<string>>> Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.values;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.values = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
string[] valSplit = valueStr.Split(';');
|
||||
|
||||
for (int i = 0; i < valSplit.Count(); i++)
|
||||
{
|
||||
string[] subVal = valSplit[i].Split('=');
|
||||
|
||||
if (subVal.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported format (" + valSplit[i] + ")");
|
||||
}
|
||||
|
||||
string[] subValVal = subVal[1].Split(',');
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(subVal[0], subValVal, PValues.ToArray()))
|
||||
{
|
||||
this.values.Add(new Tuple<string, List<string>>(subVal[0], new List<string>(subValVal)));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported value (" + valSplit[i] + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":";
|
||||
|
||||
for (int i = 0; i < this.values.Count(); i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
retValue += ';';
|
||||
}
|
||||
|
||||
retValue += this.values[i].Item1 + "=";
|
||||
|
||||
for (int k = 0; k < this.values[i].Item2.Count(); k++)
|
||||
{
|
||||
if (k > 0)
|
||||
{
|
||||
retValue += ",";
|
||||
}
|
||||
|
||||
retValue += this.values[i].Item2[k];
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return RecurrenceRule.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
145
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/RelatedTo.cs
Normal file
145
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/RelatedTo.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="RelatedTo.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Related to property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.5"/>
|
||||
public class RelatedTo : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.RELATED;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.RELATIONSHIP_TYPE,
|
||||
new string[] { ICSParamValue.PARENT, ICSParamValue.CHILD, ICSParamValue.SIBLING })
|
||||
});
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Type of the real. </summary>
|
||||
private string realType = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="RelatedTo" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public RelatedTo()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the type of the real. </summary>
|
||||
/// <value>The type of the real. </value>
|
||||
public string RealType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.realType;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (ICSClasses.CheckParamAndParamValue(ICSParam.RELATIONSHIP_TYPE, value, PParams.ToArray()))
|
||||
{
|
||||
this.realType = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("param value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
if (paramStrList.Count() > 1)
|
||||
{
|
||||
throw new NotSupportedException("there is only 1 param supported");
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] p = paramStrList[0].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported param format (" + paramStrList + ") in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
this.realType = p[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + paramStrList[0] + ") in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (!this.realType.Equals(string.Empty))
|
||||
{
|
||||
retValue += ";" + ICSParam.RELATIONSHIP_TYPE + "=" + this.realType;
|
||||
}
|
||||
|
||||
retValue += ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return RelatedTo.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="RepeatCount.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Repeat count property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.6.2"/>
|
||||
public class RepeatCount : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.REPEAT;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private int value;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="RepeatCount" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public RepeatCount()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public int Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
value = 0;
|
||||
}
|
||||
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
this.value = int.Parse(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value.ToString();
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return RepeatCount.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
170
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/RequestStatus.cs
Normal file
170
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/RequestStatus.cs
Normal file
@@ -0,0 +1,170 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="RequestStatus.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Request status property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.8.3"/>
|
||||
public class RequestStatus : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.RSTATUS;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(ICSParam.LANGUAGE, null)
|
||||
});
|
||||
|
||||
/// <summary>List of parameters. </summary>
|
||||
private List<Tuple<string, string>> paramList = null;
|
||||
|
||||
/// <summary>The value code. </summary>
|
||||
private float valueCode = 0.0f;
|
||||
|
||||
/// <summary>List of values. </summary>
|
||||
private List<string> valueList = null;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="RequestStatus" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public RequestStatus()
|
||||
{
|
||||
this.paramList = new List<Tuple<string, string>>();
|
||||
this.valueList = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public List<string> Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueList;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value.Count() >= 1)
|
||||
{
|
||||
this.valueList = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("not enougth params");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the code. </summary>
|
||||
/// <value>The code. </value>
|
||||
public float Code
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueCode;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value < 5.0)
|
||||
{
|
||||
this.valueCode = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("code value has to be lower then 5.0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
if (paramStrList.Count() > 1)
|
||||
{
|
||||
throw new NotSupportedException("there is only 1 param supported");
|
||||
}
|
||||
|
||||
string[] p = paramStrList[0].Split('=');
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(p[0], p[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("param (" + paramStrList[0] + ") is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
string[] v = valueStr.Split(';');
|
||||
|
||||
if (v.Count() < 2)
|
||||
{
|
||||
throw new FormatException("not enought values");
|
||||
}
|
||||
|
||||
for (int i = 0; i < v.Count(); i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
this.valueCode = float.Parse(v[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.valueList.Add(v[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
for (int i = 0; i < this.paramList.Count(); i++)
|
||||
{
|
||||
retValue += ";" + this.paramList[i].Item1 + "=" + this.paramList[i].Item2;
|
||||
}
|
||||
|
||||
retValue += ":" + string.Format("{0:0.0}", this.valueCode);
|
||||
|
||||
for (int i = 0; i < this.valueList.Count(); i++)
|
||||
{
|
||||
retValue += ";" + this.valueList[i];
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return RequestStatus.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Resources.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Resources.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Resources.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Resources property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.10"/>
|
||||
public class Resources : Comment // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.RESOURCES;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Resources" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Resources()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Resources.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="SequenceNumber.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Sequence number property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.7.4"/>
|
||||
public class SequenceNumber : RepeatCount
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.SEQUENCE;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="SequenceNumber" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public SequenceNumber()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return SequenceNumber.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
151
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Status.cs
Normal file
151
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Status.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Status.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Status property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.11"/>
|
||||
public class Status : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.STATUS;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value list event. </summary>
|
||||
public readonly List<string> ValueListEvent = null;
|
||||
|
||||
/// <summary>The value list to do. </summary>
|
||||
public readonly List<string> ValueListToDo = null;
|
||||
|
||||
/// <summary>The value list journal. </summary>
|
||||
public readonly List<string> ValueListJournal = null;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Status" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Status()
|
||||
{
|
||||
this.ValueListEvent = new List<string>();
|
||||
this.ValueListEvent.AddRange(new string[]
|
||||
{
|
||||
ICSValue.TENTATIVE,
|
||||
ICSValue.CONFIRMED,
|
||||
ICSValue.CANCELLED
|
||||
});
|
||||
|
||||
this.ValueListToDo = new List<string>();
|
||||
this.ValueListToDo.AddRange(new string[]
|
||||
{
|
||||
ICSValue.NEEDS_ACTION,
|
||||
ICSValue.COMPLETED,
|
||||
ICSValue.IN_PROCESS,
|
||||
ICSValue.CANCELLED
|
||||
});
|
||||
|
||||
this.ValueListJournal = new List<string>();
|
||||
this.ValueListJournal.AddRange(new string[]
|
||||
{
|
||||
ICSValue.DRAFT,
|
||||
ICSValue.FINAL,
|
||||
ICSValue.CANCELLED
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if ((this.ValueListEvent.IndexOf(value) >= 0)
|
||||
|| (this.ValueListToDo.IndexOf(value) >= 0)
|
||||
|| (this.ValueListJournal.IndexOf(value) >= 0))
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
if (paramStr == null || paramStr.Equals(string.Empty))
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("parameter are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
if ((this.ValueListEvent.IndexOf(valueStr) < 0)
|
||||
&& (this.ValueListToDo.IndexOf(valueStr) < 0)
|
||||
&& (this.ValueListJournal.IndexOf(valueStr) < 0))
|
||||
{
|
||||
throw new NotSupportedException("value (" + valueStr + ") is not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Status.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Summary.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Summary.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Summary.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Summary property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.1.12"/>
|
||||
public class Summary : Comment // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.SUMMARY;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Summary" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Summary()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Summary.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Timetransparency.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Time transparency property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.2.7"/>
|
||||
public class TimeTransparency : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.TRANSP;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>List of values. </summary>
|
||||
public readonly List<string> ValueList = null;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = ICSValue.OPAQUE;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="TimeTransparency" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public TimeTransparency()
|
||||
{
|
||||
this.ValueList = new List<string>();
|
||||
this.ValueList.AddRange(new string[]
|
||||
{
|
||||
ICSValue.OPAQUE,
|
||||
ICSValue.TRANSPARENT
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (this.ValueList.IndexOf(value) < 0)
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("params are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (this.ValueList.IndexOf(valueStr) < 0)
|
||||
{
|
||||
throw new NotSupportedException("value (" + valueStr + ") is not supported");
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return TimeTransparency.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="TimeZoneIdentifier.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Time zone identifier property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.3.1"/>
|
||||
public class TimeZoneIdentifier : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.TIME_ZONE_ID;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="TimeZoneIdentifier" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public TimeZoneIdentifier()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("params are not supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return TimeZoneIdentifier.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
137
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/TimeZoneName.cs
Normal file
137
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/TimeZoneName.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="TimeZoneName.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Time zone name property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.3.2"/>
|
||||
public class TimeZoneName : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.TIME_ZONE_NAME;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(ICSParam.LANGUAGE, null)
|
||||
});
|
||||
|
||||
/// <summary>The language. </summary>
|
||||
private string language = string.Empty;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="TimeZoneName" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public TimeZoneName()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the language. </summary>
|
||||
/// <value>The language. </value>
|
||||
public string Language
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.language;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.language = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
if (paramStrList.Count() > 1)
|
||||
{
|
||||
throw new NotSupportedException("there is only 1 param supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (paramStrList.Count() == 1)
|
||||
{
|
||||
string[] p = paramStrList[0].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported format in param (" + paramStrList[0] + ")");
|
||||
}
|
||||
|
||||
if (p[0].Equals(ICSParam.LANGUAGE))
|
||||
{
|
||||
this.language = p[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + p[0] + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
if (!this.language.Equals(string.Empty))
|
||||
{
|
||||
retValue += ";" + ICSParam.LANGUAGE + "=" + this.language;
|
||||
}
|
||||
|
||||
retValue += ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return TimeZoneName.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="TimeZoneOffsetFrom.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Time zone offset from property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.3.3"/>
|
||||
public class TimeZoneOffsetFrom : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.TIME_ZONE_OFFSET_FROM;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>true if this object is negative. </summary>
|
||||
private bool isNegative = false;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private TimeSpan value = TimeSpan.Zero;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="TimeZoneOffsetFrom" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public TimeZoneOffsetFrom()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public TimeSpan Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value indicating whether this object is negative. </summary>
|
||||
/// <value>true if this object is negative, false if not. </value>
|
||||
public bool IsNegative
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isNegative;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.isNegative = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException"> Thrown when the requested operation is not supported.</exception>
|
||||
/// <exception cref="NotImplementedException">Thrown when the requested operation is unimplemented.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("no param supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
if (valueStr[0].Equals('+'))
|
||||
{
|
||||
this.isNegative = false;
|
||||
}
|
||||
else if (valueStr[0].Equals('-'))
|
||||
{
|
||||
this.isNegative = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException("unhandled starting char (" + valueStr + ")");
|
||||
}
|
||||
|
||||
this.value = new TimeSpan(int.Parse(valueStr.Substring(1, 2)), int.Parse(valueStr.Substring(3, 2)), (valueStr.Length > 5) ? int.Parse(valueStr.Substring(5, 2)) : 0);
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + (this.isNegative ? "-" : "+") + string.Format("{0:HHmm}", this.value);
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return TimeZoneOffsetFrom.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="TimeZoneOffsetTo.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Time zone offset to property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.3.4"/>
|
||||
public class TimeZoneOffsetTo : TimeZoneOffsetFrom // because the structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.TIME_ZONE_OFFSET_TO;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="TimeZoneOffsetTo" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public TimeZoneOffsetTo()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return TimeZoneOffsetTo.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="TimeZoneUrl.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Time zone url property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.3.5"/>
|
||||
public class TimeZoneUrl : ICSClasses.Interface // INTERFACE: string value only
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.TIME_ZONE_URL;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private string value = string.Empty;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="TimeZoneUrl" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public TimeZoneUrl()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <param name="valueStr">The value string.</param>
|
||||
/// <param name="paramStr">The parameter string.</param>
|
||||
public override void Set(string valueStr, string paramStr)
|
||||
{
|
||||
this.Set(valueStr);
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null)
|
||||
{
|
||||
throw new NotSupportedException("no param supported in (" + Name + ")");
|
||||
}
|
||||
|
||||
this.value = valueStr;
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":" + this.value;
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return TimeZoneUrl.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
202
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Trigger.cs
Normal file
202
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Trigger.cs
Normal file
@@ -0,0 +1,202 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Trigger.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Trigger property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.6.3"/>
|
||||
public class Trigger : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.TRIGGER;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>(new Tuple<string, string[]>[]
|
||||
{
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.VALUE_TYPE,
|
||||
new string[] { ICSParamValue.DURATION, ICSParamValue.DATE_TIME }),
|
||||
new Tuple<string, string[]>(
|
||||
ICSParam.ALARM_TRIGGER_RELATIONSHIP,
|
||||
new string[] { ICSParamValue.START, ICSParamValue.END })
|
||||
});
|
||||
|
||||
/// <summary>List of parameters. </summary>
|
||||
private List<Tuple<string, string>> paramList = null;
|
||||
|
||||
/// <summary>Date/Time of the value. </summary>
|
||||
private DateTime valueDT = DateTime.MinValue;
|
||||
|
||||
/// <summary>The value. </summary>
|
||||
private TimeSpan valueTS = TimeSpan.Zero;
|
||||
|
||||
/// <summary>true to value negative. </summary>
|
||||
private bool valueTSNegative = false;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Trigger" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Trigger()
|
||||
{
|
||||
this.paramList = new List<Tuple<string, string>>();
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the Date/Time of the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public DateTime ValueDT
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueDT;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.valueDT = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public TimeSpan ValueTS
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.valueTS;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.valueTS = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets options for controlling the operation. </summary>
|
||||
/// <value>The parameters. </value>
|
||||
public List<Tuple<string, string>> Params
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.paramList;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
for (int i = 0; i < value.Count(); i++)
|
||||
{
|
||||
if (!ICSClasses.CheckParamAndParamValue(value[i].Item1, value[i].Item2, PParams.ToArray()))
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + value[i].Item1 + ") with value (" + value[i].Item2 + ")");
|
||||
}
|
||||
}
|
||||
|
||||
this.paramList = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="FormatException"> Thrown when the format of the ? is incorrect.</exception>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">(Optional) List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList = null)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
for (int i = 0; i < paramStrList.Count(); i++)
|
||||
{
|
||||
string[] p = paramStrList[i].Split('=');
|
||||
|
||||
if (p.Count() != 2)
|
||||
{
|
||||
throw new FormatException("unsupported param format (" + paramStrList[i] + ")");
|
||||
}
|
||||
|
||||
if (ICSClasses.CheckParamAndParamValue(p[0], p[1], PParams.ToArray()))
|
||||
{
|
||||
this.paramList.Add(new Tuple<string, string>(p[0], p[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported param (" + paramStrList[i] + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0 || this.paramList[pos].Item2.Equals(ICSParamValue.DURATION))
|
||||
{
|
||||
if (valueStr[0].Equals('-') || valueStr[0].Equals('+'))
|
||||
{
|
||||
this.valueTSNegative = valueStr[0].Equals('-');
|
||||
valueStr = valueStr.Remove(0, 1);
|
||||
}
|
||||
|
||||
this.valueTS = ICSClasses.StringToTimeSpan(valueStr);
|
||||
}
|
||||
else if (this.paramList[pos].Item2.Equals(ICSParamValue.DATE_TIME))
|
||||
{
|
||||
this.valueDT = ICSClasses.UTCStringToDateTime(valueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported value format");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name;
|
||||
|
||||
for (int i = 0; i < this.paramList.Count(); i++)
|
||||
{
|
||||
retValue += ";" + this.paramList[i].Item1 + "=" + this.paramList[i].Item2;
|
||||
}
|
||||
|
||||
retValue += ":";
|
||||
|
||||
int pos = ICSClasses.CheckParam(ICSParam.VALUE_TYPE, this.paramList.ToArray());
|
||||
|
||||
if (pos < 0 || this.paramList[pos].Item2.Equals(ICSParamValue.DURATION))
|
||||
{
|
||||
retValue += ICSClasses.TimeSpanToString(this.valueTS, this.valueTSNegative);
|
||||
}
|
||||
else if (this.paramList[pos].Item2.Equals(ICSParamValue.DATE_TIME))
|
||||
{
|
||||
retValue += ICSClasses.DateTimeToString(this.valueDT);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("unsupported value format");
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Trigger.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/UniqueID.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/UniqueID.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="UniqueID.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Unique identifier property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.7"/>
|
||||
public class UniqueID : TimeZoneUrl // because structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.UNIQUE_ID;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="UniqueID" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public UniqueID()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return UniqueID.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Url.cs
Normal file
35
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Url.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Url.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Url property class. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.8.4.6"/>
|
||||
public class Url : TimeZoneUrl // because structure is the same
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static new readonly string Name = ICSTag.URL;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Url" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Url()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Url.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
155
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Version.cs
Normal file
155
CampusAppWP8/CampusAppWP8/Utility/ICSProperties/Version.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="Version.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.ICSProperties
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Version property class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <see cref="http://tools.ietf.org/html/rfc5545#section-3.7.4"/>
|
||||
public class Version : ICSClasses.Interface
|
||||
{
|
||||
/// <summary>The name.</summary>
|
||||
public static readonly string Name = ICSTag.VERSION;
|
||||
|
||||
/// <summary>Options for controlling the operation. </summary>
|
||||
public static readonly List<Tuple<string, string[]>> PParams
|
||||
= new List<Tuple<string, string[]>>();
|
||||
|
||||
/// <summary>also used for single val. </summary>
|
||||
private float maxVer = -1.0f;
|
||||
|
||||
/// <summary>The minimum version. </summary>
|
||||
private float minVer = -1.0f;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="Version" /> class.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
public Version()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the value. </summary>
|
||||
/// <value>The value. </value>
|
||||
public float Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.maxVer;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value >= 0.0f)
|
||||
{
|
||||
this.maxVer = value;
|
||||
this.minVer = -1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the minimum version. </summary>
|
||||
/// <value>The minimum version. </value>
|
||||
public float MinVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.minVer;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value >= 0.0f)
|
||||
{
|
||||
this.minVer = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("value (" + value + ") is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the maximum version. </summary>
|
||||
/// <value>The maximum version. </value>
|
||||
public float MaxVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets the property/class values. Used for import from a ICS file.</summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception>
|
||||
/// <param name="valueStr"> The value string.</param>
|
||||
/// <param name="paramStrList">List of parameter strings.</param>
|
||||
public override void Set(string valueStr, string[] paramStrList)
|
||||
{
|
||||
if (paramStrList != null && paramStrList.Count() > 0)
|
||||
{
|
||||
throw new NotSupportedException("there is no param supported");
|
||||
}
|
||||
|
||||
string[] v = valueStr.Split(';');
|
||||
|
||||
if (v.Count() > 2 || v.Count() == 0)
|
||||
{
|
||||
throw new NotSupportedException("unsupported value (" + valueStr + ")");
|
||||
}
|
||||
else if (v.Count() == 2)
|
||||
{
|
||||
this.minVer = float.Parse(v[0]);
|
||||
this.maxVer = float.Parse(v[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.maxVer = float.Parse(v[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the string. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The string. </returns>
|
||||
public override string GetString()
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue += Name + ":";
|
||||
|
||||
if (this.minVer >= 0.0f)
|
||||
{
|
||||
retValue += this.minVer.ToString() + ";";
|
||||
}
|
||||
|
||||
retValue += this.maxVer.ToString();
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Gets the name. </summary>
|
||||
/// <remarks>Fiedler, 05.09.2013. </remarks>
|
||||
/// <returns>The name. </returns>
|
||||
public override string GetName()
|
||||
{
|
||||
return Version.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user