public void ReadXml(XmlReader r, PointF scale, TimestampMapper timestampMapper, Metadata metadata) { Clear(); r.ReadStartElement(); while (r.NodeType == XmlNodeType.Element) { switch (r.Name) { case "DrawingStyle": style = new DrawingStyle(r); BindStyle(); break; case "AutoNumber": AbstractMultiDrawingItem item = MultiDrawingItemSerializer.Deserialize(r, scale, timestampMapper, metadata); AutoNumber number = item as AutoNumber; if (number != null) { metadata.AddMultidrawingItem(this, number); } break; default: string unparsed = r.ReadOuterXml(); log.DebugFormat("Unparsed content in KVA XML: {0}", unparsed); break; } } r.ReadEndElement(); }
public override void Add(AbstractMultiDrawingItem item) { AutoNumber number = item as AutoNumber; if (number == null) { return; } selected = InsertSorted(number); }
private int InsertSorted(AutoNumber item) { for (int i = 0; i < autoNumbers.Count; i++) { if (autoNumbers[i].Value > item.Value) { autoNumbers.Insert(i, item); return(i); } } autoNumbers.Add(item); return(autoNumbers.Count - 1); }