/// <summary>
 /// Removes all header fields with specified name from the collection.
 /// </summary>
 /// <param name="fieldName">Header field name.</param>
 public void RemoveAll(string fieldName)
 {
     for (int i = 0; i < m_pHeaderFields.Count; i++)
     {
         HeaderField h = (HeaderField)m_pHeaderFields[i];
         if (h.Name.ToLower() == fieldName.ToLower())
         {
             m_pHeaderFields.Remove(h);
             i--;
         }
     }
 }
        /// <summary>
        /// Gets header fields with specified name, returns null if specified field doesn't exist.
        /// </summary>
        /// <param name="fieldName">Header field name.</param>
        /// <returns></returns>
        public HeaderField[] Get(string fieldName)
        {
            ArrayList fields = new ArrayList();

            foreach (HeaderField h in m_pHeaderFields)
            {
                if (h.Name.ToLower() == fieldName.ToLower())
                {
                    fields.Add(h);
                }
            }

            if (fields.Count > 0)
            {
                HeaderField[] retVal = new HeaderField[fields.Count];
                fields.CopyTo(retVal);

                return(retVal);
            }
            else
            {
                return(null);
            }
        }
Exemple #3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="headerField">Source header field.</param>
        public ParametizedHeaderField(HeaderField headerField)
        {
            m_pHeaderField = headerField;

            m_pParameters = new HeaderFieldParameterCollection(this);
        }
 /// <summary>
 /// Removes specified header field from the collection.
 /// </summary>
 /// <param name="field">Header field to remove.</param>
 public void Remove(HeaderField field)
 {
     m_pHeaderFields.Remove(field);
 }
 /// <summary>
 /// Adds specified header field to the end of the collection.
 /// </summary>
 /// <param name="headerField">Header field.</param>
 public void Add(HeaderField headerField)
 {
     m_pHeaderFields.Add(headerField);
 }
 /// <summary>
 /// Gets if collection contains specified header field.
 /// </summary>
 /// <param name="headerField">Header field.</param>
 /// <returns></returns>
 public bool Contains(HeaderField headerField)
 {
     return(m_pHeaderFields.Contains(headerField));
 }