IMPORTANT: avoid calling base.MakeReferenceInternal on derived DataFormats because this will overwrite the base DataFormatReference
This commit is contained in:
parent
2723f02ecf
commit
2a5af21d06
@ -8,6 +8,17 @@ namespace UniversalEditor.Plugins.Genealogy.DataFormats.FamilyTreeMaker.Windows
|
||||
{
|
||||
public class FTWDataFormat : CompoundDocumentDataFormat
|
||||
{
|
||||
private static DataFormatReference _dfr = null;
|
||||
protected override DataFormatReference MakeReferenceInternal()
|
||||
{
|
||||
if (_dfr == null)
|
||||
{
|
||||
_dfr = new DataFormatReference(GetType());
|
||||
_dfr.Capabilities.Add(typeof(FamilyTreeObjectModel), DataFormatCapabilities.All);
|
||||
}
|
||||
return _dfr;
|
||||
}
|
||||
|
||||
protected override void BeforeLoadInternal (Stack<ObjectModel> objectModels)
|
||||
{
|
||||
base.BeforeLoadInternal (objectModels);
|
||||
|
||||
@ -39,7 +39,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Microsoft.CompoundDocument
|
||||
{
|
||||
if (_dfr == null)
|
||||
{
|
||||
_dfr = base.MakeReferenceInternal();
|
||||
_dfr = new DataFormatReference(GetType());
|
||||
_dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All);
|
||||
_dfr.ExportOptions.SettingsGroups[0].Settings.Add(new RangeSetting(nameof(SectorSize), "_Sector size (in bytes)", 512, 128));
|
||||
_dfr.ExportOptions.SettingsGroups[0].Settings.Add(new RangeSetting(nameof(ShortSectorSize), "S_hort sector size (in bytes)", 64));
|
||||
|
||||
@ -36,7 +36,7 @@ namespace UniversalEditor.DataFormats.Text.Formatted.DOC
|
||||
{
|
||||
if (_dfr == null)
|
||||
{
|
||||
_dfr = base.MakeReferenceInternal();
|
||||
_dfr = new DataFormatReference(GetType());
|
||||
_dfr.Capabilities.Add(typeof(FormattedTextObjectModel), DataFormatCapabilities.All);
|
||||
}
|
||||
return _dfr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user