예제 #1
0
        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 void ReadXml(XmlReader r, PointF scale, TimestampMapper timestampMapper, Metadata metadata)
        {
            Clear();

            r.ReadStartElement();

            while (r.NodeType == XmlNodeType.Element)
            {
                if (r.Name == "Spotlight")
                {
                    AbstractMultiDrawingItem item = MultiDrawingItemSerializer.Deserialize(r, scale, timestampMapper, metadata);
                    Spotlight spotlight           = item as Spotlight;
                    if (spotlight != null)
                    {
                        metadata.AddMultidrawingItem(this, spotlight);
                    }
                }
                else
                {
                    string unparsed = r.ReadOuterXml();
                    log.DebugFormat("Unparsed content in KVA XML: {0}", unparsed);
                }
            }

            r.ReadEndElement();
            initializing = false;
        }
        public override HistoryMemento PerformUndo()
        {
            HistoryMemento redoMemento = new HistoryMementoAddMultiDrawingItem(metadata, manager, itemId);

            redoMemento.CommandName = commandName;

            AbstractMultiDrawingItem item = MultiDrawingItemSerializer.DeserializeMemento(data, metadata);

            metadata.AddMultidrawingItem(manager, item);

            // TODO: re instate the associated trackable drawing.

            return(redoMemento);
        }