Exemple #1
0
        /// <summary>

        /// When converting an <see cref="ExtensibleObject"/> to a list of headers,

        /// this method adds the custom attributes (both text and binary) to the

        /// list of headers.

        /// </summary>

        /// <param name="headers">The <see cref="HeaderCollection"/> to add the custom attributes to</param>

        protected void AddCustomAttributesToHeaders(HeaderCollection headers)

        {
            if (headers != null)

            {
                foreach (KeyValuePair <string, string> item in this.CustomTextAttributes)

                {
                    Header customHeader = new CustomHeader(item.Key, item.Value);

                    headers.AddHeader(customHeader);
                }

                foreach (KeyValuePair <string, Resource> item in this.CustomBinaryAttributes)

                {
                    Header customHeader = new CustomHeader(item.Key, item.Value.ToString());

                    headers.AddHeader(customHeader);

                    headers.AssociateBinaryData(item.Value);
                }
            }
        }
 /// <summary>
 /// When converting an <see cref="ExtensibleObject"/> to a list of headers,
 /// this method adds the custom attributes (both text and binary) to the
 /// list of headers.
 /// </summary>
 /// <param name="headers">The <see cref="HeaderCollection"/> to add the custom attributes to</param>
 protected void AddCustomAttributesToHeaders(HeaderCollection headers)
 {
     if (headers != null)
     {
         foreach (KeyValuePair<string, string> item in this.CustomTextAttributes)
         {
             Header customHeader = new CustomHeader(item.Key, item.Value);
             headers.AddHeader(customHeader);
         }
         foreach (KeyValuePair<string, Resource> item in this.CustomBinaryAttributes)
         {
             Header customHeader = new CustomHeader(item.Key, item.Value.ToString());
             headers.AddHeader(customHeader);
             headers.AssociateBinaryData(item.Value);
         }
     }
 }