Esempio n. 1
0
        public virtual ICalendarComponent Build(string objectName)
        {
            ICalendarComponent c;
            var name = objectName.ToUpper();

            switch (name)
            {
            case Components.Alarm:
                c = new Alarm();
                break;

            case EventStatus.Name:
                c = new CalendarEvent();
                break;

            case Components.Freebusy:
                c = new FreeBusy();
                break;

            case JournalStatus.Name:
                c = new Journal();
                break;

            case Components.Timezone:
                c = new VTimeZone();
                break;

            case TodoStatus.Name:
                c = new Todo();
                break;

            case Components.Calendar:
                c = new Calendar();
                break;

            case Components.Daylight:
            case Components.Standard:
                c = new VTimeZoneInfo();
                break;

            default:
                c = new CalendarComponent();
                break;
            }
            c.Name = name;
            return(c);
        }
Esempio n. 2
0
        public virtual ICalendarComponent Build(string objectName)
        {
            ICalendarComponent c = null;
            var name             = objectName.ToUpper();

            switch (name)
            {
            case Components.Alarm:
                c = new Alarm();
                break;

            case Components.Event:
                c = new CalendarEvent();
                break;

            case Components.Freebusy:
                c = new FreeBusy();
                break;

            case Components.Journal:
                c = new Journal();
                break;

            case Components.Timezone:
                c = new VTimeZone();
                break;

            case Components.Todo:
                c = new Todo();
                break;

            case Components.Calendar:
                c = new Calendar();
                break;

            default:
                c = new CalendarComponent();
                break;
            }
            c.Name = name;
            return(c);
        }