예제 #1
0
        public DXFFile(Stream stream)
        {
            //using (var t = Resources.Schema)
            using (stream)
                using (var reader = new TaggedDataReader(stream))
                {
                    //var test = JsonConvert.DeserializeObject();

                    LoadSections(reader);
                }
        }
예제 #2
0
        void LoadSections(TaggedDataReader reader)
        {
            IDXFTaggedData data;

            while ((data = reader.GetNext()) != null)
            {
                if (data.Code == 0 && data.Data == "SECTION")
                {
                    var section = reader.GetNext();

                    if (section.Code == 2)
                    {
                        switch (section.Data)
                        {
                        case "HEADER":
                            Header = new HeaderSection(reader);
                            //Header = new DXFHeader(_reader);
                            break;

                        case "CLASSES":
                            Console.WriteLine(section.Data);
                            break;

                        case "TABLES":
                            Console.WriteLine(section.Data);
                            break;

                        case "BLOCKS":
                            Console.WriteLine(section.Data);
                            break;

                        case "ENTITIES":
                            Console.WriteLine(section.Data);
                            break;

                        case "OBJECTS":
                            Console.WriteLine(section.Data);
                            break;
                        }
                    }
                }
            }
        }