Exemple #1
0
        /// <inheritdoc/>
        public void Save(Stream stream, object item, object options)
        {
            if (item == null)
            {
                return;
            }

            var ic = options as IImageCache;

            if (options == null)
            {
                return;
            }

            IProjectExporter exporter = new DxfRenderer(_serviceProvider);

            IShapeRenderer renderer = (IShapeRenderer)exporter;

            renderer.State.DrawShapeState.Flags = ShapeStateFlags.Printable;
            renderer.State.ImageCache           = ic;

            if (item is IPageContainer page)
            {
                exporter.Save(stream, page);
            }
            else if (item is IDocumentContainer document)
            {
                exporter.Save(stream, document);
            }
            else if (item is IProjectContainer project)
            {
                exporter.Save(stream, project);
            }
        }
Exemple #2
0
        /// <inheritdoc/>
        void IFileWriter.Save(string path, object item, object options)
        {
            if (string.IsNullOrEmpty(path) || item == null)
            {
                return;
            }

            var ic = options as IImageCache;

            if (options == null)
            {
                return;
            }

            IProjectExporter exporter = new DxfRenderer();

            ShapeRenderer renderer = (DxfRenderer)exporter;

            renderer.State.DrawShapeState.Flags = ShapeStateFlags.Printable;
            renderer.State.ImageCache           = ic;

            if (item is PageContainer)
            {
                exporter.Save(path, item as PageContainer);
            }
            else if (item is DocumentContainer)
            {
                exporter.Save(path, item as DocumentContainer);
            }
            else if (item is ProjectContainer)
            {
                exporter.Save(path, item as ProjectContainer);
            }
        }
Exemple #3
0
        /// <inheritdoc/>
        void IFileWriter.Save(string path, object item, object options)
        {
            if (string.IsNullOrEmpty(path) || item == null)
            {
                return;
            }

            var ic = options as IImageCache;

            if (options == null)
            {
                return;
            }

            IProjectExporter exporter = new DxfRenderer(_serviceProvider);

            IShapeRenderer renderer = (IShapeRenderer)exporter;

            renderer.State.DrawShapeState.Flags = ShapeStateFlags.Printable;
            renderer.State.ImageCache           = ic;

            if (item is IPageContainer page)
            {
                exporter.Save(path, page);
            }
            else if (item is IDocumentContainer document)
            {
                exporter.Save(path, document);
            }
            else if (item is IProjectContainer project)
            {
                exporter.Save(path, project);
            }
        }
Exemple #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="path"></param>
        /// <param name="item"></param>
        /// <param name="options"></param>
        public void Save(string path, object item, object options)
        {
            if (string.IsNullOrEmpty(path) || item == null)
            {
                return;
            }

            var ic = options as IImageCache;

            if (options == null)
            {
                return;
            }

            var r = new DxfRenderer();

            r.State.DrawShapeState.Flags = ShapeStateFlags.Printable;
            r.State.ImageCache           = ic;

            if (item is Container)
            {
                r.Save(path, item as Container);
            }
        }