コード例 #1
0
ファイル: EscherBSERecord.cs プロジェクト: ruo2012/Npoi.Core
        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.object"/>.
        /// </returns>
        public override string ToString()
        {
            string nl = Environment.NewLine;

            string extraData;

            using (MemoryStream b = new MemoryStream()) {
                try {
                    HexDump.Dump(_remainingData, 0, b, 0);
                    //extraData = b.ToString();
                    extraData = Encoding.UTF8.GetString(b.ToArray());
                }
                catch (Exception e) {
                    extraData = e.ToString();
                }
                return(GetType().Name + ":" + nl +
                       "  RecordId: 0x" + HexDump.ToHex(RECORD_ID) + nl +
                       "  Version: 0x" + HexDump.ToHex(Version) + '\n' +
                       "  Instance: 0x" + HexDump.ToHex(Instance) + '\n' +
                       "  BlipTypeWin32: " + field_1_blipTypeWin32 + nl +
                       "  BlipTypeMacOS: " + field_2_blipTypeMacOS + nl +
                       "  SUID: " + HexDump.ToHex(field_3_uid) + nl +
                       "  Tag: " + field_4_tag + nl +
                       "  Size: " + field_5_size + nl +
                       "  Ref: " + field_6_ref + nl +
                       "  Offset: " + field_7_offset + nl +
                       "  Usage: " + field_8_usage + nl +
                       "  Name: " + field_9_name + nl +
                       "  Unused2: " + field_10_unused2 + nl +
                       "  Unused3: " + field_11_unused3 + nl +
                       "  blipRecord: " + (field_12_blipRecord == null ? "null" : field_12_blipRecord.ToString()) + nl +
                       "  Extra Data:" + nl + extraData);
            }
        }