当前位置: 首页>>代码示例>>C#>>正文


C# EwsServiceXmlReader.ReadBase64ElementValue方法代码示例

本文整理汇总了C#中EwsServiceXmlReader.ReadBase64ElementValue方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlReader.ReadBase64ElementValue方法的具体用法?C# EwsServiceXmlReader.ReadBase64ElementValue怎么用?C# EwsServiceXmlReader.ReadBase64ElementValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EwsServiceXmlReader的用法示例。


在下文中一共展示了EwsServiceXmlReader.ReadBase64ElementValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadElementsFromXml

        /// <summary>
        /// Read Photo results from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            bool hasChanged = reader.ReadElementValue<bool>(XmlNamespace.Messages, XmlElementNames.HasChanged);

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.PictureData);
            byte[] photoData = reader.ReadBase64ElementValue();

            // We only get a content type if we get a photo
            if (photoData.Length > 0)
            {
                this.Results.Photo = photoData;
                this.Results.ContentType = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.ContentType);
            }

            if (hasChanged)
            {
                if (this.Results.Photo.Length == 0)
                {
                    this.Results.Status = GetUserPhotoStatus.PhotoOrUserNotFound;
                }
                else
                {
                    this.Results.Status = GetUserPhotoStatus.PhotoReturned;
                }
            }
            else
            {
                this.Results.Status = GetUserPhotoStatus.PhotoUnchanged;
            }
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:34,代码来源:GetUserPhotoResponse.cs

示例2: TryReadElementFromXml

 /// <summary>
 /// Tries to read element from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <returns>True if element was read.</returns>
 internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
 {
     if (reader.LocalName == ByteArrayArray.ItemXmlElementName)
     {
         this.content.Add(reader.ReadBase64ElementValue());
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:17,代码来源:ByteArrayArray.cs

示例3: ReadToXmlDocument

        /// <summary>
        /// Helper to convert to xml dcouemnt from the current value.
        /// </summary>
        /// <param name="reader">the reader.</param>
        /// <returns>The xml document</returns>
        internal static SafeXmlDocument ReadToXmlDocument(EwsServiceXmlReader reader)
        {
            using (MemoryStream stream = new MemoryStream())
            {
                reader.ReadBase64ElementValue(stream);
                stream.Position = 0;

                SafeXmlDocument manifest = new SafeXmlDocument();
                manifest.Load(stream);
                return manifest;
            }
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:17,代码来源:ClientApp.cs

示例4: TryReadElementFromXml

        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            bool result = base.TryReadElementFromXml(reader);

            if (!result)
            {
                if (reader.LocalName == XmlElementNames.IsContactPhoto)
                {
                    this.isContactPhoto = reader.ReadElementValue<bool>();
                }
                else if (reader.LocalName == XmlElementNames.Content)
                {
                    if (this.loadToStream != null)
                    {
                        reader.ReadBase64ElementValue(this.loadToStream);
                    }
                    else
                    {
                        // If there's a file attachment content handler, use it. Otherwise
                        // load the content into a byte array.
                        // TODO: Should we mark the attachment to indicate that content is stored elsewhere?
                        if (reader.Service.FileAttachmentContentHandler != null)
                        {
                            Stream outputStream = reader.Service.FileAttachmentContentHandler.GetOutputStream(this.Id);

                            if (outputStream != null)
                            {
                                reader.ReadBase64ElementValue(outputStream);
                            }
                            else
                            {
                                this.content = reader.ReadBase64ElementValue();
                            }
                        }
                        else
                        {
                            this.content = reader.ReadBase64ElementValue();
                        }
                    }

                    result = true;
                }
            }

            return result;
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:51,代码来源:FileAttachment.cs

示例5: TryReadElementFromXml

 /// <summary>
 /// Tries to read element from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <returns>True if element was read.</returns>
 internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
 {
     switch (reader.LocalName)
     {
         case XmlElementNames.Manifest:
             this.ManifestStream = new MemoryStream();
             reader.ReadBase64ElementValue(this.ManifestStream);
             this.ManifestStream.Position = 0;
             return true;
         
         case XmlElementNames.ClientExtensionSpecificUsers:
             this.SpecificUsers = new StringList();
             this.SpecificUsers.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ClientExtensionSpecificUsers);
             return true;
         
         default:
             return base.TryReadElementFromXml(reader);
     }
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:24,代码来源:ClientExtension.cs


注:本文中的EwsServiceXmlReader.ReadBase64ElementValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。