Пример #1
0
        private void method_18()
        {
            this.method_27();
            Class615 page = new Class615(1097010747);

            this.method_19(page);
            int pageSize = this.list_1.Count * 8;

            page.StreamOffset = this.stream_0.Position;
            int num = pageSize + Class998.smethod_0(pageSize);

            page.Length = (long)num;
            MemoryStream sectionStream = new MemoryStream();
            Class889     class889      = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0);

            foreach (Class614 class614 in this.list_1)
            {
                if (class614 != null)
                {
                    class889.vmethod_9(class614.PageNumber);
                    class889.vmethod_9((int)class614.Length);
                }
            }
            this.method_21(page, sectionStream);
            Class614 class614_1 = this.list_1[this.list_1.Count - 1];

            this.class564_0.LastPageId        = class614_1.PageNumber;
            this.class564_0.LastPageEndOffset = (ulong)(class614_1.StreamOffset + (long)num - 256L);
            this.class564_0.GapCount          = 0U;
            this.class564_0.PageCount         = (uint)(this.list_1.Count - 1);
            this.class564_0.PagesMapOffset    = (ulong)page.StreamOffset;
        }
Пример #2
0
        private void method_1()
        {
            Class889 class889 = Class889.Create(this.stream_0, this.dxfVersion_0, this.encoding_0);

            this.class564_0.Header2Offset = (ulong)this.stream_0.Position;
            MemoryStream fileHeaderDataStream = new MemoryStream();

            this.method_2(fileHeaderDataStream);
            this.stream_0.Write(fileHeaderDataStream.GetBuffer(), 0, (int)fileHeaderDataStream.Length);
            this.stream_0.Position = 0L;
            this.stream_0.Write(Encodings.Ascii.GetBytes(this.dxfModel_0.Header.AcadVersionString), 0, 6);
            this.stream_0.Write(new byte[5], 0, 5);
            if (this.dxfModel_0.Header.AcadVersion == DxfVersion.Dxf18 && this.dxfModel_0.Header.AcadMaintenanceVersion == 1)
            {
                throw new DxfException("Header.AcadMaintenanceVersion may not be 1 for R18 files.");
            }
            this.stream_0.WriteByte((byte)this.dxfModel_0.Header.AcadMaintenanceVersion);
            this.stream_0.WriteByte((byte)3);
            class889.vmethod_11((uint)this.class617_5.Pages[0].StreamOffset + 32U);
            this.stream_0.WriteByte((byte)Class885.smethod_3(DxfVersion.Dxf27));
            this.stream_0.WriteByte((byte)8);
            ushort num = Class952.smethod_1(this.dxfModel_0.Header.DrawingCodePage);

            class889.vmethod_7(num);
            this.stream_0.Write(new byte[3], 0, 3);
            class889.vmethod_9((int)this.dxfModel_0.SecurityFlags);
            class889.vmethod_9(0);
            class889.vmethod_11((uint)this.class617_1.Pages[0].StreamOffset + 32U);
            class889.vmethod_11(0U);
            class889.vmethod_9(128);
            class889.vmethod_11((uint)this.class617_6.Pages[0].StreamOffset + 32U);
            this.stream_0.Write(new byte[80], 0, 80);
            this.stream_0.Write(fileHeaderDataStream.GetBuffer(), 0, (int)fileHeaderDataStream.Length);
            this.stream_0.Write(Class998.byte_0, 236, 20);
        }
Пример #3
0
        private void method_2()
        {
            Class889 class889 = Class889.Create(this.stream_0, this.dxfVersion_0, this.encoding_0);

            this.stream_0.Position = 0L;
            this.stream_0.Write(Encodings.Ascii.GetBytes(this.dxfModel_0.Header.AcadVersionString), 0, 6);
            this.stream_0.Write(new byte[5], 0, 5);
            int maintenanceVersion = this.dxfModel_0.Header.AcadMaintenanceVersion;

            this.stream_0.WriteByte((byte)this.dxfModel_0.Header.AcadMaintenanceVersion);
            this.stream_0.WriteByte((byte)3);
            class889.vmethod_11((uint)this.class504_2.Pages[0].StreamOffset + 1152U);
            this.stream_0.WriteByte((byte)Class885.smethod_3(DxfVersion.Dxf27));
            this.stream_0.WriteByte((byte)8);
            ushort num = Class952.smethod_1(this.dxfModel_0.Header.DrawingCodePage);

            class889.vmethod_7(num);
            this.stream_0.Write(new byte[3], 0, 3);
            class889.vmethod_9((int)this.dxfModel_0.SecurityFlags);
            class889.vmethod_9(0);
            class889.vmethod_11((uint)this.class504_3.Pages[0].StreamOffset + 1152U);
            class889.vmethod_11(0U);
            class889.vmethod_9(128);
            class889.vmethod_11((uint)this.class504_1.Pages[0].StreamOffset + 1152U);
            for (int index = 0; index < 80; ++index)
            {
                this.stream_0.WriteByte((byte)0);
            }
        }
