Пример #1
0
 private void WriteFXRecord(BinaryWriter writer, FormatInfo info)
 {
     ushort[] numArray = new ushort[] { 0x243, 12 };
     WriteUshortArray(writer, numArray);
     byte[] buffer = new byte[4];
     buffer[0] = (byte) info.FontIndex;
     buffer[1] = (byte) info.FormatIndex;
     buffer[2] = 1;
     byte num = 0;
     if (info.FontIndex > 0)
     {
         num = (byte) (num | 2);
     }
     if (info.HorizontalAlignment != Alignment.General)
     {
         num = (byte) (num | 4);
     }
     if (info.BackColor.Index != ExcelColor.Automatic.Index)
     {
         num = (byte) (num | 0x10);
     }
     num = (byte) (num << 2);
     buffer[3] = num;
     WriteByteArray(writer, buffer);
     ushort horizontalAlignment = (ushort) info.HorizontalAlignment;
     ushort num3 = 1;
     if (info.BackColor.Index != ExcelColor.Automatic.Index)
     {
         num3 = (ushort) ((num3 & -1985) | ((info.BackColor.Index & 0x1f) << 6));
         num3 = (ushort) ((num3 & -63489) | ((ExcelColor.WindowText.Index & 0x1f) << 11));
     }
     else
     {
         num3 = 0xce00;
     }
     ushort[] numArray3 = new ushort[4];
     numArray3[0] = horizontalAlignment;
     numArray3[1] = num3;
     ushort[] numArray2 = numArray3;
     WriteUshortArray(writer, numArray2);
 }
Пример #2
0
 private void BuildInternalTables()
 {
     foreach (KeyValuePair<long, CellInfo> pair in this.cells)
     {
         FormatInfo item = new FormatInfo(pair.Value);
         if (pair.Value.Document.FX.IndexOf(item) == -1)
         {
             pair.Value.Document.FX.Add(item);
         }
         pair.Value.FXIndex = (byte) (pair.Value.Document.FX.IndexOf(item) + 0x15);
     }
 }