comparison Pml/Elements/Collection.cs @ 1:28dc7d535036

Small improvements, introduced PacketStream
author Ivo Smits <Ivo@UCIS.nl>
date Mon, 07 Jan 2013 16:43:28 +0100
parents 3ab940a0c7a0
children 8fe322656807
comparison
equal deleted inserted replaced
0:3ab940a0c7a0 1:28dc7d535036
4 4
5 namespace UCIS.Pml { 5 namespace UCIS.Pml {
6 public class PmlCollection : PmlElement, ICollection<PmlElement> { 6 public class PmlCollection : PmlElement, ICollection<PmlElement> {
7 private List<PmlElement> pItems = new List<PmlElement>(); 7 private List<PmlElement> pItems = new List<PmlElement>();
8 8
9 public PmlCollection() { } 9 public PmlCollection() { }
10 public PmlCollection(params PmlElement[] Elements) { 10 public PmlCollection(params PmlElement[] Elements) {
11 pItems.AddRange(Elements); 11 pItems.AddRange(Elements);
12 } 12 }
13 public PmlCollection(IEnumerable<PmlElement> Elements) { 13 public PmlCollection(IEnumerable<PmlElement> Elements) {
14 pItems.AddRange(Elements); 14 pItems.AddRange(Elements);
15 }
16 public PmlCollection(params String[] Elements) {
17 foreach (String s in Elements) pItems.Add(s);
15 } 18 }
16 19
17 public PmlElement Add(PmlElement Element) { 20 public PmlElement Add(PmlElement Element) {
18 pItems.Add(Element); 21 pItems.Add(Element);
19 return Element; 22 return Element;