示例#1
0
文件: VJournal.cs 项目: nhaberl/PDI
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            VJournal o = (VJournal)p;

            this.ClearProperties();

            classification = (ClassificationProperty)o.Classification.Clone();
            categories     = (CategoriesProperty)o.Categories.Clone();
            url            = (UrlProperty)o.Url.Clone();
            uid            = (UniqueIdProperty)o.UniqueId.Clone();
            lastMod        = (LastModifiedProperty)o.LastModified.Clone();
            dateCreated    = (DateCreatedProperty)o.DateCreated.Clone();
            startDate      = (StartDateProperty)o.StartDateTime.Clone();
            timeStamp      = (TimeStampProperty)o.TimeStamp.Clone();
            summary        = (SummaryProperty)o.Summary.Clone();
            desc           = (DescriptionProperty)o.Description.Clone();
            sequence       = (SequenceProperty)o.Sequence.Clone();
            comment        = (CommentProperty)o.Comment.Clone();
            organizer      = (OrganizerProperty)o.Organizer.Clone();
            recurId        = (RecurrenceIdProperty)o.RecurrenceId.Clone();
            status         = (StatusProperty)o.Status.Clone();

            this.Contacts.CloneRange(o.Contacts);
            this.Attendees.CloneRange(o.Attendees);
            this.RelatedTo.CloneRange(o.RelatedTo);
            this.Attachments.CloneRange(o.Attachments);
            this.RequestStatuses.CloneRange(o.RequestStatuses);
            this.CustomProperties.CloneRange(o.CustomProperties);

            base.Clone(p);
        }
示例#2
0
        //=====================================================================

        /// <summary>
        /// This is overridden to allow cloning of a PDI object
        /// </summary>
        /// <returns>A clone of the object</returns>
        public override object Clone()
        {
            CommentProperty o = new CommentProperty();

            o.Clone(this);
            return(o);
        }
示例#3
0
文件: VJournal.cs 项目: nhaberl/PDI
        /// <summary>
        /// The method can be called to clear all current property values from the journal.  The version is left
        /// unchanged.
        /// </summary>
        public override void ClearProperties()
        {
            classification = null;
            categories     = null;
            url            = null;
            uid            = null;
            lastMod        = null;
            dateCreated    = null;
            startDate      = null;
            timeStamp      = null;
            summary        = null;
            desc           = null;
            sequence       = null;
            comment        = null;
            organizer      = null;
            recurId        = null;
            status         = null;

            contacts    = null;
            attendees   = null;
            relatedTo   = null;
            attachments = null;
            reqStats    = null;
            customProps = null;

            base.ClearProperties();
        }
示例#4
0
        public async Task <ActionResult <CommentProperty> > PostCommentProperty(CommentProperty commentProperty)
        {
            _context.CommentProperties.Add(commentProperty);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCommentProperty", new { id = commentProperty.CommentID }, commentProperty));
        }
示例#5
0
        public async Task <IActionResult> PutCommentProperty(int id, CommentProperty commentProperty)
        {
            if (id != commentProperty.CommentID)
            {
                return(BadRequest());
            }

            _context.Entry(commentProperty).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CommentPropertyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#6
0
        /// <summary>
        /// The method can be called to clear all current property values from the observance.  The version and
        /// rule type are left unchanged.
        /// </summary>
        public override void ClearProperties()
        {
            startDate  = null;
            offsetFrom = null;
            offsetTo   = null;
            comment    = null;

            rRules  = null;
            rDates  = null;
            tzNames = null;

            customProps = null;
        }
示例#7
0
文件: VFreeBusy.cs 项目: nhaberl/PDI
        /// <summary>
        /// The method can be called to clear all current property values from the free/busy object.  The version
        /// is left unchanged.
        /// </summary>
        public override void ClearProperties()
        {
            url       = null;
            uid       = null;
            startDate = null;
            endDate   = null;
            timeStamp = null;
            comment   = null;
            organizer = null;
            duration  = null;
            contact   = null;

            attendees   = null;
            reqstats    = null;
            freebusy    = null;
            customProps = null;
        }
示例#8
0
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            ObservanceRule o = (ObservanceRule)p;

            this.ClearProperties();

            ruleType   = o.RuleType;
            startDate  = (StartDateProperty)o.StartDateTime.Clone();
            offsetFrom = (TimeZoneOffsetProperty)o.OffsetFrom.Clone();
            offsetTo   = (TimeZoneOffsetProperty)o.OffsetTo.Clone();
            comment    = (CommentProperty)o.Comment.Clone();

            this.RecurrenceRules.CloneRange(o.RecurrenceRules);
            this.RecurDates.CloneRange(o.RecurDates);
            this.TimeZoneNames.CloneRange(o.TimeZoneNames);
            this.CustomProperties.CloneRange(o.CustomProperties);
        }
