diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-11-17 20:31:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-17 20:31:05 +0100 |
commit | 054ecf2704ac5d736ffb97c2932e1e078041008a (patch) | |
tree | 6e11e80a370b9ed96c473a03ecc4bbdfefa62cbe /Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs | |
parent | 122f0e3e6060711d6c3b2b8523236b8a057434df (diff) | |
download | xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.tar.gz xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.tar.bz2 xamarin-forms-054ecf2704ac5d736ffb97c2932e1e078041008a.zip |
[Xaml] cleanup xmlns usage, add XmlnsDefinition (#531)
* [Xaml] cleanup xmlns usage, add XmlnsDefinition
* docs
Diffstat (limited to 'Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs')
-rw-r--r-- | Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs b/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs new file mode 100644 index 00000000..2d6b0758 --- /dev/null +++ b/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs @@ -0,0 +1,25 @@ +using System; +using System.Reflection; +using System.Diagnostics; +namespace Xamarin.Forms +{ + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + [DebuggerDisplay("{XmlNamespace}, {ClrNamespace}, {AssemblyName}")] + public sealed class XmlnsDefinitionAttribute : Attribute + { + public string XmlNamespace { get; } + public string ClrNamespace { get; } + public string AssemblyName { get; set; } + + public XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) + { + if (xmlNamespace == null) + throw new ArgumentNullException(nameof(xmlNamespace)); + if (clrNamespace == null) + throw new ArgumentNullException(nameof(clrNamespace)); + + ClrNamespace = clrNamespace; + XmlNamespace = xmlNamespace; + } + } +}
\ No newline at end of file |