PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/icsharpcode/ILSpy
C# | 65 lines | 49 code | 14 blank | 2 comment | 0 complexity | e1cdc9b8f6f50719b22456d9754ba2c3 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;
 6using System.Collections.Generic;
 7using System.Text;
 8using System.Xml;
 9
10namespace Ricciolo.StylesExplorer.MarkupReflection
11{
12	class XmlBamlElement : XmlBamlNode
13	{
14		XmlNamespaceCollection _namespaces = new XmlNamespaceCollection();
15
16		public XmlBamlElement()
17		{
18		}
19
20		public XmlBamlElement(XmlBamlElement parent)
21		{
22			this.Parent = parent;
23			this.Namespaces.AddRange(parent.Namespaces);
24		}
25
26		public XmlNamespaceCollection Namespaces {
27			get { return _namespaces; }
28		}
29		
30		public XmlBamlElement Parent { get; private set; }
31		
32		public TypeDeclaration TypeDeclaration { get; set; }
33
34		public override XmlNodeType NodeType {
35			get { return XmlNodeType.Element; }
36		}
37
38		public long Position { get; set; }
39		
40		public bool IsImplicit { get; set; }
41
42		public override string ToString()
43		{
44			return string.Format("Element: {0}", TypeDeclaration.Name);
45		}
46	}
47
48	class XmlBamlEndElement : XmlBamlElement
49	{
50		public XmlBamlEndElement(XmlBamlElement start)
51		{
52			this.TypeDeclaration = start.TypeDeclaration;
53			this.Namespaces.AddRange(start.Namespaces);
54		}
55
56		public override XmlNodeType NodeType {
57			get { return XmlNodeType.EndElement; }
58		}
59
60		public override string ToString()
61		{
62			return string.Format("EndElement: {0}", TypeDeclaration.Name);
63		}
64	}
65}