示例#9
0
        private void SetProperty(int type, object value)
        {
            Property current  = _firstProperty;
            Property previous = null;

            while (current != null && current.GetType() != type)
            {
                previous = current;
                current  = current._next;
            }
            if (current != null)
            {
                current._value = value;
            }
            else
            {
                switch (type)
                {
                case Property.COMMENT:
                {
                    current = new CommentProperty(value);
                    break;
                }

                case Property.HYPERLINK:
                {
                    current = new HyperlinkProperty(value);
                    break;
                }

                default:
                {
                    throw new ArgumentException("Invalid type: " + type);
                }
                }
                if (previous != null)
                {
                    previous._next = current;
                }
                else
                {
                    _firstProperty = current;
                }
            }
        }
示例#10
0
文件: VFreeBusy.cs 项目: nhaberl/PDI
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            VFreeBusy o = (VFreeBusy)p;

            this.ClearProperties();

            url       = (UrlProperty)o.Url.Clone();
            uid       = (UniqueIdProperty)o.UniqueId.Clone();
            startDate = (StartDateProperty)o.StartDateTime.Clone();
            endDate   = (EndDateProperty)o.EndDateTime.Clone();
            timeStamp = (TimeStampProperty)o.TimeStamp.Clone();
            comment   = (CommentProperty)o.Comment.Clone();
            organizer = (OrganizerProperty)o.Organizer.Clone();
            duration  = (DurationProperty)o.Duration.Clone();
            contact   = (ContactProperty)o.Contact.Clone();

            this.Attendees.CloneRange(o.Attendees);
            this.RequestStatuses.CloneRange(o.RequestStatuses);
            this.FreeBusy.CloneRange(o.FreeBusy);
            this.CustomProperties.CloneRange(o.CustomProperties);
        }
示例#11
0
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            VEvent o = (VEvent)p;

            this.ClearProperties();

            classification = (ClassificationProperty)o.Classification.Clone();
            categories     = (CategoriesProperty)o.Categories.Clone();
            resources      = (ResourcesProperty)o.Resources.Clone();
            url            = (UrlProperty)o.Url.Clone();
            uid            = (UniqueIdProperty)o.UniqueId.Clone();
            geo            = (GeographicPositionProperty)o.GeographicPosition.Clone();
            lastMod        = (LastModifiedProperty)o.LastModified.Clone();
            dateCreated    = (DateCreatedProperty)o.DateCreated.Clone();
            startDate      = (StartDateProperty)o.StartDateTime.Clone();
            endDate        = (EndDateProperty)o.EndDateTime.Clone();
            dateStamp      = (TimeStampProperty)o.TimeStamp.Clone();
            summary        = (SummaryProperty)o.Summary.Clone();
            desc           = (DescriptionProperty)o.Description.Clone();
            location       = (LocationProperty)o.Location.Clone();
            priority       = (PriorityProperty)o.Priority.Clone();
            sequence       = (SequenceProperty)o.Sequence.Clone();
            transp         = (TimeTransparencyProperty)o.Transparency.Clone();
            rNum           = (RecurrenceCountProperty)o.RecurrenceCount.Clone();
            comment        = (CommentProperty)o.Comment.Clone();
            organizer      = (OrganizerProperty)o.Organizer.Clone();
            recurId        = (RecurrenceIdProperty)o.RecurrenceId.Clone();
            status         = (StatusProperty)o.Status.Clone();
            duration       = (DurationProperty)o.Duration.Clone();

            this.Contacts.CloneRange(o.Contacts);
            this.Attendees.CloneRange(o.Attendees);
            this.RelatedTo.CloneRange(o.RelatedTo);
            this.Attachments.CloneRange(o.Attachments);
            this.RequestStatuses.CloneRange(o.RequestStatuses);
            this.Alarms.CloneRange(o.Alarms);
            this.CustomProperties.CloneRange(o.CustomProperties);

            base.Clone(p);
        }
示例#12
0
        //=====================================================================

        /// <summary>
        /// This is overridden to allow cloning of a PDI object
        /// </summary>
        /// <returns>A clone of the object</returns>
        public override object Clone()
        {
            CommentProperty o = new CommentProperty();
            o.Clone(this);
            return o;
        }
示例#13
0
 set => SetValue(CommentProperty, value);