|
Hey
I'm having a problem with creating a custom extension attribute which contains required properties. This is how it looks in general:
public class MetaDataSerializerAttribute : CustomExtensionAttribute
{
[NodeAttribute("Application", true)]
public string Application { get; set; }
[NodeAttribute("Type", true)]
public MetaDataTypes Type { get; set; }
[NodeAttribute("Filenames", true)]
public string[] Filenames { get; set; }
public MetaDataSerializerAttribute()
{ }
public MetaDataSerializerAttribute([NodeAttribute("Application")] string application, [NodeAttribute("Type")] MetaDataTypes type, [NodeAttribute("Filenames")] string[] filenames)
{
this.Application = application;
this.Type = type;
this.Filenames = filenames;
}
}
I have also created a TypeExtensionPoint which has this attribute assigned to called IMetaDataSerializer:
[TypeExtensionPoint(ExtensionAttributeType = typeof (MetaDataSerializerAttribute))]
public interface IMetaDataSerializer : IAddin
{ ... }
Then I created an Addin with a type that implements IMetaDataSerializer like this:
[MetaDataSerializer("***", MetaDataTypes.TvEpisode, new string[] { ":filename:.nfo" }, Id = "***.TvEpisode")]
public class TvEpisode : IMetaDataSerializer
{ ... }
but no matter which overloaded version of AddinManager.GetExtensionNodes() I call it always returns an empty list and I see the following from the progress monitor:
Error while loading Addin with ID "***,0.1": Could not read extension node of type 'Mono.Addins.TypeExtensionNode`1[***.MetaDataSerializerAttribute]' from extension path '***.TvEpisode'
Source: Mono.Addins
Function: Void ReadObject(System.Object, Mono.Addins.NodeAttribute[], System.Collections.Generic.Dictionary`2[System.String,Mono.Addins.Description.ExtensionNodeType+FieldData])
Message: Required attribute 'Application' not found.
bei Mono.Addins.ExtensionNode.ReadObject(Object ob, NodeAttribute[] attributes, Dictionary`2 fields) in ***\Mono.Addins\ExtensionNode.cs:Zeile 292.
bei Mono.Addins.ExtensionNode.Read(NodeElement elem) in ***\Mono.Addins\ExtensionNode.cs:Zeile 233.
bei Mono.Addins.TypeExtensionNode.Read(NodeElement elem) in ***\Mono.Addins\TypeExtensionNode.cs:Zeile 44.
bei Mono.Addins.ExtensionTree.ReadNode(TreeNode tnode, String addin, ExtensionNodeType ntype, ExtensionNodeDescription elem, ModuleDescription module) in ***\Mono.Addins\ExtensionTree.cs:Zeile 182.
If I remove the required constraint it works just fine. Am I doing something wrong or is this a bug?
Thanks for your help.
PS: Is there any way to access the current development sources in an SVN or something to get the latest fixes/changes?
|