Beispiel #1
0
        public void Save(IShapeSurface surface, Stream stream)
        {
            if (surface == null)
            {
                throw new ArgumentNullException("surface");
            }
            if (!stream.CanWrite)
            {
                throw new ArgumentException("stream");
            }
            SurfaceStoreData data = SurfaceStoreData.CreateStoreData(surface);
            XmlSerializer    xs   = new XmlSerializer(typeof(SurfaceStoreData));

            xs.Serialize(stream, data);
        }
Beispiel #2
0
        public void Save(IShapeSurface surface, Stream stream)
        {
            if (!stream.CanWrite)
            {
                throw new ArgumentException("stream");
            }
            SerializationBasedStreamItemWriter writer =
                new SerializationBasedStreamItemWriter(stream);
            SurfaceStoreData data = SurfaceStoreData.CreateStoreData(surface);

            if (surface.Source.Tag == null)
            {
                writer.Write(data);
            }
            else
            {
                writer.Write(data, surface.Source.Tag);
            }
        }