コード例 #1
0
        public PublishedCalendarItemData GetItemData(StoreObjectId itemId)
        {
            base.CheckDisposed("GetItemData");
            PublishedCalendarItemData result;

            using (CalendarItemBase item = this.GetItem(itemId, null))
            {
                string bodyText = string.Empty;
                if (this.DetailLevel == DetailLevelEnumType.FullDetails)
                {
                    using (TextReader textReader = item.Body.OpenTextReader(BodyFormat.TextPlain))
                    {
                        bodyText = textReader.ReadToEnd();
                    }
                }
                result = new PublishedCalendarItemData
                {
                    Subject  = item.Subject,
                    Location = item.Location,
                    When     = item.GenerateWhen(),
                    BodyText = bodyText
                };
            }
            return(result);
        }