Monotone-Parent: 89b96d9d2226f3bc49b522e79b43098dfa922b34
Monotone-Revision: f4861ebaae0a55ed464809d54f5ecd4f0bef9913 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-04-09T18:32:22 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
c8cb1b9e39
commit
7a072049ab
|
@ -1,3 +1,8 @@
|
|||
2010-04-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalEvent.m (-propertyValue:): new method that accept a
|
||||
key-based method invocation.
|
||||
|
||||
2010-03-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalTimeZonePeriod.m (_occurenceForDate:byRRule:): fixed
|
||||
|
|
|
@ -72,6 +72,8 @@
|
|||
|
||||
- (iCalEventChanges *) getChangesRelativeToEvent: (iCalEvent *) _event;
|
||||
|
||||
- (id) propertyValue: (NSString *) property;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __NGCards_iCalEvent_H__ */
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
#import <NGExtensions/NGCalendarDateRange.h>
|
||||
|
||||
|
@ -262,4 +264,26 @@
|
|||
toEvent: self];
|
||||
}
|
||||
|
||||
- (id) propertyValue: (NSString *) property
|
||||
{
|
||||
static NSDictionary *propertyMethods = nil;
|
||||
NSString *method;
|
||||
|
||||
if (!propertyMethods)
|
||||
{
|
||||
propertyMethods = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"durationAsTimeInterval", @"duration",
|
||||
@"recurrenceRules", @"rrule",
|
||||
@"exceptionRules", @"exrule",
|
||||
@"exceptionDates", @"exdate",
|
||||
nil];
|
||||
[propertyMethods retain];
|
||||
}
|
||||
method = [propertyMethods objectForKey: property];
|
||||
if (!method)
|
||||
method = property;
|
||||
|
||||
return [self performSelector: NSSelectorFromString (method)];
|
||||
}
|
||||
|
||||
@end /* iCalEvent */
|
||||
|
|
Loading…
Reference in New Issue