コード例 #1
0
ファイル: DxfFile.cs プロジェクト: stephensmitchell-forks/Dxf
        private void WriteSectionsAndClose(DxfWriter writer, IEnumerable <DxfSection> sections)
        {
            var writtenItems  = new HashSet <IDxfItem>();
            var outputHandles = Header.Version >= DxfAcadVersion.R13 || Header.HandlesEnabled; // handles are always enabled on R13+

            foreach (var section in sections)
            {
                foreach (var pair in section.GetValuePairs(Header.Version, outputHandles, writtenItems))
                {
                    writer.WriteCodeValuePair(pair);
                }

                if (section is DxfEntitiesSection)
                {
                    var entitiesSection = (DxfEntitiesSection)section;
                    var addedObjects    = new HashSet <DxfObject>(Objects);
                    foreach (var additionalObject in entitiesSection.AdditionalObjects)
                    {
                        if (additionalObject != null && addedObjects.Add(additionalObject))
                        {
                            Objects.Add(additionalObject);
                        }
                    }
                }
            }

            writer.Close();
        }
コード例 #2
0
ファイル: DxfFile.cs プロジェクト: UgaitzEtxebarria/dxf
        private void WriteSectionsAndClose(DxfWriter writer, IEnumerable <DxfSection> sections)
        {
            foreach (var pair in GetCodePairs(sections))
            {
                writer.WriteCodeValuePair(pair);
            }

            writer.Close();
        }
コード例 #3
0
ファイル: DxfFile.cs プロジェクト: yangkf1985/Dxf
        private void WriteSectionsAndClose(DxfWriter writer, IEnumerable <DxfSection> sections)
        {
            var writtenItems  = new HashSet <IDxfItem>();
            var outputHandles = Header.Version >= DxfAcadVersion.R13 || Header.HandlesEnabled; // handles are always enabled on R13+

            foreach (var section in sections)
            {
                foreach (var pair in section.GetValuePairs(Header.Version, outputHandles, writtenItems))
                {
                    writer.WriteCodeValuePair(pair);
                }
            }

            writer.Close();
        }
コード例 #4
0
ファイル: DxfFile.cs プロジェクト: yangkf1985/Dxf
        private void WriteSectionsAndClose(DxfWriter writer, IEnumerable<DxfSection> sections)
        {
            var writtenItems = new HashSet<IDxfItem>();
            var outputHandles = Header.Version >= DxfAcadVersion.R13 || Header.HandlesEnabled; // handles are always enabled on R13+
            foreach (var section in sections)
            {
                foreach (var pair in section.GetValuePairs(Header.Version, outputHandles, writtenItems))
                {
                    writer.WriteCodeValuePair(pair);
                }
            }

            writer.Close();
        }
コード例 #5
0
ファイル: DxfFile.cs プロジェクト: atph/Dxf
        private void WriteStream(Stream stream, bool asText)
        {
            var writer = new DxfWriter(stream, asText);
            writer.Open();

            var nextHandle = SetHandles();
            Header.NextAvailableHandle = nextHandle;

            // write sections
            var outputHandles = Header.Version >= DxfAcadVersion.R13 || Header.HandlesEnabled; // handles are always enabled on R13+
            foreach (var section in Sections)
            {
                foreach (var pair in section.GetValuePairs(Header.Version, outputHandles))
                    writer.WriteCodeValuePair(pair);
            }

            writer.Close();
        }