2 // Copyright (c) Microsoft Corporation. All rights reserved.
5 namespace Microsoft.Activities.Presentation.Xaml
8 using System.ComponentModel;
10 using System.Xaml.Schema;
12 internal class AttributeXamlType<TAttribute, TAttributeInfo> : XamlType
13 where TAttribute : Attribute
14 where TAttributeInfo : AttributeInfo<TAttribute>, new()
16 private TAttributeInfo attributeInfo = new TAttributeInfo();
18 public AttributeXamlType(XamlSchemaContext xamlSchemaContext)
19 : base(typeof(TAttribute), xamlSchemaContext)
23 protected override XamlValueConverter<TypeConverter> LookupTypeConverter()
25 return new XamlValueConverter<TypeConverter>(typeof(AttributeConverter<TAttribute, TAttributeInfo>), this);
28 protected override bool LookupConstructionRequiresArguments()
30 return this.attributeInfo.LookupConstructionRequiresArguments;
33 protected override XamlTypeInvoker LookupInvoker()
35 if (this.attributeInfo.Invoker != null)
37 return this.attributeInfo.Invoker;
41 return base.LookupInvoker();