Esempio n. 1
0
 /// <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--;
         }
     }
 }
Esempio n. 2
0
        /// <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);
            }
        }
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="headerField">Source header field.</param>
        public ParametizedHeaderField(HeaderField headerField)
        {
            m_pHeaderField = headerField;

            m_pParameters = new HeaderFieldParameterCollection(this);
        }
Esempio n. 4
0
 /// <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);
 }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
 /// <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));
 }