本文整理汇总了C#中Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteEndElement方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlWriter.WriteEndElement方法的具体用法?C# EwsServiceXmlWriter.WriteEndElement怎么用?C# EwsServiceXmlWriter.WriteEndElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter
的用法示例。
在下文中一共展示了EwsServiceXmlWriter.WriteEndElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteElementsToXml
/// <summary>
/// Writes the elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Mailbox);
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Address, this.SmtpAddress);
writer.WriteEndElement(); // Mailbox
this.OofSettings.WriteToXml(writer, XmlElementNames.UserOofSettings);
}
示例2: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Manifest);
writer.WriteBase64ElementValue(manifestStream);
writer.WriteEndElement();
}
示例3: WriteElementsToXml
/// <summary>
/// Writes the elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
foreach (byte[] item in this.content)
{
writer.WriteStartElement(XmlNamespace.Types, ByteArrayArray.ItemXmlElementName);
writer.WriteBase64ElementValue(item);
writer.WriteEndElement();
}
}
示例4: WriteToXml
/// <summary>
/// Writes to XML.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="requestedServerVersion">The requested server version.</param>
internal void WriteToXml(EwsServiceXmlWriter writer, ExchangeVersion requestedServerVersion)
{
if (string.IsNullOrEmpty(this.id))
{
throw new ArgumentException(Strings.IdPropertyMustBeSet);
}
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.OpenAsAdminOrSystemService);
writer.WriteAttributeString(XmlElementNames.LogonType, this.logonType.ToString());
if (requestedServerVersion >= ExchangeVersion.Exchange2013 && this.budgetType.HasValue)
{
writer.WriteAttributeString(XmlElementNames.BudgetType, ((int)this.budgetType.Value).ToString());
}
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.ConnectingSID);
writer.WriteElementValue(XmlNamespace.Types, this.idType.ToString(), this.id);
writer.WriteEndElement(); // ConnectingSID
writer.WriteEndElement(); // OpenAsAdminOrSystemService
}
示例5: WriteToXml
/// <summary>
/// Writes to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal void WriteToXml(EwsServiceXmlWriter writer)
{
if (string.IsNullOrEmpty(this.id))
{
throw new ArgumentException(Strings.IdPropertyMustBeSet);
}
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.ExchangeImpersonation);
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.ConnectingSID);
// For 2007 SP1, use PrimarySmtpAddress for type SmtpAddress
string connectingIdTypeLocalName =
(this.idType == ConnectingIdType.SmtpAddress) && (writer.Service.RequestedServerVersion == ExchangeVersion.Exchange2007_SP1)
? XmlElementNames.PrimarySmtpAddress
: this.IdType.ToString();
writer.WriteElementValue(
XmlNamespace.Types,
connectingIdTypeLocalName,
this.id);
writer.WriteEndElement(); // ConnectingSID
writer.WriteEndElement(); // ExchangeImpersonation
}
示例6: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Manifest);
writer.WriteBase64ElementValue(manifestStream);
writer.WriteEndElement();
if (!string.IsNullOrEmpty(this.marketplaceAssetId))
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.MarketplaceAssetId, this.marketplaceAssetId);
if (!string.IsNullOrEmpty(this.marketplaceContentMarket))
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.MarketplaceContentMarket, this.marketplaceContentMarket);
}
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.SendWelcomeEmail, this.sendWelcomeEmail);
}
writer.WriteEndElement();
}
示例7: 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();
}
示例8: WriteObjectToXml
/// <summary>
/// Writes a dictionary object (key or value) to Xml.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="xmlElementName">The Xml element name.</param>
/// <param name="dictionaryObject">The object to write.</param>
private void WriteObjectToXml(
EwsServiceXmlWriter writer,
string xmlElementName,
object dictionaryObject)
{
EwsUtilities.Assert(
writer != null,
"UserConfigurationDictionary.WriteObjectToXml",
"writer is null");
EwsUtilities.Assert(
xmlElementName != null,
"UserConfigurationDictionary.WriteObjectToXml",
"xmlElementName is null");
writer.WriteStartElement(XmlNamespace.Types, xmlElementName);
if (dictionaryObject == null)
{
EwsUtilities.Assert(
xmlElementName != XmlElementNames.DictionaryKey,
"UserConfigurationDictionary.WriteObjectToXml",
"Key is null");
writer.WriteAttributeValue(
EwsUtilities.EwsXmlSchemaInstanceNamespacePrefix,
XmlAttributeNames.Nil,
EwsUtilities.XSTrue);
}
else
{
this.WriteObjectValueToXml(writer, dictionaryObject);
}
writer.WriteEndElement();
}
示例9: WriteToXml
/// <summary>
/// Writes to XML.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="request">The request being emitted.</param>
internal void WriteToXml(EwsServiceXmlWriter writer, GetUserAvailabilityRequest request)
{
if (request.IsFreeBusyViewRequested)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.FreeBusyViewOptions);
request.TimeWindow.WriteToXmlUnscopedDatesOnly(writer, XmlElementNames.TimeWindow);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MergedFreeBusyIntervalInMinutes,
this.MergedFreeBusyInterval);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.RequestedView,
this.RequestedFreeBusyView);
writer.WriteEndElement(); // FreeBusyViewOptions
}
if (request.IsSuggestionsViewRequested)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.SuggestionsViewOptions);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.GoodThreshold,
this.GoodSuggestionThreshold);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MaximumResultsByDay,
this.MaximumSuggestionsPerDay);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MaximumNonWorkHourResultsByDay,
this.MaximumNonWorkHoursSuggestionsPerDay);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MeetingDurationInMinutes,
this.MeetingDuration);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MinimumSuggestionQuality,
this.MinimumSuggestionQuality);
TimeWindow timeWindowToSerialize = this.DetailedSuggestionsWindow == null ?
request.TimeWindow :
this.DetailedSuggestionsWindow;
timeWindowToSerialize.WriteToXmlUnscopedDatesOnly(writer, XmlElementNames.DetailedSuggestionsWindow);
if (this.CurrentMeetingTime.HasValue)
{
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.CurrentMeetingTime,
this.CurrentMeetingTime.Value);
}
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.GlobalObjectId,
this.GlobalObjectId);
writer.WriteEndElement(); // SuggestionsViewOptions
}
}
示例10: WriteElementsToXml
/// <summary>
/// Writes the elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(this.Namespace, XmlElementNames.Mailbox);
base.WriteElementsToXml(writer);
writer.WriteEndElement();
}
示例11: WriteToXml
/// <summary>
/// Writes to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal void WriteToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.MailboxData);
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Email);
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Address, this.SmtpAddress);
writer.WriteEndElement(); // Email
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.AttendeeType,
this.attendeeType);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.ExcludeConflicts,
this.excludeConflicts);
writer.WriteEndElement(); // MailboxData
}
示例12: 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();
}
示例13: WriteToXml
/// <summary>
/// WriteToXml
/// </summary>
/// <param name="writer"></param>
internal void WriteToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.ManagementRole);
WriteRolesToXml(writer, this.userRoles, XmlElementNames.UserRoles);
WriteRolesToXml(writer, this.applicationRoles, XmlElementNames.ApplicationRoles);
writer.WriteEndElement();
}
示例14: WriteUserConfigurationNameToXml
/// <summary>
/// Writes to Xml.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="xmlNamespace">The XML namespace.</param>
/// <param name="name">The user configuration name.</param>
/// <param name="parentFolderId">The Id of the folder containing the user configuration.</param>
internal static void WriteUserConfigurationNameToXml(
EwsServiceXmlWriter writer,
XmlNamespace xmlNamespace,
string name,
FolderId parentFolderId)
{
EwsUtilities.Assert(
writer != null,
"UserConfiguration.WriteUserConfigurationNameToXml",
"writer is null");
EwsUtilities.Assert(
name != null,
"UserConfiguration.WriteUserConfigurationNameToXml",
"name is null");
EwsUtilities.Assert(
parentFolderId != null,
"UserConfiguration.WriteUserConfigurationNameToXml",
"parentFolderId is null");
writer.WriteStartElement(xmlNamespace, XmlElementNames.UserConfigurationName);
writer.WriteAttributeValue(XmlAttributeNames.Name, name);
parentFolderId.WriteToXml(writer);
writer.WriteEndElement();
}
示例15: WriteToXml
/// <summary>
/// Writes to XML.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="xmlNamespace">The XML namespace.</param>
/// <param name="xmlElementName">Name of the XML element.</param>
internal void WriteToXml(
EwsServiceXmlWriter writer,
XmlNamespace xmlNamespace,
string xmlElementName)
{
EwsUtilities.Assert(
writer != null,
"UserConfiguration.WriteToXml",
"writer is null");
EwsUtilities.Assert(
xmlElementName != null,
"UserConfiguration.WriteToXml",
"xmlElementName is null");
writer.WriteStartElement(xmlNamespace, xmlElementName);
// Write the UserConfigurationName element
WriteUserConfigurationNameToXml(
writer,
XmlNamespace.Types,
this.name,
this.parentFolderId);
// Write the Dictionary element
if (this.IsPropertyUpdated(UserConfigurationProperties.Dictionary))
{
this.dictionary.WriteToXml(writer, XmlElementNames.Dictionary);
}
// Write the XmlData element
if (this.IsPropertyUpdated(UserConfigurationProperties.XmlData))
{
this.WriteXmlDataToXml(writer);
}
// Write the BinaryData element
if (this.IsPropertyUpdated(UserConfigurationProperties.BinaryData))
{
this.WriteBinaryDataToXml(writer);
}
writer.WriteEndElement();
}