예제 #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++)
     {
         SIP_HeaderField h = (SIP_HeaderField)m_pHeaderFields[i];
         if (h.Name.ToLower() == fieldName.ToLower())
         {
             m_pHeaderFields.Remove(h);
             i--;
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Sets specified header field value. If header field existst, first found value is set.
        /// If field doesn't exist, it will be added.
        /// </summary>
        /// <param name="fieldName">Header field name.</param>
        /// <param name="value">Header field value.</param>
        public void Set(string fieldName, string value)
        {
            SIP_HeaderField h = this.GetFirst(fieldName);

            if (h != null)
            {
                h.Value = value;
            }
            else
            {
                this.Add(GetheaderField(fieldName, value));
            }
        }
예제 #3
0
 /// <summary>
 /// Adds specified header field to the end of the collection.
 /// </summary>
 /// <param name="headerField">Header field.</param>
 public void Add(SIP_HeaderField headerField)
 {
     m_pHeaderFields.Add(headerField);
 }
예제 #4
0
 /// <summary>
 /// Gets if collection contains specified header field.
 /// </summary>
 /// <param name="headerField">Header field.</param>
 /// <returns></returns>
 public bool Contains(SIP_HeaderField headerField)
 {
     return(m_pHeaderFields.Contains(headerField));
 }
예제 #5
0
 /// <summary>
 /// Removes specified header field from the collection.
 /// </summary>
 /// <param name="field">Header field to remove.</param>
 public void Remove(SIP_HeaderField field)
 {
     m_pHeaderFields.Remove(field);
 }