示例#1
0
        // X-PROP:
        private StringBuilder ComposeFieldXTag(XTagCollection xTags)
        {
            StringBuilder output = new StringBuilder();

            if (xTags == null || xTags.Count == 0)
            {
                return(output);
            }

            Property xtag = null;
            string   value;

            int size = xTags.Count;

            for (int i = 0; i < size; i++)
            {
                XTag xtagObj = xTags[i];

                xtag  = xtagObj.Tag;
                value = xtag.Value;

                output.Append(ComposeiCalTextComponent(xtag, xtagObj.TagValue));
            }
            return(output);
        }
示例#2
0
文件: Event.cs 项目: emtees/old-code
		public Event() {
			categories = new Property();
			classEvent = new Property();
			description = new Property();
			latitude = new Property();
			longitude = new Property();
			location = new Property();
			lastModified = new Property();
			priority = new Property();
			dtStamp = new Property();
			sequence = new Property();
			status = new Property();
			summary = new Property();
			uid = new Property();
			url = new Property();
			dtEnd = new Property();
			dtStart = new Property();
			replyTime = new Property();
			duration = new Property();
			transp = new Property();
			organizer = new Property();
			rrule = new Property();
			contact = new Property();
			created = new Property();
			dalarm = new Property();
			palarm = new Property();

			xTags = new XTagCollection();

			recurrence = null;
			reminder = null;
		}
示例#3
0
文件: Event.cs 项目: retahc/old-code
        public Event()
        {
            categories   = new Property();
            classEvent   = new Property();
            description  = new Property();
            latitude     = new Property();
            longitude    = new Property();
            location     = new Property();
            lastModified = new Property();
            priority     = new Property();
            dtStamp      = new Property();
            sequence     = new Property();
            status       = new Property();
            summary      = new Property();
            uid          = new Property();
            url          = new Property();
            dtEnd        = new Property();
            dtStart      = new Property();
            replyTime    = new Property();
            duration     = new Property();
            transp       = new Property();
            organizer    = new Property();
            rrule        = new Property();
            contact      = new Property();
            created      = new Property();
            dalarm       = new Property();
            palarm       = new Property();

            xTags = new XTagCollection();

            recurrence = null;
            reminder   = null;
        }
示例#4
0
		public Calendar() {
			calScale = new Property();
			method = new Property();
			prodId = new Property();
			version = new Property();
			calEvent = new Event();

			xTags = new XTagCollection();
		}
示例#5
0
        public Calendar()
        {
            calScale = new Property();
            method   = new Property();
            prodId   = new Property();
            version  = new Property();
            calEvent = new Event();

            xTags = new XTagCollection();
        }
示例#6
0
		 // X-PROP:
		private StringBuilder ComposeFieldXTag(XTagCollection xTags) {
			StringBuilder output = new StringBuilder();

			if (xTags == null || xTags.Count == 0)
				return output;

			Property xtag = null;
			string value;

			int size = xTags.Count;
			for (int i = 0; i < size; i++) {

				XTag xtagObj = xTags[i];

				xtag = xtagObj.Tag;
				value = xtag.Value;

				output.Append(ComposeiCalTextComponent(xtag, xtagObj.TagValue));
			}
			return output;
		}
