本文整理汇总了C#中Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteElementValue方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlWriter.WriteElementValue方法的具体用法?C# EwsServiceXmlWriter.WriteElementValue怎么用?C# EwsServiceXmlWriter.WriteElementValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter
的用法示例。
在下文中一共展示了EwsServiceXmlWriter.WriteElementValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteElementsToXml
/// <summary>
/// Writes elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.FlagStatus, this.FlagStatus);
if (this.FlagStatus == ItemFlagStatus.Flagged)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.StartDate, this.StartDate);
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.DueDate, this.DueDate);
}
else if (this.FlagStatus == ItemFlagStatus.Complete)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.CompleteDate, this.CompleteDate);
}
}
示例2: 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);
}
示例3: InternalWritePropertiesToXml
/// <summary>
/// Write properties to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
{
base.InternalWritePropertiesToXml(writer);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.Interval,
this.Interval);
}
示例4: InternalWritePropertiesToXml
/// <summary>
/// Write properties to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
{
base.InternalWritePropertiesToXml(writer);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.DaysOfWeek,
this.DayOfTheWeek);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.DayOfWeekIndex,
this.DayOfTheWeekIndex);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.Month,
this.Month);
}
示例5: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
if (!string.IsNullOrEmpty(this.mailboxSmtpAddress))
{
writer.WriteElementValue(
XmlNamespace.Messages,
XmlElementNames.MailboxSmtpAddress,
this.mailboxSmtpAddress);
}
writer.WriteElementValue(
XmlNamespace.Messages,
XmlElementNames.RemoveOutlookRuleBlob,
this.RemoveOutlookRuleBlob);
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Operations);
foreach (RuleOperation operation in this.inboxRuleOperations)
{
operation.WriteToXml(writer, operation.XmlElementName);
}
writer.WriteEndElement();
}
示例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: 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
}
示例8: 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
}
示例9: WriteElementsToXml
/// <summary>
/// Writes elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
if (this.AssignCategories.Count > 0)
{
this.AssignCategories.WriteToXml(writer, XmlElementNames.AssignCategories);
}
if (this.CopyToFolder != null)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.CopyToFolder);
this.CopyToFolder.WriteToXml(writer);
writer.WriteEndElement();
}
if (this.Delete != false)
{
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.Delete,
this.Delete);
}
if (this.ForwardAsAttachmentToRecipients.Count > 0)
{
this.ForwardAsAttachmentToRecipients.WriteToXml(writer, XmlElementNames.ForwardAsAttachmentToRecipients);
}
if (this.ForwardToRecipients.Count > 0)
{
this.ForwardToRecipients.WriteToXml(writer, XmlElementNames.ForwardToRecipients);
}
if (this.MarkImportance.HasValue)
{
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MarkImportance,
this.MarkImportance.Value);
}
if (this.MarkAsRead != false)
{
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.MarkAsRead,
this.MarkAsRead);
}
if (this.MoveToFolder != null)
{
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.MoveToFolder);
this.MoveToFolder.WriteToXml(writer);
writer.WriteEndElement();
}
if (this.PermanentDelete != false)
{
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.PermanentDelete,
this.PermanentDelete);
}
if (this.RedirectToRecipients.Count > 0)
{
this.RedirectToRecipients.WriteToXml(writer, XmlElementNames.RedirectToRecipients);
}
if (this.SendSMSAlertToRecipients.Count > 0)
{
EmailAddressCollection emailCollection = ConvertSMSRecipientsFromMobilePhoneCollectionToEmailAddressCollection(this.SendSMSAlertToRecipients);
emailCollection.WriteToXml(writer, XmlElementNames.SendSMSAlertToRecipients);
}
if (this.ServerReplyWithMessage != null)
{
this.ServerReplyWithMessage.WriteToXml(writer, XmlElementNames.ServerReplyWithMessage);
}
if (this.StopProcessingRules != false)
{
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.StopProcessingRules,
this.StopProcessingRules);
}
}
示例10: 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);
}
}
}
示例11: WriteRolesToXml
/// <summary>
/// WriteRolesToXml
/// </summary>
/// <param name="writer"></param>
/// <param name="roles"></param>
/// <param name="elementName"></param>
private void WriteRolesToXml(EwsServiceXmlWriter writer, string[] roles, string elementName)
{
if (roles != null)
{
writer.WriteStartElement(XmlNamespace.Types, elementName);
foreach (string role in roles)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Role, role);
}
writer.WriteEndElement();
}
}
示例12: WriteElementsToXml
/// <summary>
/// Writes XML elements.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.ActionType, this.ActionType.ToString());
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.HoldId, this.HoldId);
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.Query, this.Query ?? string.Empty);
if (this.Mailboxes != null && this.Mailboxes.Length > 0)
{
writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Mailboxes);
foreach (string mailbox in this.Mailboxes)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.String, mailbox);
}
writer.WriteEndElement(); // Mailboxes
}
// Language
if (!string.IsNullOrEmpty(this.Language))
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.Language, this.Language);
}
if (!string.IsNullOrEmpty(this.InPlaceHoldIdentity))
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.InPlaceHoldIdentity, this.InPlaceHoldIdentity);
}
if (!string.IsNullOrEmpty(this.ItemHoldPeriod))
{
writer.WriteElementValue(XmlNamespace.Messages, XmlElementNames.ItemHoldPeriod, this.ItemHoldPeriod);
}
}
示例13: WriteElementsToXml
/// <summary>
/// Writes elements and content to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
base.WriteElementsToXml(writer);
if (writer.Service.RequestedServerVersion > ExchangeVersion.Exchange2007_SP1)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.IsContactPhoto, this.isContactPhoto);
}
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Content);
if (!string.IsNullOrEmpty(this.FileName))
{
using (FileStream fileStream = new FileStream(this.FileName, FileMode.Open, FileAccess.Read))
{
writer.WriteBase64ElementValue(fileStream);
}
}
else if (this.ContentStream != null)
{
writer.WriteBase64ElementValue(this.ContentStream);
}
else if (this.Content != null)
{
writer.WriteBase64ElementValue(this.Content);
}
else
{
EwsUtilities.Assert(
false,
"FileAttachment.WriteElementsToXml",
"The attachment's content is not set.");
}
writer.WriteEndElement();
}
示例14: WriteElementsToXml
/// <summary>
/// Writes request to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteStartElement(XmlNamespace.Autodiscover, XmlElementNames.Request);
writer.WriteStartElement(XmlNamespace.Autodiscover, XmlElementNames.Domains);
foreach (string domain in this.Domains)
{
if (!string.IsNullOrEmpty(domain))
{
writer.WriteElementValue(
XmlNamespace.Autodiscover,
XmlElementNames.Domain,
domain);
}
}
writer.WriteEndElement(); // Domains
writer.WriteStartElement(XmlNamespace.Autodiscover, XmlElementNames.RequestedSettings);
foreach (DomainSettingName setting in settings)
{
writer.WriteElementValue(
XmlNamespace.Autodiscover,
XmlElementNames.Setting,
setting);
}
writer.WriteEndElement(); // RequestedSettings
if (this.requestedVersion.HasValue)
{
writer.WriteElementValue(XmlNamespace.Autodiscover, XmlElementNames.RequestedVersion, this.requestedVersion.Value);
}
writer.WriteEndElement(); // Request
}
示例15: WriteElementsToXml
/// <summary>
/// Writes elements to XML.
/// </summary>
/// <param name="writer">The writer.</param>
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
this.UserId.WriteToXml(writer, XmlElementNames.UserId);
this.Permissions.WriteToXml(writer, XmlElementNames.DelegatePermissions);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.ReceiveCopiesOfMeetingMessages,
this.ReceiveCopiesOfMeetingMessages);
writer.WriteElementValue(
XmlNamespace.Types,
XmlElementNames.ViewPrivateItems,
this.ViewPrivateItems);
}