PageRenderTime 24ms CodeModel.GetById 21ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/icsharpcode/ILSpy
C# | 47 lines | 38 code | 7 blank | 2 comment | 0 complexity | 0b476a084955f432e2ba9a24db28a9cf MD5 | raw file
 1// Copyright (c) Cristian Civera (cristian@aspitalia.com)
 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;
 7
 8namespace Ricciolo.StylesExplorer.MarkupReflection
 9{
10	internal class XmlBamlPropertyElement : XmlBamlElement
11	{
12		private readonly PropertyType _propertyType;
13		private PropertyDeclaration propertyDeclaration;
14		
15		public XmlBamlPropertyElement(PropertyType propertyType, PropertyDeclaration propertyDeclaration)
16		{
17			_propertyType = propertyType;
18			this.propertyDeclaration = propertyDeclaration;
19		}
20
21		public XmlBamlPropertyElement(XmlBamlElement parent, PropertyType propertyType, PropertyDeclaration propertyDeclaration)
22			: base(parent)
23		{
24			_propertyType = propertyType;
25			this.propertyDeclaration = propertyDeclaration;
26			this.TypeDeclaration = propertyDeclaration.DeclaringType;
27		}
28
29		public PropertyDeclaration PropertyDeclaration
30		{
31			get
32			{
33				return this.propertyDeclaration;
34			}
35		}
36
37		public PropertyType PropertyType
38		{
39			get { return _propertyType; }
40		}
41
42		public override string ToString()
43		{
44			return String.Format("PropertyElement: {0}.{1}", TypeDeclaration.Name.Replace('+', '.'), PropertyDeclaration.Name);
45		}
46	}
47}