示例#7
0
        public override string Convert(Object obj)
        {
            calendar = (Calendar)obj;

            StringBuilder output = new StringBuilder(BEGIN_VCALEN);

            if (calendar.CalendarScale != null)
            {
                output.Append(ComposeFieldCalscale(calendar.CalendarScale));
            }
            if (calendar.Method != null)
            {
                output.Append(ComposeFieldMethod(calendar.Method));
            }
            if (calendar.ProductId != null)
            {
                output.Append(ComposeFieldProdId(calendar.ProductId));
            }
            if (calendar.Version != null)
            {
                output.Append(ComposeFieldVersion(calendar.Version));
            }
            // X-PROP
            output.Append(ComposeFieldXTag(calendar.XTags));

            //
            // VEVENT
            //
            if (calendar.Event != null)
            {
                output.Append(BEGIN_VEVENT);

                if (calendar.Event.Categories != null)
                {
                    output.Append(ComposeFieldCategories(calendar.Event.Categories));
                }
                if (calendar.Event.ClassEvent != null)
                {
                    output.Append(ComposeFieldClass(calendar.Event.ClassEvent));
                }
                if (calendar.Event.Description != null)
                {
                    output.Append(ComposeFieldDescription(calendar.Event.Description));
                }
                if (calendar.Event.Latitude != null ||
                    calendar.Event.Longitude != null)
                {
                    output.Append(ComposeFieldGeo(calendar.Event.Latitude,
                                                  calendar.Event.Longitude
                                                  ));
                }
                if (calendar.Event.Location != null)
                {
                    output.Append(ComposeFieldLocation(calendar.Event.Location));
                }
                if (calendar.Event.Priority != null)
                {
                    output.Append(ComposeFieldPriority(calendar.Event.Priority));
                }
                if (calendar.Event.Status != null)
                {
                    output.Append(ComposeFieldStatus(calendar.Event.Status));
                }
                if (calendar.Event.Summary != null)
                {
                    output.Append(ComposeFieldSummary(calendar.Event.Summary));
                }
                if (calendar.Event.DateEnd != null)
                {
                    output.Append(ComposeFieldDtEnd(
                                      calendar.Event.DateEnd));
                }
                if (calendar.Event.DateStart != null)
                {
                    output.Append(ComposeFieldDtStart(
                                      calendar.Event.DateStart));
                }

                //
                // NOTE: We decided not to store the duration but only Start and End
                //

                if (calendar.Event.Transport != null)
                {
                    output.Append(ComposeFieldTransp(calendar.Event.Transport));
                }
                if (calendar.Event.Organizer != null)
                {
                    output.Append(ComposeFieldOrganizer(calendar.Event.Organizer));
                }
                if (calendar.Event.Url != null)
                {
                    output.Append(ComposeFieldUrl(calendar.Event.Url));
                }
                if (calendar.Event.UID != null)
                {
                    output.Append(ComposeFieldUid(calendar.Event.UID));
                }
                if (calendar.Event.Rrule != null)
                {
                    output.Append(ComposeFieldRrule(calendar.Event.Rrule));
                }
                if (calendar.Event.Created != null)
                {
                    output.Append(composeFieldCreated(
                                      calendar.Event.Created));
                }
                if (calendar.Event.DateStamp != null)
                {
                    output.Append(ComposeFieldDtstamp(
                                      calendar.Event.DateStamp));
                }
                if (calendar.Event.LastModified != null)
                {
                    output.Append(ComposeFieldLastModified(
                                      calendar.Event.LastModified));
                }
                if (calendar.Event.Sequence != null)
                {
                    output.Append(ComposeFieldSequence(calendar.Event.Sequence));
                }
                if (calendar.Event.Contact != null)
                {
                    output.Append(this.ComposeFieldContact(calendar.Event.Contact));
                }
                if (calendar.Event.DisplayAlarm != null)
                {
                    output.Append(ComposeFieldDAlarm(calendar.Event.DisplayAlarm));
                }
                if (calendar.Event.ProcedureAlarm != null)
                {
                    output.Append(ComposeFieldPAlarm(calendar.Event.ProcedureAlarm));
                }
                if (calendar.Event.Reminder != null &&
                    calendar.Event.Reminder.IsActive)
                {
                    output.Append(
                        ComposeFieldReminder(calendar.Event.DateStart,
                                             calendar.Event.Reminder
                                             )
                        );
                }

                // X-PROP
                XTagCollection eventXTag = calendar.Event.XTags;
                output.Append(ComposeFieldXTag(eventXTag));

                output.Append(END_VEVENT);
            }
            output.Append(END_VCALEN);

            return(output.ToString());
        }