Ejemplo n.º 1
0
        /// <summary>分析</summary>
        /// <param name="value">数值</param>
        /// <returns></returns>
        public static SdpAttribute Parse(String value)
        {
            if (String.IsNullOrEmpty(value)) throw new ArgumentNullException("value");

            Int32 p = value.IndexOf("=");
            Int32 p2 = value.IndexOf(":", p);

            var entity = new SdpAttribute();
            if (p2 > 0)
            {
                entity.Name = value.Substring(p + 1, p2 - p - 1);
                entity.Value = value.Substring(p2 + 1);
            }
            else
                entity.Name = value.Substring(p + 1);

            return entity;
        }
Ejemplo n.º 2
0
        /// <summary>分析</summary>
        /// <param name="value">数值</param>
        /// <returns></returns>
        public static SdpAttribute Parse(String value)
        {
            if (String.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException("value");
            }

            var p  = value.IndexOf("=");
            var p2 = value.IndexOf(":", p);

            var entity = new SdpAttribute();

            if (p2 > 0)
            {
                entity.Name  = value.Substring(p + 1, p2 - p - 1);
                entity.Value = value.Substring(p2 + 1);
            }
            else
            {
                entity.Name = value.Substring(p + 1);
            }

            return(entity);
        }