예제 #1
0
파일: LC4Reader.cs 프로젝트: shtspk/raskroy
        public LC4Document Load(Stream stm)
        {
            m_fmt      = new LC4Formatter(stm);
            m_document = new LC4Document();

            Byte[] pad;
            pad = m_fmt.ReadBytes(7);
            m_document.InternalName = m_fmt.ReadString();
            m_document.Description  = m_fmt.ReadString();

            pad = m_fmt.ReadBytes(7);
            m_document.SomeInteger1 = m_fmt.ReadInt32();

            pad = m_fmt.ReadBytes(7);
            Int32 sheetsCount = m_fmt.ReadInt32();

            for (Int32 i = 0; i < sheetsCount; i++)
            {
                LoadSheet();
            }

            pad = m_fmt.ReadBytes(7);
            m_document.SomeInteger2 = m_fmt.ReadInt32();

            pad = m_fmt.ReadBytes(7);
            Int32 cutsCount = m_fmt.ReadInt32();

            for (Int32 i = 0; i < cutsCount; i++)
            {
                LoadCutting();
            }

            pad = m_fmt.ReadBytes(13);

            return(m_document);
        }
예제 #2
0
파일: LC4Reader.cs 프로젝트: shtspk/raskroy
        private void LoadSheet()
        {
            LC4Sheet sheet = new LC4Sheet();

            Byte[] pad;
            pad = m_fmt.ReadBytes(11);
            sheet.SomeString1  = m_fmt.ReadString();
            sheet.SomeString2  = m_fmt.ReadString();
            sheet.SomeString3  = m_fmt.ReadString();
            sheet.Size1        = m_fmt.ReadNumeric();
            sheet.Size2        = m_fmt.ReadNumeric();
            sheet.Thickness    = m_fmt.ReadNumeric();
            sheet.SomeInteger1 = m_fmt.ReadInt32();
            sheet.SomeInteger2 = m_fmt.ReadInt32();
            pad = m_fmt.ReadBytes(2);
            sheet.SomeInteger3 = m_fmt.ReadInt32();
            pad = m_fmt.ReadBytes(10);
            sheet.SomeInteger4 = m_fmt.ReadInt32();
            pad = m_fmt.ReadBytes(3);
            m_document.Sheets.Add(sheet);
        }