Пример #4
0
        private void method_22(Class615 page, Stream sectionHeaderStream)
        {
            Class889 class889 = Class889.Create(sectionHeaderStream, this.dxfVersion_0, this.encoding_0);

            class889.vmethod_9(page.SectionPageType);
            class889.vmethod_9(page.DecompressedSize);
            class889.vmethod_9(page.CompressedSize);
            class889.vmethod_9(page.CompressionType);
            class889.vmethod_11(page.Checksum);
        }
Пример #5
0
        private void method_25(Stream pageHeaderStream, Class617 section, Class616 page, int pageType)
        {
            Class889 class889 = Class889.Create(pageHeaderStream, this.dxfVersion_0, this.encoding_0);

            class889.vmethod_9(pageType);
            class889.vmethod_9(section.SectionId);
            class889.vmethod_9(page.CompressedSize);
            class889.vmethod_9(page.PageSize);
            class889.vmethod_13((long)page.StartOffset);
            class889.vmethod_11(page.HeaderChecksum);
            class889.vmethod_11(page.DataChecksum);
        }
Пример #6
0
 public static void Write(
     Class889 stream,
     DxfModel model,
     uint estimatedObjectCount,
     uint objectsSectionStreamOffset)
 {
     stream.vmethod_9(0);
     stream.vmethod_11(estimatedObjectCount);
     if (model.Header.AcadVersion >= DxfVersion.Dxf15)
     {
         stream.vmethod_27(model.Header.UpdateUtcDateTime);
     }
     else
     {
         stream.vmethod_27(model.Header.UpdateDateTime);
     }
     stream.vmethod_11(objectsSectionStreamOffset);
     stream.vmethod_1((byte)4);
     stream.vmethod_11(50U);
     stream.vmethod_11(0U);
     stream.vmethod_11(100U);
     stream.vmethod_11(0U);
     stream.vmethod_11(512U);
     stream.vmethod_11(0U);
     stream.vmethod_11(uint.MaxValue);
     stream.vmethod_11(0U);
 }
Пример #7
0
 public static void Write(Class889 byteStream, SummaryInfo summaryInfo)
 {
     byteStream.vmethod_19(summaryInfo.Title);
     byteStream.vmethod_19(summaryInfo.Subject);
     byteStream.vmethod_19(summaryInfo.Author);
     byteStream.vmethod_19(summaryInfo.Keywords);
     byteStream.vmethod_19(summaryInfo.Comments);
     byteStream.vmethod_19(summaryInfo.LastSavedBy);
     byteStream.vmethod_19(summaryInfo.RevisionNumber);
     byteStream.vmethod_19(summaryInfo.HyperLinkBase);
     byteStream.vmethod_25(summaryInfo.TotalEditingTime);
     byteStream.vmethod_27(summaryInfo.CreationDateTime);
     byteStream.vmethod_27(summaryInfo.ModifiedDateTime);
     byteStream.vmethod_7((ushort)summaryInfo.Properties.Count);
     foreach (SummaryInfo.Property property in summaryInfo.Properties)
     {
         byteStream.vmethod_19(property.Name);
         byteStream.vmethod_19(property.Value);
     }
     byteStream.vmethod_9(0);
     byteStream.vmethod_9(0);
 }
Пример #8
0
        private void method_11()
        {
            this.class617_7.MaxDecompressedPageSize = 128;
            FileDependencyCollection dependencyCollection = new FileDependencyCollection();

            if (dependencyCollection.Count > 1)
            {
                this.class617_7.MaxDecompressedPageSize = 128 * dependencyCollection.Count;
            }
            this.class617_7.Encrypted = 2;
            MemoryStream  memoryStream = new MemoryStream();
            Class889      class889     = Class889.Create((Stream)memoryStream, this.dxfVersion_0, this.encoding_0);
            List <string> stringList   = new List <string>();

            foreach (FileDependency.Key key in dependencyCollection.Keys)
            {
                if (!stringList.Contains(key.FeatureName))
                {
                    stringList.Add(key.FeatureName);
                }
            }
            class889.vmethod_9(stringList.Count);
            foreach (string str in stringList)
            {
                class889.vmethod_22(str);
            }
            class889.vmethod_9(dependencyCollection.Count);
            DateTime dateTime = new DateTime(1980, 1, 1);

            foreach (FileDependency.Key key in dependencyCollection.Keys)
            {
                FileDependency fileDependency = dependencyCollection[key];
                if (fileDependency.FeatureName == "Acad:Text")
                {
                    string str = DxfTextStyle.smethod_2(Class1043.smethod_2(this.dxfModel_0.Filename), fileDependency.FullFilename);
                    if (!string.IsNullOrEmpty(str) && File.Exists(str))
                    {
                        FileInfo fileInfo = new FileInfo(str);
                        fileDependency.TimeStamp = fileInfo.LastWriteTime;
                        fileDependency.FileSize  = (int)fileInfo.Length;
                    }
                }
                class889.vmethod_22(fileDependency.FullFilename);
                class889.vmethod_22(fileDependency.FoundPath);
                class889.vmethod_22(fileDependency.FingerPrintGuid);
                class889.vmethod_22(fileDependency.VersionGuid);
                class889.vmethod_9(stringList.IndexOf(fileDependency.FeatureName));
                TimeSpan timeSpan = fileDependency.TimeStamp - dateTime;
                class889.vmethod_9((int)timeSpan.TotalSeconds);
                class889.vmethod_9(fileDependency.FileSize);
                class889.vmethod_5(fileDependency.AffectsGraphics ? (short)1 : (short)0);
                class889.vmethod_9(fileDependency.References.Count);
            }
            this.method_23(this.class617_7, memoryStream, false);
        }
