public static string GetBlockFileNameWithoutExtension(SCBlock block) { var key = block.Key; var name = $"{key:X8}"; if (block.HasValue()) { name += $" {block.GetValue()}"; } return(name); }
public static string GetBlockSummary(SCBlock b) { var sb = new StringBuilder(); sb.Append("Key: ").AppendFormat("{0:X8}", b.Key).AppendLine(); sb.Append("Type: ").Append(b.Type).AppendLine(); if (b.Data.Length != 0) { sb.Append("Length: ").AppendFormat("{0:X8}", b.Data.Length).AppendLine(); } if (b.SubType != 0) { sb.Append("SubType: ").Append(b.SubType).AppendLine(); } else if (b.HasValue()) { sb.Append("Value: ").Append(b.GetValue()).AppendLine(); } return(sb.ToString()); }