public RecordTreeNode(Record record) { if (record is ObjRecord) { ObjRecord or = (ObjRecord)record; IList subrecs = or.SubRecords; foreach (SubRecord sr in subrecs) { this.Nodes.Add(new SubRecordTreeNode(sr)); } this.ImageKey = "Folder"; this.SelectedImageKey = "Folder"; } else if (record is SSTRecord) { IEnumerator strings = ((SSTRecord)record).GetStrings(); this.ImageKey = "Folder"; this.SelectedImageKey = "Folder"; while (strings.MoveNext()) { this.Nodes.Add(new UnicodeStringTreeNode((UnicodeString)strings.Current)); } } else if (record is DrawingGroupRecord) { this.ImageKey = "Folder"; this.SelectedImageKey = "Folder"; DrawingGroupRecord dgr = (DrawingGroupRecord)record; for (int i = 0; i < dgr.EscherRecords.Count; i++) { this.Nodes.Add(new EscherRecordTreeNode((NPOI.DDF.EscherRecord)dgr.EscherRecords[i])); } } else { this.ImageKey = "Binary"; } if (record is UnknownRecord) { this.Text = UnknownRecord.GetBiffName(record.Sid) + "*"; } else { this.Text = record.GetType().Name; } this.Record = record; }