Exemple #1
0
        public void Load(string mypath, ClientType myclientType)
        {
            this.path       = mypath;
            this.clientType = myclientType;
            BinaryReader binaryReader = new BinaryReader(File.Open(mypath, FileMode.Open));

            this.formatCode = new string(binaryReader.ReadChars(4));
            int num = binaryReader.ReadInt32();

            this.rowCount    = binaryReader.ReadInt32();
            this.columnCount = binaryReader.ReadInt32();
            this.column      = new STB.Column[this.columnCount + 1];
            this.cell        = new string[this.rowCount, this.columnCount];
            this.RowHeight   = binaryReader.ReadInt32();
            for (int i = 0; i < this.columnCount + 1; i++)
            {
                this.column[i].width = binaryReader.ReadInt16();
            }
            for (int i = 0; i < this.columnCount + 1; i++)
            {
                this.column[i].title = RoseFile.ReadSString(ref binaryReader);
            }
            for (int i = 0; i < this.rowCount - 1; i++)
            {
                this.cell[i, 0] = RoseFile.ReadSString(ref binaryReader);
            }
            binaryReader.BaseStream.Seek((long)num, SeekOrigin.Begin);
            for (int i = 0; i < this.rowCount - 1; i++)
            {
                for (int j = 0; j < this.columnCount - 1; j++)
                {
                    this.cell[i, j + 1] = RoseFile.ReadSString(ref binaryReader);
                }
            }
            binaryReader.Close();
        }
Exemple #2
0
        public void Load(string filePath, ClientType clientType)
        {
            this.Path       = filePath;
            this.clientType = clientType;
            BinaryReader binaryReader = new BinaryReader(File.Open(filePath, FileMode.Open));
            short        num          = binaryReader.ReadInt16();

            this.listDDS = new List <TSI.DDS>((int)num);
            for (int i = 0; i < (int)num; i++)
            {
                TSI.DDS dDS = new TSI.DDS();
                dDS.Path      = RoseFile.ReadSString(ref binaryReader);
                dDS.ColourKey = binaryReader.ReadInt32();
                this.listDDS.Add(dDS);
            }
            short num2 = binaryReader.ReadInt16();

            for (int i = 0; i < (int)num; i++)
            {
                short num3 = binaryReader.ReadInt16();
                this.listDDS[i].ListDDS_element = new List <TSI.DDS.DDSElement>((int)num3);
                for (int j = 0; j < (int)num3; j++)
                {
                    TSI.DDS.DDSElement dDSElement = new TSI.DDS.DDSElement();
                    dDSElement.OwnerId = binaryReader.ReadInt16();
                    dDSElement.X       = binaryReader.ReadInt32();
                    dDSElement.Y       = binaryReader.ReadInt32();
                    dDSElement.Width   = binaryReader.ReadInt32() - dDSElement.X;
                    dDSElement.Height  = binaryReader.ReadInt32() - dDSElement.Y;
                    dDSElement.Color   = binaryReader.ReadInt32();
                    dDSElement.Name    = RoseFile.ReadFString(ref binaryReader, 32);
                    this.listDDS[i].ListDDS_element.Add(dDSElement);
                }
            }
            binaryReader.Close();
        }