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(); }
void WriteElementsToXml(EwsServiceXmlWriter writer) { // Emit the EmailAddress element writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Email); writer.WriteValue(this.EmailAddress, XmlElementNames.Email); writer.WriteEndElement(); String encodedPhoto = Convert.ToBase64String(this.Photo); writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.Content); writer.WriteValue(encodedPhoto, XmlElementNames.Content); writer.WriteEndElement(); }
/// <summary> /// Writes elements to XML. /// </summary> /// <param name="writer">The writer.</param> internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { if (!string.IsNullOrEmpty(this.Text)) { writer.WriteValue(this.Text, XmlElementNames.UniqueBody); } }
void WriteElementsToXml(EwsServiceXmlWriter writer) { if (!StringUtils.IsNullOrEmpty(this.Text)) { writer.WriteValue(this.Text, XmlElementNames.NormalizedBody); } }
/// <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(); }
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 (!StringUtils.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); } } }
/// <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(); } if (this.Service.RequestedServerVersion >= this.GetMinimumRequiredServerVersion()) { if (this.View.PropertySet != null) { this.View.PropertySet.WriteToXml(writer, ServiceObjectType.Persona); } } }
/// <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, Uint8List 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(); }
/// <summary> /// Writes elements to XML. /// </summary> /// <param name="writer">The writer.</param> internal override void WriteElementsToXml(EwsServiceXmlWriter writer) { if (!string.IsNullOrEmpty(this.Text)) { writer.WriteValue(this.Text, XmlElementNames.NormalizedBody); } }
/// <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(); }
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 (!StringUtils.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); for (MapEntry <string, string> contextItem in this.Context) { writer.WriteStartElement(XmlNamespace.Types, "ContextProperty"); writer.WriteStartElement(XmlNamespace.Types, "Key"); writer.WriteValue(contextItem.Key, "Key"); writer.WriteEndElement(); writer.WriteStartElement(XmlNamespace.Types, "Value"); writer.WriteValue(contextItem.Value, "Value"); writer.WriteEndElement(); writer.WriteEndElement(); } writer.WriteEndElement(); // Write the Query Mode Sources writer.WriteStartElement(XmlNamespace.Messages, XmlElementNames.SearchPeopleQuerySources); for (String querySource in this.QueryMode.Sources) { writer.WriteStartElement(XmlNamespace.Types, "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); } } }
/// <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(); } if (this.Service.RequestedServerVersion >= this.GetMinimumRequiredServerVersion()) { if (this.View.PropertySet != null) { this.View.PropertySet.WriteToXml(writer, ServiceObjectType.Persona); } } }
void WriteElementsToXml(EwsServiceXmlWriter writer) { writer.WriteValue(this.Value, this.Name); }