Пример #9
0
        private void method_17()
        {
            MemoryStream sectionStream = new MemoryStream();
            Class889     class889      = Class889.Create((Stream)sectionStream, this.dxfVersion_0, this.encoding_0);

            class889.vmethod_9(this.list_0.Count);
            class889.vmethod_9(2);
            class889.vmethod_9(29696);
            class889.vmethod_9(0);
            class889.vmethod_9(this.list_0.Count);
            foreach (Class617 class617 in this.list_0)
            {
                class889.vmethod_15(class617.SectionSize);
                class889.vmethod_9(class617.PageCount);
                class889.vmethod_9(class617.MaxDecompressedPageSize);
                class889.vmethod_9(1);
                class889.vmethod_9(class617.Compressed);
                class889.vmethod_9(class617.SectionId);
                class889.vmethod_9(class617.Encrypted);
                byte[] buffer = new byte[64];
                if (!string.IsNullOrEmpty(class617.Name))
                {
                    byte[] bytes = Encodings.Ascii.GetBytes(class617.Name);
                    int    num   = Math.Min(bytes.Length, buffer.Length);
                    for (int index = 0; index < num; ++index)
                    {
                        buffer[index] = bytes[index];
                    }
                }
                sectionStream.Write(buffer, 0, buffer.Length);
                foreach (Class616 page in class617.Pages)
                {
                    if (page.PageNumber > 0)
                    {
                        class889.vmethod_9(page.PageNumber);
                        class889.vmethod_9(page.CompressedSize);
                        class889.vmethod_15(page.StartOffset);
                    }
                }
            }
            Class615 page1 = this.method_20(1097007163, sectionStream);
            int      count = Class998.smethod_0((int)(this.stream_0.Position - page1.StreamOffset));

            this.stream_0.Write(Class998.byte_0, 0, count);
            page1.Length = this.stream_0.Position - page1.StreamOffset;
            this.method_19(page1);
        }
Пример #10
0
        private void method_2(MemoryStream fileHeaderDataStream)
        {
            Stream2  stream2  = new Stream2((Stream)fileHeaderDataStream, 0U);
            Class889 class889 = Class889.Create((Stream)stream2, this.dxfVersion_0, this.encoding_0);

            byte[] bytes = Class1045.encoding_0.GetBytes("AcFssFcAJMB");
            stream2.Write(bytes, 0, 11);
            stream2.WriteByte((byte)0);
            class889.vmethod_9(0);
            class889.vmethod_9(108);
            class889.vmethod_9(4);
            class889.vmethod_9(this.class564_0.GapsRootId);
            class889.vmethod_9(this.class564_0.GapsLeftId);
            class889.vmethod_9(this.class564_0.GapsRightId);
            class889.vmethod_9(this.class564_0.GapsUnknown);
            class889.vmethod_9(this.class564_0.LastPageId);
            class889.vmethod_15(this.class564_0.LastPageEndOffset);
            class889.vmethod_15(this.class564_0.Header2Offset);
            class889.vmethod_11(this.class564_0.GapCount);
            class889.vmethod_11(this.class564_0.PageCount);
            class889.vmethod_9(32);
            class889.vmethod_9(128);
            class889.vmethod_9(64);
            class889.vmethod_11(this.class564_0.PagesMapId);
            class889.vmethod_15(this.class564_0.PagesMapOffset - 256UL);
            class889.vmethod_11(this.class564_0.SectionsMapId);
            class889.vmethod_11(this.class564_0.PagesMaxId);
            class889.vmethod_11(this.class564_0.GapsMaxId);
            long position = stream2.Position;

            class889.vmethod_11(0U);
            uint crc = stream2.Crc;

            stream2.Position = position;
            class889.vmethod_11(crc);
            stream2.Flush();
            this.method_3(fileHeaderDataStream);
        }