本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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);
}
}