PageRenderTime 23ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlSimpleProperty.cs

http://github.com/icsharpcode/ILSpy
C# | 40 lines | 32 code | 6 blank | 2 comment | 4 complexity | ec07ab87ccef07c735007ed8cafc30c1 MD5 | raw file
 1// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
 2// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt)
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Text;
 7using System.Xml;
 8
 9namespace Ricciolo.StylesExplorer.MarkupReflection
10{
11	class XmlBamlSimpleProperty : XmlBamlNode
12	{
13		public string NamespaceName { get; private set; }
14		public string LocalName { get; private set; }
15		public string Value { get; private set; }
16		
17		public XmlBamlSimpleProperty(string namespaceName, string localName, string value)
18		{
19			if (string.IsNullOrWhiteSpace(namespaceName))
20				throw new ArgumentException("namespaceName");
21			if (string.IsNullOrWhiteSpace(localName))
22				throw new ArgumentException("localName");
23			if (value == null)
24				throw new ArgumentNullException("value");
25			this.NamespaceName = namespaceName;
26			this.LocalName = localName;
27			this.Value = value;
28		}
29		
30		public override XmlNodeType NodeType {
31			get { return XmlNodeType.Attribute; }
32		}
33		
34		public override string ToString()
35		{
36			return string.Format("{{{0}}}{1}=\"{2}\"", NamespaceName, LocalName, Value);
37		}
38
39	}
40}