-
Notifications
You must be signed in to change notification settings - Fork 3
/
EscherPropertyTreeNode.cs
45 lines (38 loc) · 1.16 KB
/
EscherPropertyTreeNode.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Text;
using NPOI.DDF;
namespace NPOI.Tools.POIFSExplorer
{
public class EscherPropertyTreeNode:AbstractRecordTreeNode
{
public EscherPropertyTreeNode(EscherProperty ep)
{
this.Record = ep;
this.Text = ep.Name;
this.ImageKey = "Binary";
}
public override bool HasBinary
{
get { return true; }
}
public override byte[] GetBytes()
{
if (this.Record is EscherSimpleProperty)
{
EscherSimpleProperty esp = (EscherSimpleProperty)this.Record;
byte[] data = new byte[esp.PropertySize];
esp.SerializeSimplePart(data, 0);
return data;
}
else if (this.Record is EscherComplexProperty)
{
EscherComplexProperty esp = (EscherComplexProperty)this.Record;
byte[] data = new byte[esp.PropertySize];
esp.SerializeComplexPart(data, 0);
return data;
}
return null;
}
}
}