using System;
using System.Windows.Forms;
using System.Xml;
using System.Drawing;
using System.Text;
using System.ComponentModel;
using System.IO;



namespace MyXmlEdit
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>


	public class XmlEdit : RichTextBox
	{
		// Methods
		static XmlEdit()
		{
			XmlEdit.components = null;
		}
		public XmlEdit()
		{
			this.mbolKeyPressHandled = false;
			this.mbolColorizeAndIndent = true;
			this.mbolInvalidated = true;
			this.InitializeComponent();
		}
 

		private void AddIndent(int Indent, StringBuilder sbRichTextXML)
		{
			if (this.mbolColorizeAndIndent)
			{
				sbRichTextXML.Append(@"\cf0 ");
				for (int num1 = 0; num1 < Indent; num1++)
				{
					sbRichTextXML.Append(Globals.TabText);
				}
			}
		}
 

		private string AddNewLine()
		{
			if (this.mbolColorizeAndIndent)
			{
				return "\\par\r\n";
			}
			return "";
		}
 

		private string CreateColour(Color cl)
		{
			string text1 = @"\red";
			text1 = text1 + cl.R;
			text1 = text1 + @"\green";
			text1 = text1 + cl.G;
			text1 = text1 + @"\blue";
			text1 = text1 + cl.B;
			return (text1 + ";");
		}
 

		private string CreateColours()
		{
			StringBuilder builder1 = new StringBuilder();
			builder1.Append(this.CreateColour(Globals.Element));
			builder1.Append(this.CreateColour(Globals.Bracket));
			builder1.Append(this.CreateColour(Globals.Text));
			builder1.Append(this.CreateColour(Globals.Declaration));
			builder1.Append(this.CreateColour(Globals.Comment));
			builder1.Append("}");
			return builder1.ToString();
		}
 

		private void DisplayInvalidLicenseMessage()
		{
			base.Text = "";
			base.AppendText("Either the demo period has expired of a valid license has not been installed.\n\n");
			base.AppendText("Please visit www.smartcomponents.plus.com to purchase a full copy of XmlEdit.");
		}
 

		protected override void Dispose(bool disposing)
		{
			if (disposing && (XmlEdit.components != null))
			{
				XmlEdit.components.Dispose();
			}
			base.Dispose(disposing);
		}
 

		public void FormatXML()
		{
			this.SelectionLength = 0;
			if (this.Text != "")
			{
				int num1;
				if (base.SelectionStart > 0)
				{
					num1 = base.SelectionStart;
				}
				else
				{
					num1 = 0;
				}
				XmlTextReader reader1 = new XmlTextReader(new StringReader(this.Text));
				StringBuilder builder1 = new StringBuilder();
				builder1.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 ");
				builder1.Append(this.Font.Name);
				builder1.Append(";}}");
				builder1.Append(@"{\colortbl ;");
				builder1.Append(this.CreateColours());
				builder1.Append(@"\viewkind4\uc1\pard\cf1\f0\fs17 ");
				while (!reader1.EOF)
				{
					bool flag1;
					int num2;
					try
					{
						reader1.Read();
					}
					catch (XmlException exception1)
					{
						base.SelectionStart = num1;
						base.SelectionColor = Color.Black;
						XmlEdit.mstrValidationErr = exception1.Message;
						return;
					}
					switch (reader1.NodeType)
					{
						case XmlNodeType.Element:
						{
							flag1 = reader1.IsEmptyElement;
							this.AddIndent(reader1.Depth, builder1);
							builder1.Append(Globals.BracketRt);
							builder1.Append("<");
							builder1.Append(Globals.ElementRt);
							builder1.Append(reader1.Name);
							base.SelectionColor = Globals.Text;
							if (!reader1.HasAttributes)
							{
								goto Label_0247;
							}
							num2 = 0;
							goto Label_023A;
						}
						case XmlNodeType.Attribute:
						{
							continue;
						}
						case XmlNodeType.Text:
						{
							this.AddIndent(reader1.Depth, builder1);
							builder1.Append(Globals.TextRt);
							builder1.Append(reader1.Value.Trim());
							builder1.Append(this.AddNewLine());
							continue;
						}
						case XmlNodeType.CDATA:
						{
							this.AddIndent(reader1.Depth, builder1);
							builder1.Append(Globals.BracketRt);
							builder1.Append("<![CDATA[");
							builder1.Append(Globals.TextRt);
							builder1.Append(reader1.Value.Replace(@"\", @"\\"));
							builder1.Append(Globals.BracketRt);
							builder1.Append("]]>");
							builder1.Append(this.AddNewLine());
							continue;
						}
						case XmlNodeType.EntityReference:
						case XmlNodeType.Entity:
						case XmlNodeType.ProcessingInstruction:
						case XmlNodeType.Document:
						case XmlNodeType.DocumentFragment:
						case XmlNodeType.Notation:
						case XmlNodeType.EndEntity:
						{
							goto Label_0540;
						}
						case XmlNodeType.Comment:
						{
							this.AddIndent(reader1.Depth, builder1);
							builder1.Append(Globals.DeclarationRt);
							builder1.Append("<!--");
							builder1.Append(Globals.CommentRt);
							builder1.Append(reader1.Value);
							builder1.Append(Globals.DeclarationRt);
							builder1.Append("-->");
							builder1.Append(this.AddNewLine());
							continue;
						}
						case XmlNodeType.DocumentType:
						{
							builder1.Append(Globals.DeclarationRt);
							builder1.Append("<!DOCTYPE Items [");
							builder1.Append(reader1.Value);
							builder1.Append("]>");
							builder1.Append(this.AddNewLine());
							continue;
						}
						case XmlNodeType.Whitespace:
						{
							if (!this.mbolColorizeAndIndent)
							{
								builder1.Append(reader1.Value);
								if (reader1.Value.IndexOf("\n") > 0)
								{
									MessageBox.Show("NEwline");
									builder1.Append(@"\par");
								}
							}
							continue;
						}
						case XmlNodeType.SignificantWhitespace:
						{
							if (!this.mbolColorizeAndIndent)
							{
								builder1.Append(reader1.Value);
								if (reader1.Value.IndexOf("\n") > 0)
								{
									MessageBox.Show("NEwline");
									builder1.Append(@"\par");
								}
							}
							continue;
						}
						case XmlNodeType.EndElement:
						{
							this.AddIndent(reader1.Depth, builder1);
							builder1.Append(Globals.BracketRt);
							builder1.Append("</");
							builder1.Append(Globals.ElementRt);
							builder1.Append(reader1.Name);
							builder1.Append(Globals.BracketRt);
							builder1.Append(">");
							builder1.Append(this.AddNewLine());
							continue;
						}
						case XmlNodeType.XmlDeclaration:
						{
							this.AddIndent(reader1.Depth, builder1);
							builder1.Append(Globals.DeclarationRt);
							builder1.Append("<?");
							builder1.Append(reader1.Name);
							builder1.Append(" ");
							builder1.Append(reader1.Value);
							builder1.Append("?>");
							builder1.Append(this.AddNewLine());
							continue;
						}
						default:
						{
							goto Label_0540;
						}
					}
				Label_0192:
					reader1.MoveToNextAttribute();
					builder1.Append(Globals.ElementRt);
					builder1.Append(" " + reader1.Name);
					builder1.Append(Globals.BracketRt);
					builder1.Append("=" + reader1.QuoteChar.ToString());
					builder1.Append(Globals.TextRt);
					builder1.Append(reader1[num2].Replace(@"\", @"\\"));
					builder1.Append(Globals.BracketRt);
					builder1.Append(reader1.QuoteChar.ToString());
					num2++;
				Label_023A:
					if (num2 < reader1.AttributeCount)
					{
						goto Label_0192;
					}
				Label_0247:
					builder1.Append(Globals.BracketRt);
					if (flag1)
					{
						builder1.Append("/>");
						//builder1.Append(this.AddNewLine());//vigb87
					}
					else
					{
						builder1.Append(">");
					}
					builder1.Append(this.AddNewLine());
					continue;
				Label_0540:
					builder1.Append(reader1.ReadString());
				}
				builder1.Append("}");
				XmlEdit.mstrValidationErr = "";
				base.Rtf = builder1.ToString();
				if (!Globals.AutoFormat)
				{
					base.SelectionStart = num1;
				}
				
			}
		}

		private void InitializeComponent()
		{
		}
 

		private string LeftTabText()
		{
			return this.Text.Substring(base.SelectionStart - Globals.TabLength, Globals.TabLength);
		}
 

		private void LoadXML(string strXML)
		{
			if (strXML != "")
			{
				int num1;
				if (base.SelectionStart > 0)
				{
					num1 = base.SelectionStart;
				}
				else
				{
					num1 = 0;
				}
				base.Text = "";
				XmlTextReader reader1 = new XmlTextReader(new StringReader(strXML));
				while (!reader1.EOF)
				{
					bool flag1;
					int num2;
					try
					{
						reader1.Read();
					}
					catch (XmlException exception1)
					{
						base.SelectionStart = num1;
						base.SelectionColor = Color.Black;
						XmlEdit.mstrValidationErr = exception1.Message;
						base.Text = strXML;
						return;
					}
					switch (reader1.NodeType)
					{
						case XmlNodeType.Element:
						{
							flag1 = reader1.IsEmptyElement;
							base.SelectionColor = Globals.Bracket;
							base.AppendText("<");
							base.SelectionColor = Globals.Element;
							base.AppendText(reader1.Name);
							base.SelectionColor = Globals.Text;
							if (!reader1.HasAttributes)
							{
								goto Label_01C9;
							}
							num2 = 0;
							goto Label_01BC;
						}
						case XmlNodeType.Attribute:
						case XmlNodeType.EntityReference:
						case XmlNodeType.Entity:
						case XmlNodeType.ProcessingInstruction:
						case XmlNodeType.Document:
						case XmlNodeType.DocumentFragment:
						case XmlNodeType.Notation:
						case XmlNodeType.EndEntity:
						{
							goto Label_0387;
						}
						case XmlNodeType.Text:
						{
							base.SelectionColor = Globals.Text;
							base.AppendText(reader1.Value.Trim());
							continue;
						}
						case XmlNodeType.CDATA:
						{
							base.SelectionColor = Globals.Bracket;
							base.AppendText("<![CDATA[");
							base.SelectionColor = Globals.Text;
							base.AppendText(reader1.Value);
							base.SelectionColor = Globals.Bracket;
							base.AppendText("]]>");
							continue;
						}
						case XmlNodeType.Comment:
						{
							base.SelectionColor = Globals.Declaration;
							base.AppendText("<!--");
							base.SelectionColor = Globals.Comment;
							base.AppendText(reader1.Value);
							base.SelectionColor = Globals.Declaration;
							base.AppendText("-->");
							continue;
						}
						case XmlNodeType.DocumentType:
						{
							base.SelectionColor = Globals.Declaration;
							base.AppendText("<!DOCTYPE Items [");
							base.AppendText(reader1.Value);
							base.AppendText("]>");
							continue;
						}
						case XmlNodeType.Whitespace:
						{
							base.AppendText(reader1.Value);
							continue;
						}
						case XmlNodeType.SignificantWhitespace:
						{
							base.AppendText(reader1.Value);
							continue;
						}
						case XmlNodeType.EndElement:
						{
							base.SelectionColor = Globals.Bracket;
							base.AppendText("</");
							base.SelectionColor = Globals.Element;
							base.AppendText(reader1.Name);
							base.SelectionColor = Globals.Bracket;
							base.AppendText(">");
							continue;
						}
						case XmlNodeType.XmlDeclaration:
						{
							base.SelectionColor = Globals.Declaration;
							base.AppendText("<?");
							base.AppendText(reader1.Name);
							base.AppendText(" ");
							base.AppendText(reader1.Value);
							base.AppendText("?>");
							continue;
						}
						default:
						{
							goto Label_0387;
						}
					}
				Label_012B:
					reader1.MoveToNextAttribute();
					base.SelectionColor = Globals.Element;
					base.AppendText(" " + reader1.Name);
					base.SelectionColor = Globals.Bracket;
					base.AppendText("=" + reader1.QuoteChar.ToString());
					base.SelectionColor = Globals.Text;
					base.AppendText(reader1[num2]);
					base.SelectionColor = Globals.Bracket;
					base.AppendText(reader1.QuoteChar.ToString());
					num2++;
				Label_01BC:
					if (num2 < reader1.AttributeCount)
					{
						goto Label_012B;
					}
				Label_01C9:
					base.SelectionColor = Globals.Bracket;
					if (flag1)
					{
						base.AppendText("/>");
						continue;
					}
					base.AppendText(">");
					continue;
				Label_0387:
					base.AppendText(reader1.ReadString());
				}
				XmlEdit.mstrValidationErr = "";
				base.SelectionStart = num1;
			}
		}

		private Globals.XmlState NodeType()
		{
			string text1 = this.Text;
			try
			{
				for (int num1 = base.SelectionStart - 1; num1 >= 0; num1--)
				{
					Globals.XmlState state1;
					string text2;
					char ch1 = text1[num1];
					if ((text2 = ch1.ToString()) == null)
					{
						goto Label_00FD;
					}
					text2 = string.IsInterned(text2);
					if (text2 != ">")
					{
						if (text2 == "<")
						{
							return Globals.XmlState.Element;
						}
						if (text2 == "\"")
						{
							goto Label_008D;
						}
						if (text2 == "?")
						{
							return Globals.XmlState.Declaration;
						}
						if (text2 == "!")
						{
							goto Label_00B6;
						}
						goto Label_00FD;
					}
					return Globals.XmlState.Text;
				Label_008D:
					ch1 = text1[num1 - 1];
					if (ch1.ToString() == "=")
					{
						return Globals.XmlState.Attrib;
					}
					return Globals.XmlState.Element;
				Label_00B6:
					try
					{
						ch1 = text1[num1 + 1];
						if (ch1.ToString() == "-")
						{
							ch1 = text1[num1 + 2];
							if (ch1.ToString() == "-")
							{
								return Globals.XmlState.Comment;
							}
						}
						state1 = Globals.XmlState.Declaration;
					}
					catch
					{
						state1 = Globals.XmlState.Declaration;
					}
					return state1;
				Label_00FD:;
				}
			}
			catch
			{
				return Globals.XmlState.Unknown;
			}
			return Globals.XmlState.Unknown;
		}
 

		protected override void OnKeyDown(KeyEventArgs e)
		{
			string text1;
			bool flag1 = false;
			this.mbolKeyPressHandled = false;
			this.mbolInvalidated = false;
			int num1 = 0;
			switch (e.KeyCode)
			{
				case Keys.Back:
				{
					if ((this.CursorColumn != 1) && this.TabLocation())
					{
						text1 = this.LeftTabText();
						if (text1.Trim().Length == 0)
						{
							base.SelectionStart = (base.SelectionStart - Globals.TabLength) + 1;
							this.SelectionLength = Globals.TabLength - 1;
							this.SelectedText = "";
						}
					}
					break;
				}
				case Keys.Tab:
				{
					num1 = Globals.TabLength - (int.Parse(this.CursorColumn.ToString()) % Globals.TabLength);
					base.SelectedText = Globals.TabText.Substring(0, num1 + 1);
					this.mbolKeyPressHandled = true;
					break;
				}
				case Keys.Left:
				{
					if ((this.CursorColumn != 1) && this.TabLocation())
					{
						text1 = this.LeftTabText();
						if (text1.Trim().Length == 0)
						{
							base.SelectionStart = (base.SelectionStart - Globals.TabLength) + 1;
						}
					}
					break;
				}
				case Keys.Right:
				{
					if (this.TabLocation())
					{
						text1 = this.RightTabText();
						if (text1.Trim().Length == 0)
						{
							base.SelectionStart = (base.SelectionStart + Globals.TabLength) - 1;
							this.SelectionLength = 0;
						}
					}
					break;
				}
				case Keys.Delete:
				{
					if (this.TabLocation())
					{
						text1 = this.RightTabText();
						if (text1.Trim().Length == 0)
						{
							this.SelectionLength = Globals.TabLength - 1;
							this.SelectedText = "";
						}
					}
					break;
				}
			}
			if ((((((e.Control || (e.KeyCode == Keys.Shift)) || ((e.KeyCode == Keys.ShiftKey) || (e.KeyCode == Keys.Alt))) || (((e.KeyCode == Keys.Insert) || (e.KeyCode == Keys.Home)) || ((e.KeyCode == Keys.End) || (e.KeyCode == Keys.Next)))) || ((((e.KeyCode == Keys.NumLock) || (e.KeyCode == Keys.Snapshot)) || ((e.KeyCode == Keys.Scroll) || (e.KeyCode == Keys.Pause))) || (((e.KeyCode == Keys.F1) || (e.KeyCode == Keys.F2)) || ((e.KeyCode == Keys.F3) || (e.KeyCode == Keys.F4))))) || (((((e.KeyCode == Keys.F5) || (e.KeyCode == Keys.F6)) || ((e.KeyCode == Keys.F7) || (e.KeyCode == Keys.F8))) || (((e.KeyCode == Keys.F9) || (e.KeyCode == Keys.F10)) || ((e.KeyCode == Keys.F11) || (e.KeyCode == Keys.F12)))) || ((((e.KeyCode == Keys.Left) || (e.KeyCode == Keys.Right)) || ((e.KeyCode == Keys.Down) || (e.KeyCode == Keys.Up))) || ((e.KeyCode == Keys.Capital) && (e.KeyCode == Keys.RWin))))) || ((e.KeyCode == Keys.LWin) || (e.KeyCode == Keys.NumLock)))
			{
				flag1 = true;
			}
			else if (e.Shift)
			{
				if (((e.KeyCode == Keys.Oemcomma) || (e.KeyCode == Keys.OemPeriod)) || (((e.KeyCode == Keys.D2) || (e.KeyCode == Keys.D1)) || (e.KeyCode == Keys.OemQuestion)))
				{
					base.SelectionColor = Globals.Bracket;
					flag1 = true;
				}
			}
			else if ((e.KeyCode == Keys.Oemplus) || (e.KeyCode == Keys.OemQuestion))
			{
				base.SelectionColor = Globals.Bracket;
				flag1 = true;
			}
			else if (e.KeyCode == Keys.Tab)
			{
				KeyEventArgs args1 = new KeyEventArgs(Keys.A);
				e.Handled = true;
				base.OnKeyDown(args1);
			}
			if (!flag1)
			{
				switch (this.NodeType())
				{
					case Globals.XmlState.Element:
					{
						base.SelectionColor = Globals.Element;
						goto Label_043D;
					}
					case Globals.XmlState.Text:
					{
						base.SelectionColor = Globals.Text;
						goto Label_043D;
					}
					case Globals.XmlState.Attrib:
					{
						base.SelectionColor = Globals.Text;
						goto Label_043D;
					}
					case Globals.XmlState.Declaration:
					{
						base.SelectionColor = Globals.Declaration;
						goto Label_043D;
					}
					case Globals.XmlState.Comment:
					{
						base.SelectionColor = Globals.Comment;
						goto Label_043D;
					}
				}
				base.SelectionColor = Color.Black;
			}
			Label_043D:
				base.OnKeyDown(e);
		}

		protected override void OnKeyPress(KeyPressEventArgs e)
		{
			Globals.KeyPressed = e.KeyChar.ToString();
			Globals.IsKeyPressed = true;
			if (this.mbolKeyPressHandled)
			{
				e.Handled = true;
			}
			base.OnKeyPress(e);
		}
 

		protected override void OnKeyUp(KeyEventArgs e)
		{
			int num1 = 0;
			int num2 = 0;
			if ((e.KeyCode == Keys.Back) || (e.KeyCode == Keys.Delete))
			{
				base.OnKeyUp(e);
			}
			else
			{
				try
				{
					if ((Globals.AutoFormat && Globals.IsKeyPressed) && ((Globals.KeyPressed != " ") && (this.SelectedText.Length == 0)))
					{
						Globals.IsKeyPressed = false;
						string text1 = this.Text.Substring(0, base.SelectionStart);
						this.FormatXML();
						if (XmlEdit.mstrValidationErr == "")
						{
							while (num1 < text1.Length)
							{
								if (text1.Substring(num1, 1) == base.Text.Substring(num2, 1))
								{
									num1++;
									num2++;
									continue;
								}
								num2++;
							}
							base.SelectionStart = num2;
						}
					}
				}
				catch
				{
				}
				Globals.IsKeyPressed = false;
				this.mbolInvalidated = true;
				base.OnKeyUp(e);
			}
		}

		private string RightTabText()
		{
			long num1 = this.Text.Substring(base.SelectionStart, this.Text.Length - base.SelectionStart).Length;
			if (num1 > (Globals.TabLength - 1))
			{
				return this.Text.Substring(base.SelectionStart, Globals.TabLength - 1);
			}
			return "Dont Tab";
		}
 

		private bool TabLocation()
		{
			return (((int.Parse(this.CursorColumn.ToString()) - 1) % Globals.TabLength) == 0);
		}
 


		// Properties
		public bool AutoFormat
		{
			get
			{
				return Globals.AutoFormat;
			}
			set
			{
				Globals.AutoFormat = value;
			}
		}
 

		public Color CommentColor
		{
			get
			{
				return Globals.Comment;
			}
			set
			{
				Globals.Comment = value;
			}
		}
 

		public long CursorColumn
		{
			get
			{
				char[] chArray1 = this.Text.ToCharArray();
				int num2 = 0;
				int num1 = base.SelectionStart;
				if (num1 > 0)
				{
					while ((chArray1[num1 - 1] != '\n') && (num1 > 1))
					{
						num2++;
						num1--;
					}
				}
				if (num1 == 1)
				{
					num2++;
				}
				return (long) ++num2;
			}
		}
 

		public long CursorRow
		{
			get
			{
				char[] chArray1 = this.Text.ToCharArray();
				int num2 = 0;
				for (int num1 = base.SelectionStart - 1; num1 > 0; num1--)
				{
					if (chArray1[num1] == '\n')
					{
						num2++;
					}
				}
				return (long) ++num2;
			}
		}
 

		public Color DeclarationColor
		{
			get
			{
				return Globals.Declaration;
			}
			set
			{
				Globals.Declaration = value;
			}
		}
 

		public Color ElementColor
		{
			get
			{
				return Globals.Element;
			}
			set
			{
				Globals.Element = value;
			}
		}
 

		public int IndentLength
		{
			get
			{
				return Globals.TabLength;
			}
			set
			{
				Globals.TabText = "";
				Globals.TabLength = value;
				for (int num1 = 0; num1 < Globals.TabLength; num1++)
				{
					Globals.TabText = Globals.TabText + " ";
				}
			}
		}
 

		public Color PunctuationColor
		{
			get
			{
				return Globals.Bracket;
			}
			set
			{
				Globals.Bracket = value;
			}
		}
 
        //3.10.2013 - vigy21 Maly - pridani override
		override public string Text
		{
			get
			{
				return base.Text;
			}
			set
			{
				this.LoadXML(value);
			}
		}
 

		public Color TextNodeColor
		{
			get
			{
				return Globals.Text;
			}
			set
			{
				Globals.Text = value;
			}
		}
 

		public string ValidationErrText
		{
			get
			{
				return XmlEdit.mstrValidationErr;
			}
		}
 


		// Fields
		internal static Container components;
		internal bool mbolColorizeAndIndent;
		internal bool mbolInvalidated;
		private bool mbolKeyPressHandled;
		internal static string mstrValidationErr;
	}
	internal class Globals
	{
		// Methods
		static Globals()
		{
			Globals.mstrRegKey = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SCD";
			Globals.mcolElement = Color.Brown;
			Globals.mstrElementRt = @"\cf1 ";
			Globals.mcolBracket = Color.Blue;
			Globals.mstrBracketRt = @"\cf2 ";
			Globals.mcolText = Color.Black;
			Globals.mstrTextRt = @"\cf3 ";
			Globals.mcolDeclaration = Color.Blue;
			Globals.mstrDeclarationRt = @"\cf4 ";
			Globals.mcolComment = Color.Gray;
			Globals.mstrCommentRt = @"\cf5 ";
			Globals.mintTabLength = 4;
			Globals.mstrTabText = "    ";
			Globals.mbolAutoFormat = false;
			Globals.mbolIsKeyPressed = false;
		}
 
		internal Globals()
		{
		}
 


		// Properties
		public static bool AutoFormat
		{
			get
			{
				return Globals.mbolAutoFormat;
			}
			set
			{
				Globals.mbolAutoFormat = value;
			}
		}
 
		public static Color Bracket
		{
			get
			{
				return Globals.mcolBracket;
			}
			set
			{
				Globals.mcolBracket = value;
			}
		}
 
		public static string BracketRt
		{
			get
			{
				return Globals.mstrBracketRt;
			}
			set
			{
				Globals.mstrBracketRt = value;
			}
		}
 
		public static Color Comment
		{
			get
			{
				return Globals.mcolComment;
			}
			set
			{
				Globals.mcolComment = value;
			}
		}
 
		public static string CommentRt
		{
			get
			{
				return Globals.mstrCommentRt;
			}
			set
			{
				Globals.mstrCommentRt = value;
			}
		}
 
		public static Color Declaration
		{
			get
			{
				return Globals.mcolDeclaration;
			}
			set
			{
				Globals.mcolDeclaration = value;
			}
		}
 
		public static string DeclarationRt
		{
			get
			{
				return Globals.mstrDeclarationRt;
			}
			set
			{
				Globals.mstrDeclarationRt = value;
			}
		}
 
		public static Color Element
		{
			get
			{
				return Globals.mcolElement;
			}
			set
			{
				Globals.mcolElement = value;
			}
		}
 
		public static string ElementRt
		{
			get
			{
				return Globals.mstrElementRt;
			}
			set
			{
				Globals.mstrElementRt = value;
			}
		}
 
		public static bool IsKeyPressed
		{
			get
			{
				return Globals.mbolIsKeyPressed;
			}
			set
			{
				Globals.mbolIsKeyPressed = value;
			}
		}
 

 
		public static string KeyPressed
		{
			get
			{
				return Globals.mstrKeyPressed;
			}
			set
			{
				Globals.mstrKeyPressed = value;
			}
		}
 
		public static string RegKey
		{
			get
			{
				return Globals.mstrRegKey;
			}
		}
 
		public static int TabLength
		{
			get
			{
				return Globals.mintTabLength;
			}
			set
			{
				Globals.mintTabLength = value;
			}
		}
 
		public static string TabText
		{
			get
			{
				return Globals.mstrTabText;
			}
			set
			{
				Globals.mstrTabText = value;
			}
		}
 
		public static Color Text
		{
			get
			{
				return Globals.mcolText;
			}
			set
			{
				Globals.mcolText = value;
			}
		}
 
		public static string TextRt
		{
			get
			{
				return Globals.mstrTextRt;
			}
			set
			{
				Globals.mstrTextRt = value;
			}
		}
 


		// Fields
		private static bool mbolAutoFormat;
		//private static bool mbolHasValidLicense;
		private static bool mbolIsKeyPressed;
		private static Color mcolBracket;
		private static Color mcolComment;
		private static Color mcolDeclaration;
		private static Color mcolElement;
		private static Color mcolText;
		private static int mintTabLength;
		private static string mstrBracketRt;
		private static string mstrCommentRt;
		private static string mstrDeclarationRt;
		private static string mstrElementRt;
		private static string mstrKeyPressed;
		private static string mstrRegKey;
		private static string mstrTabText;
		private static string mstrTextRt;

		// Nested Types
		public enum XmlState
		{
			// Fields
			Attrib = 3,
			Comment = 5,
			Declaration = 4,
			Element = 1,
			Text = 2,
			Unknown = 0
		}
	}
 

}
