public XElement ToXElement(IWorldElementEntity entity) { foreach (var transformer in ChildTransformers) { if (transformer.Type == entity.GetType()) { return(transformer.FromWorldElementEntity(entity)); } } throw new TransformerException(String.Format("World element entity type '{0}' is unknown.", entity.GetType())); }
public XElement FromWorldElementEntity(IWorldElementEntity entity) { RectangleElementEntity rectangle = entity as RectangleElementEntity; if (rectangle == null) { throw new TransformerException("Entity was not of type " + typeof(RectangleElementEntity).FullName); } XElement xElement = new XElement(TransformerSettings.WorldNamespace + EntityName); ToXElement(rectangle, xElement); return(xElement); }
public XElement FromWorldElementEntity(IWorldElementEntity entity) { PolygonElementEntity polygon = entity as PolygonElementEntity; if (polygon == null) { throw new TransformerException("Entity was not of type " + typeof(PolygonElementEntity).FullName); } XElement xElement = new XElement(TransformerSettings.WorldNamespace + EntityName); ToXElement(polygon, xElement); return(xElement); throw new NotImplementedException(); }
public XElement FromEntity(IWorldElementEntity entity) { throw new NotImplementedException(); }
public XElement FromWorldElementEntity(IWorldElementEntity entity) { throw new NotImplementedException(); }