本文整理汇总了C#中Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteValue方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlWriter.WriteValue方法的具体用法?C# EwsServiceXmlWriter.WriteValue怎么用?C# EwsServiceXmlWriter.WriteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter
的用法示例。
在下文中一共展示了EwsServiceXmlWriter.WriteValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
if (this.SearchFilter != null)
{
// Emit the Restriction element
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Restriction);
this.SearchFilter.WriteToXml(writer);
writer.WriteEndElement();
}
// Emit the View element
this.View.WriteToXml(writer, null);
// Emit the SortOrder
this.View.WriteOrderByToXml(writer);
// Emit the ParentFolderId element
if (this.FolderId != null)
{
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.ParentFolderId);
this.FolderId.WriteToXml(writer);
writer.WriteEndElement();
}
if (!string.IsNullOrEmpty(this.QueryString))
{
// Emit the QueryString element
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.QueryString);
writer.WriteValue(this.QueryString, XmlElementNames.QueryString);
writer.WriteEndElement();
}
// Emit the SuggestionIndex-enabled elements
if (this.SearchPeopleSuggestionIndex)
{
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleSuggestionIndex);
writer.WriteValue(this.SearchPeopleSuggestionIndex.ToString().ToLowerInvariant(), XmlElementNames.SearchPeopleSuggestionIndex);
writer.WriteEndElement();
// Write the Context key value pairs
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleContext);
foreach (KeyValuePair<string, string> contextItem in this.Context)
{
writer.WriteStartElement(XmlNamespace.Messages, "ContextProperty");
writer.WriteStartElement(XmlNamespace.Messages, "Key");
writer.WriteValue(contextItem.Key, "Key");
writer.WriteEndElement();
writer.WriteStartElement(XmlNamespace.Messages, "Value");
writer.WriteValue(contextItem.Value, "Value");
writer.WriteEndElement();
writer.WriteEndElement();
}
writer.WriteEndElement();
// Write the Query Mode Sources
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleQuerySources);
foreach (string querySource in this.QueryMode.Sources)
{
writer.WriteStartElement(XmlNamespace.Messages, "Source");
writer.WriteValue(querySource, "Source");
writer.WriteEndElement();
}
writer.WriteEndElement();
}
if (this.Service.RequestedServerVersion >= this.GetMinimumRequiredServerVersion())
{
if (this.View.PropertySet != null)
{
this.View.PropertySet.WriteToXml(writer, ServiceObjectType.Persona);
}
}
}
示例2: WriteEntryTypeToXml
/// <summary>
/// Writes a dictionary entry type to Xml.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="dictionaryObjectType">Type to write.</param>
private void WriteEntryTypeToXml(EwsServiceXmlWriter writer, UserConfigurationDictionaryObjectType dictionaryObjectType)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Type);
writer.WriteValue(dictionaryObjectType.ToString(), XmlElementNames.Type);
writer.WriteEndElement();
}
示例3: WriteEntryValueToXml
/// <summary>
/// Writes a dictionary entry value to Xml.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="value">Value to write.</param>
private void WriteEntryValueToXml(EwsServiceXmlWriter writer, string value)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Value);
// While an entry value can't be null, if the entry is an array, an element of the array can be null.
if (value != null)
{
writer.WriteValue(value, XmlElementNames.Value);
}
writer.WriteEndElement();
}
示例4: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
// Emit the EmailAddress element
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Email);
writer.WriteValue(this.EmailAddress, XmlElementNames.Email);
writer.WriteEndElement();
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SizeRequested);
writer.WriteValue(this.UserPhotoSize, XmlElementNames.SizeRequested);
writer.WriteEndElement();
}
示例5: WriteByteArrayToXml
/// <summary>
/// Writes a byte array to Xml.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="byteArray">Byte array to write.</param>
/// <param name="xmlElementName">Name of the Xml element.</param>
private static void WriteByteArrayToXml(
EwsServiceXmlWriter writer,
byte[] byteArray,
string xmlElementName)
{
EwsUtilities.Assert(
writer != null,
"UserConfiguration.WriteByteArrayToXml",
"writer is null");
EwsUtilities.Assert(
xmlElementName != null,
"UserConfiguration.WriteByteArrayToXml",
"xmlElementName is null");
writer.WriteStartElement(XmlNamespace.Types, xmlElementName);
if (byteArray != null && byteArray.Length > 0)
{
writer.WriteValue(Convert.ToBase64String(byteArray), xmlElementName);
}
writer.WriteEndElement();
}
示例6: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
// Emit the view element
//
this.View.WriteToXml(writer, null);
// Emit the Sort Order
//
this.View.WriteOrderByToXml(writer);
// Emit the Parent Folder Id
//
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.ParentFolderId);
this.FolderId.WriteToXml(writer);
writer.WriteEndElement();
// Emit the MailboxScope flag
//
if (this.MailboxScope.HasValue)
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.MailboxScope, this.MailboxScope.Value);
}
if (!string.IsNullOrEmpty(this.queryString))
{
// Emit the QueryString
//
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.QueryString);
if (this.ReturnHighlightTerms)
{
writer.WriteAttributeString(XmlAttributeNames.ReturnHighlightTerms, this.ReturnHighlightTerms.ToString().ToLowerInvariant());
}
writer.WriteValue(this.queryString, XmlElementNames.QueryString);
writer.WriteEndElement();
}
if (this.Service.RequestedServerVersion >= ExchangeVersion.Exchange2013)
{
if (this.View.PropertySet != null)
{
this.View.PropertySet.WriteToXml(writer, ServiceObjectType.Conversation);
}
}
}
示例7: WriteElementsToXml
/// <summary>
/// Writes elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteValue(this.Value, this.Name);
}
示例8: WriteElementsToXml
/// <summary>
/// Writes elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.To);
if (this.targetPeriod != null)
{
writer.WriteAttributeValue(XmlAttributeNames.Kind, PeriodTarget);
writer.WriteValue(this.targetPeriod.Id, XmlElementNames.To);
}
else
{
writer.WriteAttributeValue(XmlAttributeNames.Kind, GroupTarget);
writer.WriteValue(this.targetGroup.Id, XmlElementNames.To);
}
writer.WriteEndElement(); // To
}
示例9: WriteElementsToXml
/// <summary>
/// Writes elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
if (this.retentionId != Guid.Empty)
{
writer.WriteValue(this.retentionId.ToString(), this.xmlElementName);
}
}
示例10: WritePropertyValueToXml
/// <summary>
/// Writes the property value to XML.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="propertyBag">The property bag.</param>
/// <param name="isUpdateOperation">Indicates whether the context is an update operation.</param>
internal override void WritePropertyValueToXml(
EwsServiceXmlWriter writer,
PropertyBag propertyBag,
bool isUpdateOperation)
{
object value = propertyBag[this];
if (value != null)
{
writer.WriteStartElement(XmlNamespace.Types, this.XmlElementName);
DateTime convertedDateTime = GetConvertedDateTime(writer.Service, propertyBag, isUpdateOperation, value);
writer.WriteValue(EwsUtilities.DateTimeToXSDateTime(convertedDateTime), this.Name);
writer.WriteEndElement();
}
}