当前位置: 首页>>代码示例>>C#>>正文


C# EwsServiceXmlWriter.WriteValue方法代码示例

本文整理汇总了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);
                }
            }
        }
开发者ID:Robby1975,项目名称:ews-managed-api,代码行数:80,代码来源:FindPeopleRequest.cs

示例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();
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:11,代码来源:UserConfigurationDictionary.cs

示例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();
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:17,代码来源:UserConfigurationDictionary.cs

示例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();
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:GetUserPhotoRequest.cs

示例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();
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:29,代码来源:UserConfiguration.cs

示例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);
                }
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:50,代码来源:FindConversationRequest.cs

示例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);
 }
开发者ID:asine,项目名称:ews-managed-api,代码行数:8,代码来源:InternetMessageHeader.cs

示例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
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:21,代码来源:TimeZoneTransition.cs

示例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);
     }
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:11,代码来源:RetentionTagBase.cs

示例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();
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:24,代码来源:DateTimePropertyDefinition.cs


注:本文中的Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。