Added ability to 'fake' a FileName on a MemoryAccessor

This commit is contained in:
Michael Becker 2014-11-12 13:11:27 -05:00
parent 6d2a1d4fa3
commit 073033ac0b

View File

@ -43,12 +43,15 @@ namespace UniversalEditor.Accessors
_data = newdata;
}
private string mvarFileName = null;
public MemoryAccessor()
{
}
public MemoryAccessor(byte[] data)
public MemoryAccessor(byte[] data, string filename = null)
{
_data = data;
mvarFileName = filename;
}
// [DebuggerNonUserCode()]
@ -109,5 +112,16 @@ namespace UniversalEditor.Accessors
protected override void CloseInternal()
{
}
public override string GetFileName()
{
if (mvarFileName != null) return mvarFileName;
return base.GetFileName();
}
public override string GetFileTitle()
{
if (mvarFileName != null) return System.IO.Path.GetFileName(mvarFileName);
return base.GetFileTitle();
}
}
}