public static MediaAttribute Create(string Param) { MediaAttribute attribute = null; string[] splits = Param.Split(':'); if (splits.Count() == 2) { string name = splits[0]; string value = splits[1]; attribute = new MediaAttribute(name, value); } else if (splits.Count() == 1) { string name = splits[0]; attribute = new MediaAttribute(name); } return attribute; }
public static MediaAttribute Create(string Param) { MediaAttribute attribute = null; string[] splits = Param.Split(':'); if (splits.Count() == 2) { string name = splits[0]; string value = splits[1]; attribute = new MediaAttribute(name, value); } else if (splits.Count() == 1) { string name = splits[0]; attribute = new MediaAttribute(name); } return(attribute); }
public void Add(string type, string value) { switch (type) { case "i=": this.MediaTitle = value; break; case "c=": this.ConnectionInformation = value; break; case "b=": this.BandwidthInformation = value; break; case "k=": this.EncryptionKey = value; break; case "a=": //MediaAttribute attribute = MediaAttributeFactory.Create(value); //if(attribute!=null) // this.MediaAttributes.Add(attribute); this.MediaAttributes.Add(MediaAttribute.Create(value)); break; case "m=": { this.MediaNameAndTransportAddress = value; break; } default: //... break; } }