provide ability to defer the data request like in FileSystemObjectModel

This commit is contained in:
Michael Becker 2019-12-08 03:53:18 -05:00
parent c571b33b3d
commit b2e23c1b2b
No known key found for this signature in database
GPG Key ID: 389DFF5D73781A12

View File

@ -101,8 +101,25 @@ namespace UniversalEditor.ObjectModels.Executable
}
}
private byte[] mvarData = new byte[0];
public byte[] Data { get { return mvarData; } set { mvarData = value; } }
public event FileSystem.DataRequestEventHandler DataRequest;
private byte[] mvarData = null;
public byte[] Data
{
get
{
if (mvarData == null && DataRequest != null)
{
FileSystem.DataRequestEventArgs e = new FileSystem.DataRequestEventArgs();
DataRequest(this, e);
mvarData = e.Data;
}
if (mvarData == null) return new byte[0];
return mvarData;
}
set { mvarData = value; }
}
private long mvarPhysicalAddress = 0;
public long PhysicalAddress { get { return mvarPhysicalAddress; } set { mvarPhysicalAddress = value; } }