Пример #1
0
 public ExcelLongStrings(BinaryReader br, int remainingSize, int charsLeftFromPrevious)
 {
     this.Strings = new ArrayList();
     while (remainingSize != 0)
     {
         ExcelLongString text1 = new ExcelLongString(br, ref remainingSize, ref charsLeftFromPrevious);
         this.Strings.Add(text1);
     }
     this.CharsRemaining = charsLeftFromPrevious;
 }
Пример #2
0
        public override bool Equals(object obj)
        {
            ExcelLongString text1 = (ExcelLongString)obj;

            if (this.Str == text1.Str)
            {
                return(this.Options == text1.Options);
            }
            return(false);
        }
Пример #3
0
        public override string ToString()
        {
            StringBuilder builder1 = new StringBuilder("ExcelLongStrings(");

            for (int num1 = 0; num1 < this.Strings.Count; num1++)
            {
                ExcelLongString text1 = (ExcelLongString)this.Strings[num1];
                if (num1 > 0)
                {
                    builder1.Append(",");
                }
                builder1.Append(text1.GetFormattedStr());
            }
            builder1.Append(")");
            return(builder1.ToString());
        }
Пример #4
0
        public static void ParseHelper(BinaryReader br, object[] format, ref object[] loadedArgs, ref int currentArgIndex, VariableArrayCountDelegate vaCount, StringLengthDelegate lastStringLength)
        {
            object[] objArray4 = format;
            for (int num5 = 0; num5 < objArray4.Length; num5++)
            {
                object obj1 = objArray4[num5];
                if (obj1 is string)
                {
                    Stream stream1 = br.BaseStream;
                    stream1.Position += Utilities.GetByteArrLengthFromHexStr((string)obj1);
                }
                else if (obj1 is Type)
                {
                    Type type1 = (Type)obj1;
                    if (type1.IsEnum)
                    {
                        type1 = Enum.GetUnderlyingType(type1);
                    }
                    switch (type1.FullName)
                    {
                    case "System.Int16":
                    {
                        loadedArgs[currentArgIndex] = br.ReadInt16();
                        break;
                    }

                    case "System.UInt16":
                    {
                        loadedArgs[currentArgIndex] = br.ReadUInt16();
                        break;
                    }

                    case "System.UInt32":
                    {
                        loadedArgs[currentArgIndex] = br.ReadUInt32();
                        break;
                    }

                    case "System.UInt64":
                    {
                        loadedArgs[currentArgIndex] = br.ReadUInt64();
                        break;
                    }

                    case "System.Byte":
                    {
                        loadedArgs[currentArgIndex] = br.ReadByte();
                        break;
                    }

                    case "System.Char":
                    {
                        loadedArgs[currentArgIndex] = br.ReadChar();
                        break;
                    }

                    case "System.Single":
                    {
                        loadedArgs[currentArgIndex] = br.ReadSingle();
                        break;
                    }

                    case "System.Double":
                    {
                        loadedArgs[currentArgIndex] = br.ReadDouble();
                        break;
                    }

                    case "MB.WinEIDrive.Excel.ExcelShortString":
                    {
                        loadedArgs[currentArgIndex] = new ExcelShortString(br);
                        break;
                    }

                    case "MB.WinEIDrive.Excel.ExcelLongString":
                    {
                        loadedArgs[currentArgIndex] = new ExcelLongString(br);
                        break;
                    }

                    case "MB.WinEIDrive.Excel.ExcelStringWithoutLength":
                    {
                        loadedArgs[currentArgIndex] = new ExcelStringWithoutLength(br, lastStringLength(loadedArgs));
                        break;
                    }

                    case "MB.WinEIDrive.Excel.ExcelLongStrings":
                    {
                        int num1 = vaCount(loadedArgs, null, (int)br.BaseStream.Length);
                        loadedArgs[currentArgIndex] = new ExcelLongStrings(br, num1, 0);
                        break;
                    }

                    case "MB.WinEIDrive.Excel.CellRecordHeader":
                    {
                        loadedArgs[currentArgIndex] = new CellRecordHeader(br);
                        break;
                    }

                    case "MB.WinEIDrive.Excel.SheetIndexes":
                    {
                        loadedArgs[currentArgIndex] = new SheetIndexes(br);
                        break;
                    }

                    default:
                    {
                        throw new Exception("Internal error: unsupported type in format.");
                    }
                    }
                    currentArgIndex += 1;
                }
                else
                {
                    if (!(obj1 is object[]))
                    {
                        throw new Exception("Internal error: wrong format in descriptor.");
                    }
                    object[] objArray1 = (object[])obj1;
                    int      num2      = vaCount(loadedArgs, objArray1, (int)br.BaseStream.Length);
                    object[] objArray2 = new object[objArray1.Length * num2];
                    int      num3      = 0;
                    for (int num4 = 0; num4 < num2; num4++)
                    {
                        XLSDescriptors.ParseHelper(br, objArray1, ref objArray2, ref num3, vaCount, lastStringLength);
                    }
                    object[] objArray3 = new object[num3];
                    Array.Copy(objArray2, objArray3, num3);
                    loadedArgs[currentArgIndex] = objArray3;
                    currentArgIndex            += 1;
                }
            }
        }