Inheritance: IHighlightingStrategy
示例#1
0
        IHighlightingStrategy LoadDefinition(DictionaryEntry entry)
        {
            SyntaxMode syntaxMode = (SyntaxMode)entry.Key;
            ISyntaxModeFileProvider syntaxModeFileProvider = (ISyntaxModeFileProvider)entry.Value;

            DefaultHighlightingStrategy highlightingStrategy = null;

            try {
                //johnny
                //var reader = syntaxModeFileProvider.GetSyntaxModeFile(syntaxMode);
                System.Xml.XmlTextReader reader = syntaxModeFileProvider.GetSyntaxModeFile(syntaxMode);
                if (reader == null)
                {
                    throw new HighlightingDefinitionInvalidException("Could not get syntax mode file for " + syntaxMode.Name);
                }
                highlightingStrategy = HighlightingDefinitionParser.Parse(syntaxMode, reader);
                if (highlightingStrategy.Name != syntaxMode.Name)
                {
                    throw new HighlightingDefinitionInvalidException("The name specified in the .xshd '" + highlightingStrategy.Name + "' must be equal the syntax mode name '" + syntaxMode.Name + "'");
                }
            } finally {
                if (highlightingStrategy == null)
                {
                    highlightingStrategy = DefaultHighlighting;
                }
                highlightingDefs[syntaxMode.Name] = highlightingStrategy;
                highlightingStrategy.ResolveReferences();
            }
            return(highlightingStrategy);
        }
示例#2
0
		void CreateDefaultHighlightingStrategy()
		{
			DefaultHighlightingStrategy defaultHighlightingStrategy = new DefaultHighlightingStrategy();
			defaultHighlightingStrategy.Extensions = new string[] {};
			defaultHighlightingStrategy.Rules.Add(new HighlightRuleSet());
			highlightingDefs["Default"] = defaultHighlightingStrategy;
		}
示例#3
0
        private IHighlightingStrategy LoadDefinition(DictionaryEntry entry)
        {
            SyntaxMode key = (SyntaxMode)entry.Key;
            ISyntaxModeFileProvider     value = (ISyntaxModeFileProvider)entry.Value;
            DefaultHighlightingStrategy defaultHighlighting = null;

            try
            {
                XmlTextReader syntaxModeFile = value.GetSyntaxModeFile(key);
                if (syntaxModeFile == null)
                {
                    throw new HighlightingDefinitionInvalidException(string.Concat("Could not get syntax mode file for ", key.Name));
                }
                defaultHighlighting = HighlightingDefinitionParser.Parse(key, syntaxModeFile);
                if (defaultHighlighting.Name != key.Name)
                {
                    string[] name = new string[] { "The name specified in the .xshd '", defaultHighlighting.Name, "' must be equal the syntax mode name '", key.Name, "'" };
                    throw new HighlightingDefinitionInvalidException(string.Concat(name));
                }
            }
            finally
            {
                if (defaultHighlighting == null)
                {
                    defaultHighlighting = this.DefaultHighlighting;
                }
                this.highlightingDefs[key.Name] = defaultHighlighting;
                defaultHighlighting.ResolveReferences();
            }
            return(defaultHighlighting);
        }
		public AdvancedHighlightingStrategy(DefaultHighlightingStrategy baseStrategy, IAdvancedHighlighter highlighter)
		{
			if (highlighter == null)
				throw new ArgumentNullException("highlighter");
			ImportSettingsFrom(baseStrategy);
			this.highlighter = highlighter;
		}
        IHighlightingStrategy LoadDefinition(Tuple <SyntaxMode, ISyntaxModeFileProvider> entry)
        {
            SyntaxMode syntaxMode = entry.Item1;
            ISyntaxModeFileProvider syntaxModeFileProvider = entry.Item2;

            DefaultHighlightingStrategy highlightingStrategy = null;

            try
            {
                var reader = syntaxModeFileProvider.GetSyntaxModeFile(syntaxMode);
                if (reader == null)
                {
                    throw new HighlightingDefinitionInvalidException("Could not get syntax mode file for " + syntaxMode.Name);
                }
                highlightingStrategy = HighlightingDefinitionParser.Parse(syntaxMode, reader);
                if (highlightingStrategy.Name != syntaxMode.Name)
                {
                    throw new HighlightingDefinitionInvalidException("The name specified in the .xshd '" + highlightingStrategy.Name + "' must be equal the syntax mode name '" + syntaxMode.Name + "'");
                }
            }
            finally
            {
                if (highlightingStrategy == null)
                {
                    highlightingStrategy = DefaultHighlighting;
                }
                HighlightingDefinitions[syntaxMode.Name] = highlightingStrategy;
                highlightingStrategy.ResolveReferences();
            }
            return(highlightingStrategy);
        }
        private void CreateDefaultHighlightingStrategy()
        {
            var defaultHighlightingStrategy = new DefaultHighlightingStrategy();

            defaultHighlightingStrategy.Extensions = new string[] { };
            defaultHighlightingStrategy.Rules.Add(new HighlightRuleSet());
            HighlightingDefinitions["Default"] = defaultHighlightingStrategy;
        }
        void CreateDefaultHighlightingStrategy()
        {
            DefaultHighlightingStrategy defaultHighlightingStrategy = new DefaultHighlightingStrategy();

            defaultHighlightingStrategy.Extensions = new string[] {};
            defaultHighlightingStrategy.Rules.Add(new HighlightRuleSet());
            highlightingDefs["Default"] = defaultHighlightingStrategy;
        }
示例#8
0
        private void CreateDefaultHighlightingStrategy()
        {
            DefaultHighlightingStrategy defaultHighlightingStrategy = new DefaultHighlightingStrategy()
            {
                Extensions = new string[0]
            };

            defaultHighlightingStrategy.Rules.Add(new HighlightRuleSet());
            this.highlightingDefs["Default"] = defaultHighlightingStrategy;
        }
        IHighlightingStrategy LoadDefinition(DictionaryEntry entry)
        {
            SyntaxMode syntaxMode = (SyntaxMode)entry.Key;
            ISyntaxModeFileProvider syntaxModeFileProvider = (ISyntaxModeFileProvider)entry.Value;

            DefaultHighlightingStrategy highlightingStrategy = HighlightingDefinitionParser.Parse(syntaxMode, syntaxModeFileProvider.GetSyntaxModeFile(syntaxMode));

            highlightingDefs[syntaxMode.Name] = highlightingStrategy;
            highlightingStrategy.ResolveReferences();

            return(highlightingStrategy);
        }
 protected void ImportSettingsFrom(DefaultHighlightingStrategy source)
 {
     if (source == null)
         throw new ArgumentNullException("source");
     Properties = source.Properties;
     Extensions = source.Extensions;
     DigitColor = source.DigitColor;
     defaultRuleSet = source.defaultRuleSet;
     Name = source.Name;
     Folding = source.Folding;
     Rules = source.Rules;
     DefaultTextColor = source.DefaultTextColor;
 }
		protected void ImportSettingsFrom(DefaultHighlightingStrategy source)
		{
			if (source == null)
				throw new ArgumentNullException("source");
			properties = source.properties;
			extensions = source.extensions;
			digitColor = source.digitColor;
			defaultRuleSet = source.defaultRuleSet;
			name = source.name;
			rules = source.rules;
			environmentColors = source.environmentColors;
			defaultTextColor = source.defaultTextColor;
		}
示例#12
0
 protected void ImportSettingsFrom(DefaultHighlightingStrategy source)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     properties        = source.properties;
     extensions        = source.extensions;
     digitColor        = source.digitColor;
     defaultRuleSet    = source.defaultRuleSet;
     name              = source.name;
     rules             = source.rules;
     environmentColors = source.environmentColors;
     defaultTextColor  = source.defaultTextColor;
 }
示例#13
0
 protected void ImportSettingsFrom(DefaultHighlightingStrategy source)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     Properties       = source.Properties;
     Extensions       = source.Extensions;
     DigitColor       = source.DigitColor;
     defaultRuleSet   = source.defaultRuleSet;
     Name             = source.Name;
     Folding          = source.Folding;
     Rules            = source.Rules;
     DefaultTextColor = source.DefaultTextColor;
 }
示例#14
0
        public SyntaxMode AddHighlightingStrategy(string syntaxFile)
        {
            DefaultHighlightingStrategy highlightingStrategy = null;
            SyntaxMode syntaxMode = new SyntaxMode(syntaxFile, "", "");

            try
            {
                var reader = new XmlTextReader(File.OpenRead(syntaxFile));
                if (reader == null)
                {
                    throw new HighlightingDefinitionInvalidException("Could not get syntax mode file for " + syntaxFile);
                }

                highlightingStrategy  = HighlightingDefinitionParser.Parse(syntaxMode, reader);
                syntaxMode.Name       = highlightingStrategy.Name;
                syntaxMode.Extensions = highlightingStrategy.Extensions;

                //if (highlightingStrategy.Name != syntaxMode.Name)
                //{
                //    throw new HighlightingDefinitionInvalidException("The name specified in the .xshd '" + highlightingStrategy.Name + "' must be equal the syntax mode name '" + syntaxMode.Name + "'");
                //}

                if (highlightingStrategy == null)
                {
                    highlightingStrategy = DefaultHighlighting;
                }
                highlightingDefs[syntaxMode.Name] = highlightingStrategy;
                highlightingStrategy.ResolveReferences();
                foreach (string extension in highlightingStrategy.Extensions)
                {
                    extensionsToName[extension.ToUpperInvariant()] = highlightingStrategy.Name;
                }

                return(syntaxMode);
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message + ex.StackTrace);
                return(null);
            }
        }
示例#15
0
		public static DefaultHighlightingStrategy Parse(SyntaxMode syntaxMode, XmlTextReader xmlTextReader)
		{
			if (syntaxMode == null)
				throw new ArgumentNullException("syntaxMode");
			if (xmlTextReader == null)
				throw new ArgumentNullException("xmlTextReader");
			try {
				XmlReaderSettings settings = new XmlReaderSettings();
				Stream shemaStream = typeof(HighlightingDefinitionParser).Assembly.GetManifestResourceStream("ICSharpCode.TextEditor.Resources.Mode.xsd");
				settings.Schemas.Add("", new XmlTextReader(shemaStream));
				settings.Schemas.ValidationEventHandler += new ValidationEventHandler(ValidationHandler);
				settings.ValidationType = ValidationType.Schema;
				XmlReader validatingReader = XmlReader.Create(xmlTextReader, settings);

//				XmlValidatingReader validatingReader = new XmlValidatingReader(xmlTextReader);
				//				Stream shemaStream = Assembly.GetCallingAssembly().GetManifestResourceStream("Resources.Mode.xsd");
//				validatingReader.Schemas.Add("", new XmlTextReader(shemaStream));
//				validatingReader.ValidationType = ValidationType.Schema;
			    
				
				XmlDocument doc = new XmlDocument();
				doc.Load(validatingReader);
				
				DefaultHighlightingStrategy highlighter = new DefaultHighlightingStrategy(doc.DocumentElement.Attributes["name"].InnerText);
				
				if (doc.DocumentElement.Attributes["extensions"]!= null) {
					highlighter.Extensions = doc.DocumentElement.Attributes["extensions"].InnerText.Split(new char[] { ';', '|' });
				}
				
				XmlElement environment = doc.DocumentElement["Environment"];
				if (environment != null) {
					foreach (XmlNode node in environment.ChildNodes) {
						if (node is XmlElement) {
							XmlElement el = (XmlElement)node;
							highlighter.SetColorFor(el.Name, el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el));
						}
					}
				}
				
				// parse properties
				if (doc.DocumentElement["Properties"]!= null) {
					foreach (XmlElement propertyElement in doc.DocumentElement["Properties"].ChildNodes) {
						highlighter.Properties[propertyElement.Attributes["name"].InnerText] =  propertyElement.Attributes["value"].InnerText;
					}
				}
				
				if (doc.DocumentElement["Digits"]!= null) {
					highlighter.DigitColor = new HighlightColor(doc.DocumentElement["Digits"]);
				}
				
				XmlNodeList nodes = doc.DocumentElement.GetElementsByTagName("RuleSet");
				foreach (XmlElement element in nodes) {
					highlighter.AddRuleSet(new HighlightRuleSet(element));
				}
				
				xmlTextReader.Close();
				
				if(errors!=null) {
					ReportErrors(syntaxMode.FileName);
					errors = null;
					return null;
				} else {
					return highlighter;		
				}
			} catch (Exception e) {
				MessageBox.Show("Could not load mode definition file.\n" + e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
				return null;
			}
		}	
示例#16
0
        public static DefaultHighlightingStrategy Parse(DefaultHighlightingStrategy highlighter, SyntaxMode syntaxMode, XmlReader xmlReader)
        {
            if (syntaxMode == null)
            {
                throw new ArgumentNullException("syntaxMode");
            }
            if (xmlReader == null)
            {
                throw new ArgumentNullException("xmlTextReader");
            }
            try {
                List <ValidationEventArgs> errors   = null;
                XmlReaderSettings          settings = new XmlReaderSettings();
                Stream shemaStream = typeof(HighlightingDefinitionParser).Assembly.GetManifestResourceStream("GNet.ICSharpCode.TextEditor.Resources.Mode.xsd");
                settings.Schemas.Add("", new XmlTextReader(shemaStream));
                settings.Schemas.ValidationEventHandler += delegate(object sender, ValidationEventArgs args) {
                    if (errors == null)
                    {
                        errors = new List <ValidationEventArgs>();
                    }
                    errors.Add(args);
                };
                settings.ValidationType = ValidationType.Schema;
                XmlReader validatingReader = XmlReader.Create(xmlReader, settings);

                XmlDocument doc = new XmlDocument();
                doc.Load(validatingReader);

                if (highlighter == null)
                {
                    highlighter = new DefaultHighlightingStrategy(doc.DocumentElement.Attributes["name"].InnerText);
                }

                if (doc.DocumentElement.HasAttribute("extends"))
                {
                    KeyValuePair <SyntaxMode, ISyntaxModeFileProvider> entry = HighlightingManager.Manager.FindHighlighterEntry(doc.DocumentElement.GetAttribute("extends"));
                    if (entry.Key == null)
                    {
                        throw new HighlightingDefinitionInvalidException("Cannot find referenced highlighting source " + doc.DocumentElement.GetAttribute("extends"));
                    }
                    else
                    {
                        highlighter = Parse(highlighter, entry.Key, entry.Value.GetSyntaxModeFile(entry.Key));
                        if (highlighter == null)
                        {
                            return(null);
                        }
                    }
                }
                if (doc.DocumentElement.HasAttribute("extensions"))
                {
                    highlighter.Extensions = doc.DocumentElement.GetAttribute("extensions").Split(new char[] { ';', '|' });
                }

                XmlElement environment = doc.DocumentElement["Environment"];
                if (environment != null)
                {
                    foreach (XmlNode node in environment.ChildNodes)
                    {
                        if (node is XmlElement)
                        {
                            XmlElement el = (XmlElement)node;
                            if (el.Name == "Custom")
                            {
                                highlighter.SetColorFor(el.GetAttribute("name"), el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el));
                            }
                            else
                            {
                                highlighter.SetColorFor(el.Name, el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el));
                            }
                        }
                    }
                }

                // parse properties
                if (doc.DocumentElement["Properties"] != null)
                {
                    foreach (XmlElement propertyElement in doc.DocumentElement["Properties"].ChildNodes)
                    {
                        highlighter.Properties[propertyElement.Attributes["name"].InnerText] = propertyElement.Attributes["value"].InnerText;
                    }
                }

                if (doc.DocumentElement["Digits"] != null)
                {
                    highlighter.DigitColor = new HighlightColor(doc.DocumentElement["Digits"]);
                }

                XmlNodeList nodes = doc.DocumentElement.GetElementsByTagName("RuleSet");
                foreach (XmlElement element in nodes)
                {
                    highlighter.AddRuleSet(new HighlightRuleSet(element));
                }

                xmlReader.Close();

                if (errors != null)
                {
                    StringBuilder msg = new StringBuilder();
                    foreach (ValidationEventArgs args in errors)
                    {
                        msg.AppendLine(args.Message);
                    }
                    throw new HighlightingDefinitionInvalidException(msg.ToString());
                }
                else
                {
                    return(highlighter);
                }
            } catch (Exception e) {
                throw new HighlightingDefinitionInvalidException("Could not load mode definition file '" + syntaxMode.FileName + "'.\n", e);
            }
        }
        private List <TextWord> ParseLine(IDocument document)
        {
            List <TextWord> textWords      = new List <TextWord>();
            HighlightColor  highlightColor = null;

            this.currentOffset = 0;
            this.currentLength = 0;
            this.UpdateSpanStateVariables();
            int length = this.currentLine.Length;
            int offset = this.currentLine.Offset;

            for (int i = 0; i < length; i++)
            {
                char charAt = document.GetCharAt(offset + i);
                char chr    = charAt;
                switch (chr)
                {
                case '\t':
                {
                    this.PushCurWord(document, ref highlightColor, textWords);
                    if (this.activeSpan == null || !this.activeSpan.Color.HasBackground)
                    {
                        textWords.Add(TextWord.Tab);
                    }
                    else
                    {
                        textWords.Add(new TextWord.TabTextWord(this.activeSpan.Color));
                    }
                    this.currentOffset++;
                    break;
                }

                case '\n':
                case '\r':
                {
                    this.PushCurWord(document, ref highlightColor, textWords);
                    this.currentOffset++;
                    break;
                }

                case '\v':
                case '\f':
                {
                    char escapeCharacter = '\0';
                    if (this.activeSpan != null && this.activeSpan.EscapeCharacter != 0)
                    {
                        escapeCharacter = this.activeSpan.EscapeCharacter;
                    }
                    else if (this.activeRuleSet != null)
                    {
                        escapeCharacter = this.activeRuleSet.EscapeCharacter;
                    }
                    if (escapeCharacter != 0 && escapeCharacter == charAt)
                    {
                        if (this.activeSpan == null || this.activeSpan.End == null || (int)this.activeSpan.End.Length != 1 || escapeCharacter != this.activeSpan.End[0])
                        {
                            this.currentLength++;
                            if (i + 1 < length)
                            {
                                this.currentLength++;
                            }
                            this.PushCurWord(document, ref highlightColor, textWords);
                            i++;
                            break;
                        }
                        else if (i + 1 < length && document.GetCharAt(offset + i + 1) == escapeCharacter)
                        {
                            this.currentLength += 2;
                            this.PushCurWord(document, ref highlightColor, textWords);
                            i++;
                            break;
                        }
                    }
                    if (!this.inSpan && (char.IsDigit(charAt) || charAt == '.' && i + 1 < length && char.IsDigit(document.GetCharAt(offset + i + 1))) && this.currentLength == 0)
                    {
                        bool flag  = false;
                        bool flag1 = false;
                        if (charAt != '0' || i + 1 >= length || char.ToUpper(document.GetCharAt(offset + i + 1)) != 'X')
                        {
                            this.currentLength++;
                            while (i + 1 < length && char.IsDigit(document.GetCharAt(offset + i + 1)))
                            {
                                i++;
                                this.currentLength++;
                            }
                        }
                        else
                        {
                            this.currentLength++;
                            i++;
                            this.currentLength++;
                            flag = true;
                            while (i + 1 < length)
                            {
                                if ("0123456789ABCDEF".IndexOf(char.ToUpper(document.GetCharAt(offset + i + 1))) != -1)
                                {
                                    i++;
                                    this.currentLength++;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                        if (!flag && i + 1 < length && document.GetCharAt(offset + i + 1) == '.')
                        {
                            flag1 = true;
                            i++;
                            this.currentLength++;
                            while (i + 1 < length && char.IsDigit(document.GetCharAt(offset + i + 1)))
                            {
                                i++;
                                this.currentLength++;
                            }
                        }
                        if (i + 1 < length && char.ToUpper(document.GetCharAt(offset + i + 1)) == 'E')
                        {
                            flag1 = true;
                            i++;
                            this.currentLength++;
                            if (i + 1 < length && (document.GetCharAt(offset + i + 1) == '+' || document.GetCharAt(this.currentLine.Offset + i + 1) == '-'))
                            {
                                i++;
                                this.currentLength++;
                            }
                            while (i + 1 < this.currentLine.Length && char.IsDigit(document.GetCharAt(offset + i + 1)))
                            {
                                i++;
                                this.currentLength++;
                            }
                        }
                        if (i + 1 < this.currentLine.Length)
                        {
                            char upper = char.ToUpper(document.GetCharAt(offset + i + 1));
                            if (upper == 'F' || upper == 'M' || upper == 'D')
                            {
                                flag1 = true;
                                i++;
                                this.currentLength++;
                            }
                        }
                        if (!flag1)
                        {
                            bool flag2 = false;
                            if (i + 1 < length && char.ToUpper(document.GetCharAt(offset + i + 1)) == 'U')
                            {
                                i++;
                                this.currentLength++;
                                flag2 = true;
                            }
                            if (i + 1 < length && char.ToUpper(document.GetCharAt(offset + i + 1)) == 'L')
                            {
                                i++;
                                this.currentLength++;
                                if (!flag2 && i + 1 < length && char.ToUpper(document.GetCharAt(offset + i + 1)) == 'U')
                                {
                                    i++;
                                    this.currentLength++;
                                }
                            }
                        }
                        textWords.Add(new TextWord(document, this.currentLine, this.currentOffset, this.currentLength, this.DigitColor, false));
                        this.currentOffset += this.currentLength;
                        this.currentLength  = 0;
                        break;
                    }
                    else if (!this.inSpan || this.activeSpan.End == null || (int)this.activeSpan.End.Length <= 0 || !DefaultHighlightingStrategy.MatchExpr(this.currentLine, this.activeSpan.End, i, document, this.activeSpan.IgnoreCase))
                    {
                        if (this.activeRuleSet != null)
                        {
                            foreach (Span span in this.activeRuleSet.Spans)
                            {
                                if (span.IsBeginSingleWord && this.currentLength != 0)
                                {
                                    continue;
                                }
                                if (span.IsBeginStartOfLine.HasValue)
                                {
                                    if (span.IsBeginStartOfLine.Value != (this.currentLength != 0 ? false : textWords.TrueForAll((TextWord textWord) => textWord.Type != TextWordType.Word)))
                                    {
                                        continue;
                                    }
                                }
                                if (!DefaultHighlightingStrategy.MatchExpr(this.currentLine, span.Begin, i, document, this.activeRuleSet.IgnoreCase))
                                {
                                    continue;
                                }
                                this.PushCurWord(document, ref highlightColor, textWords);
                                string regString = DefaultHighlightingStrategy.GetRegString(this.currentLine, span.Begin, i, document);
                                if (!this.OverrideSpan(regString, document, textWords, span, ref i))
                                {
                                    this.currentLength += regString.Length;
                                    textWords.Add(new TextWord(document, this.currentLine, this.currentOffset, this.currentLength, span.BeginColor, false));
                                    this.currentOffset += this.currentLength;
                                    this.currentLength  = 0;
                                    i = i + (regString.Length - 1);
                                    if (this.currentSpanStack == null)
                                    {
                                        this.currentSpanStack = new SpanStack();
                                    }
                                    this.currentSpanStack.Push(span);
                                    span.IgnoreCase = this.activeRuleSet.IgnoreCase;
                                    this.UpdateSpanStateVariables();
                                }
                                goto label0;
                            }
                        }
                        if (this.activeRuleSet != null && charAt < 'Ā' && this.activeRuleSet.Delimiters[charAt])
                        {
                            this.PushCurWord(document, ref highlightColor, textWords);
                            if (this.currentOffset + this.currentLength + 1 < this.currentLine.Length)
                            {
                                this.currentLength++;
                                this.PushCurWord(document, ref highlightColor, textWords);
                                break;
                            }
                        }
                        this.currentLength++;
                        break;
                    }
                    else
                    {
                        this.PushCurWord(document, ref highlightColor, textWords);
                        string str = DefaultHighlightingStrategy.GetRegString(this.currentLine, this.activeSpan.End, i, document);
                        this.currentLength += str.Length;
                        textWords.Add(new TextWord(document, this.currentLine, this.currentOffset, this.currentLength, this.activeSpan.EndColor, false));
                        this.currentOffset += this.currentLength;
                        this.currentLength  = 0;
                        i = i + (str.Length - 1);
                        this.currentSpanStack.Pop();
                        this.UpdateSpanStateVariables();
                        break;
                    }
                }

                default:
                {
                    if (chr == ' ')
                    {
                        this.PushCurWord(document, ref highlightColor, textWords);
                        if (this.activeSpan == null || !this.activeSpan.Color.HasBackground)
                        {
                            textWords.Add(TextWord.Space);
                        }
                        else
                        {
                            textWords.Add(new TextWord.SpaceTextWord(this.activeSpan.Color));
                        }
                        this.currentOffset++;
                        break;
                    }
                    else
                    {
                        goto case '\f';
                    }
                }
                }
                label0 :;
            }
            this.PushCurWord(document, ref highlightColor, textWords);
            this.OnParsedLine(document, this.currentLine, textWords);
            return(textWords);
        }
示例#18
0
        public static DefaultHighlightingStrategy Parse(DefaultHighlightingStrategy highlighter, SyntaxMode syntaxMode, XmlReader xmlReader)
        {
            DefaultHighlightingStrategy defaultHighlightingStrategy;
            HighlightColor highlightBackground;
            HighlightColor highlightColor;

            if (syntaxMode == null)
            {
                throw new ArgumentNullException("syntaxMode");
            }
            if (xmlReader == null)
            {
                throw new ArgumentNullException("xmlTextReader");
            }
            try
            {
                List <ValidationEventArgs> validationEventArgs = null;
                XmlReaderSettings          xmlReaderSetting    = new XmlReaderSettings();
                Stream manifestResourceStream = typeof(HighlightingDefinitionParser).Assembly.GetManifestResourceStream("BigBug.ICSharpCode.TextEditor.xshd.Mode.xsd");
                xmlReaderSetting.Schemas.Add("", new XmlTextReader(manifestResourceStream));
                xmlReaderSetting.Schemas.ValidationEventHandler += new ValidationEventHandler((object sender, ValidationEventArgs args) => {
                    if (validationEventArgs == null)
                    {
                        validationEventArgs = new List <ValidationEventArgs>();
                    }
                    validationEventArgs.Add(args);
                });
                xmlReaderSetting.ValidationType = ValidationType.Schema;
                XmlReader   xmlReader1  = XmlReader.Create(xmlReader, xmlReaderSetting);
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.Load(xmlReader1);
                if (highlighter == null)
                {
                    highlighter = new DefaultHighlightingStrategy(xmlDocument.DocumentElement.Attributes["name"].InnerText);
                }
                if (xmlDocument.DocumentElement.HasAttribute("extends"))
                {
                    KeyValuePair <SyntaxMode, ISyntaxModeFileProvider> keyValuePair = HighlightingManager.Manager.FindHighlighterEntry(xmlDocument.DocumentElement.GetAttribute("extends"));
                    if (keyValuePair.Key == null)
                    {
                        throw new HighlightingDefinitionInvalidException(string.Concat("Cannot find referenced highlighting source ", xmlDocument.DocumentElement.GetAttribute("extends")));
                    }
                    highlighter = HighlightingDefinitionParser.Parse(highlighter, keyValuePair.Key, keyValuePair.Value.GetSyntaxModeFile(keyValuePair.Key));
                    if (highlighter == null)
                    {
                        defaultHighlightingStrategy = null;
                        return(defaultHighlightingStrategy);
                    }
                }
                if (xmlDocument.DocumentElement.HasAttribute("extensions"))
                {
                    string attribute = xmlDocument.DocumentElement.GetAttribute("extensions");
                    char[] chrArray  = new char[] { ';', '|' };
                    highlighter.Extensions = attribute.Split(chrArray);
                }
                XmlElement item = xmlDocument.DocumentElement["Environment"];
                if (item != null)
                {
                    foreach (XmlNode childNode in item.ChildNodes)
                    {
                        if (!(childNode is XmlElement))
                        {
                            continue;
                        }
                        XmlElement xmlElement = (XmlElement)childNode;
                        if (xmlElement.Name != "Custom")
                        {
                            DefaultHighlightingStrategy defaultHighlightingStrategy1 = highlighter;
                            string name = xmlElement.Name;
                            if (xmlElement.HasAttribute("bgcolor"))
                            {
                                highlightBackground = new HighlightBackground(xmlElement);
                            }
                            else
                            {
                                highlightBackground = new HighlightColor(xmlElement);
                            }
                            defaultHighlightingStrategy1.SetColorFor(name, highlightBackground);
                        }
                        else
                        {
                            DefaultHighlightingStrategy defaultHighlightingStrategy2 = highlighter;
                            string str = xmlElement.GetAttribute("name");
                            if (xmlElement.HasAttribute("bgcolor"))
                            {
                                highlightColor = new HighlightBackground(xmlElement);
                            }
                            else
                            {
                                highlightColor = new HighlightColor(xmlElement);
                            }
                            defaultHighlightingStrategy2.SetColorFor(str, highlightColor);
                        }
                    }
                }
                if (xmlDocument.DocumentElement["Properties"] != null)
                {
                    foreach (XmlElement innerText in xmlDocument.DocumentElement["Properties"].ChildNodes)
                    {
                        highlighter.Properties[innerText.Attributes["name"].InnerText] = innerText.Attributes["value"].InnerText;
                    }
                }
                if (xmlDocument.DocumentElement["Digits"] != null)
                {
                    highlighter.DigitColor = new HighlightColor(xmlDocument.DocumentElement["Digits"]);
                }
                foreach (XmlElement elementsByTagName in xmlDocument.DocumentElement.GetElementsByTagName("RuleSet"))
                {
                    highlighter.AddRuleSet(new HighlightRuleSet(elementsByTagName));
                }
                xmlReader.Close();
                if (validationEventArgs != null)
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    foreach (ValidationEventArgs validationEventArg in validationEventArgs)
                    {
                        stringBuilder.AppendLine(validationEventArg.Message);
                    }
                    throw new HighlightingDefinitionInvalidException(stringBuilder.ToString());
                }
                defaultHighlightingStrategy = highlighter;
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                throw new HighlightingDefinitionInvalidException(string.Concat("Could not load mode definition file '", syntaxMode.FileName, "'.\n"), exception);
            }
            return(defaultHighlightingStrategy);
        }
		public static DefaultHighlightingStrategy Parse(DefaultHighlightingStrategy highlighter, SyntaxMode syntaxMode, XmlReader xmlReader)
		{
			if (syntaxMode == null)
				throw new ArgumentNullException("syntaxMode");
			if (xmlReader == null)
				throw new ArgumentNullException("xmlTextReader");
			try {
				List<ValidationEventArgs> errors = null;
				XmlReaderSettings settings = new XmlReaderSettings();
				Stream shemaStream = typeof(HighlightingDefinitionParser).Assembly.GetManifestResourceStream("ICSharpCode.TextEditor.Resources.Mode.xsd");
				settings.Schemas.Add(null, new XmlTextReader(shemaStream));
				settings.Schemas.ValidationEventHandler += delegate(object sender, ValidationEventArgs args) {
					if (errors == null) {
						errors = new List<ValidationEventArgs>();
					}
					errors.Add(args);
				};
				settings.ValidationType = ValidationType.Schema;
				XmlReader validatingReader = XmlReader.Create(xmlReader, settings);

				XmlDocument doc = new XmlDocument();
				doc.Load(validatingReader);
				
				if (highlighter == null)
					highlighter = new DefaultHighlightingStrategy(doc.DocumentElement.Attributes["name"].InnerText);
				
				if (doc.DocumentElement.HasAttribute("extends")) {
					KeyValuePair<SyntaxMode, ISyntaxModeFileProvider> entry = HighlightingManager.Manager.FindHighlighterEntry(doc.DocumentElement.GetAttribute("extends"));
					if (entry.Key == null) {
						throw new HighlightingDefinitionInvalidException("Cannot find referenced highlighting source " + doc.DocumentElement.GetAttribute("extends"));
					} else {
						highlighter = Parse(highlighter, entry.Key, entry.Value.GetSyntaxModeFile(entry.Key));
						if (highlighter == null) return null;
					}
				}
				if (doc.DocumentElement.HasAttribute("extensions")) {
					highlighter.Extensions = doc.DocumentElement.GetAttribute("extensions").Split(new char[] { ';', '|' });
				}
				
				XmlElement environment = doc.DocumentElement["Environment"];
				if (environment != null) {
					foreach (XmlNode node in environment.ChildNodes) {
						if (node is XmlElement) {
							XmlElement el = (XmlElement)node;
							if (el.Name == "Custom") {
								highlighter.SetColorFor(el.GetAttribute("name"), el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el));
							} else {
								highlighter.SetColorFor(el.Name, el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el));
							}
						}
					}
				}
				
				// parse properties
				if (doc.DocumentElement["Properties"]!= null) {
					foreach (XmlElement propertyElement in doc.DocumentElement["Properties"].ChildNodes) {
						highlighter.Properties[propertyElement.Attributes["name"].InnerText] =  propertyElement.Attributes["value"].InnerText;
					}
				}
				
				if (doc.DocumentElement["Digits"]!= null) {
					highlighter.DigitColor = new HighlightColor(doc.DocumentElement["Digits"]);
				}
				
				XmlNodeList nodes = doc.DocumentElement.GetElementsByTagName("RuleSet");
				foreach (XmlElement element in nodes) {
					highlighter.AddRuleSet(new HighlightRuleSet(element));
				}
				
				xmlReader.Close();
				
				if (errors != null) {
					StringBuilder msg = new StringBuilder();
					foreach (ValidationEventArgs args in errors) {
						msg.AppendLine(args.Message);
					}
					throw new HighlightingDefinitionInvalidException(msg.ToString());
				} else {
					return highlighter;
				}
			} catch (Exception e) {
				throw new HighlightingDefinitionInvalidException("Could not load mode definition file '" + syntaxMode.FileName + "'.\n", e);
			}
		}
        public static DefaultHighlightingStrategy Parse(SyntaxMode syntaxMode, XmlTextReader xmlTextReader)
        {
            try {
                XmlValidatingReader validatingReader = new XmlValidatingReader(xmlTextReader);
                Stream shemaStream = Assembly.GetCallingAssembly().GetManifestResourceStream("Mode.xsd");
                validatingReader.Schemas.Add("", new XmlTextReader(shemaStream));
                validatingReader.ValidationType          = ValidationType.Schema;
                validatingReader.ValidationEventHandler += new ValidationEventHandler(ValidationHandler);


                XmlDocument doc = new XmlDocument();
                doc.Load(validatingReader);

                DefaultHighlightingStrategy highlighter = new DefaultHighlightingStrategy(doc.DocumentElement.Attributes["name"].InnerText);

                if (doc.DocumentElement.Attributes["extensions"] != null)
                {
                    highlighter.Extensions = doc.DocumentElement.Attributes["extensions"].InnerText.Split(new char[] { ';', '|' });
                }

                XmlElement environment = doc.DocumentElement["Environment"];
                if (environment != null)
                {
                    foreach (XmlNode node in environment.ChildNodes)
                    {
                        if (node is XmlElement)
                        {
                            XmlElement el = (XmlElement)node;
                            highlighter.SetColorFor(el.Name, el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el));
                        }
                    }
                }

                // parse properties
                if (doc.DocumentElement["Properties"] != null)
                {
                    foreach (XmlElement propertyElement in doc.DocumentElement["Properties"].ChildNodes)
                    {
                        highlighter.Properties[propertyElement.Attributes["name"].InnerText] = propertyElement.Attributes["value"].InnerText;
                    }
                }

                if (doc.DocumentElement["Digits"] != null)
                {
                    highlighter.DigitColor = new HighlightColor(doc.DocumentElement["Digits"]);
                }

                XmlNodeList nodes = doc.DocumentElement.GetElementsByTagName("RuleSet");
                foreach (XmlElement element in nodes)
                {
                    highlighter.AddRuleSet(new HighlightRuleSet(element));
                }

                xmlTextReader.Close();

                if (errors != null)
                {
                    ReportErrors(syntaxMode.FileName);
                    errors = null;
                    return(null);
                }
                else
                {
                    return(highlighter);
                }
            } catch (Exception e) {
                MessageBox.Show("Could not load mode definition file.\n" + e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                return(null);
            }
        }
示例#21
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AIScriptEditor));
     //ICSharpCode.TextEditor.Document.DefaultDocument defaultDocument1 = new ICSharpCode.TextEditor.Document.DefaultDocument();
     ICSharpCode.TextEditor.Document.DefaultFormattingStrategy defaultFormattingStrategy1 = new ICSharpCode.TextEditor.Document.DefaultFormattingStrategy();
     ICSharpCode.TextEditor.Document.DefaultHighlightingStrategy defaultHighlightingStrategy1 = new ICSharpCode.TextEditor.Document.DefaultHighlightingStrategy();
     ICSharpCode.TextEditor.Document.GapTextBufferStrategy gapTextBufferStrategy1 = new ICSharpCode.TextEditor.Document.GapTextBufferStrategy();
     ICSharpCode.TextEditor.Document.DefaultTextEditorProperties defaultTextEditorProperties1 = new ICSharpCode.TextEditor.Document.DefaultTextEditorProperties();
     this.editorContext = new System.Windows.Forms.ContextMenu();
     this.mnuCollapseAll = new System.Windows.Forms.MenuItem();
     this.mnuExpandAll = new System.Windows.Forms.MenuItem();
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this.mnuScriptHelp = new System.Windows.Forms.MenuItem();
     this.openFile = new System.Windows.Forms.OpenFileDialog();
     this.saveFile = new System.Windows.Forms.SaveFileDialog();
     this.pnlActionsNodes = new System.Windows.Forms.Panel();
     this.pnlNodes = new System.Windows.Forms.Panel();
     this.dgNodes = new System.Windows.Forms.DataGrid();
     this.spltActions = new System.Windows.Forms.Splitter();
     this.dgActions = new System.Windows.Forms.DataGrid();
     this.spltActionsNodes = new System.Windows.Forms.Splitter();
     this.imgToolbar = new System.Windows.Forms.ImageList(this.components);
     this.pnlEditor = new System.Windows.Forms.Panel();
     this.pnlScriptEditor = new System.Windows.Forms.Panel();
     this.pnlPadding = new System.Windows.Forms.Panel();
     this.scriptEditor = new ICSharpCode.TextEditor.TextEditorControl();
     this.tbEditor = new System.Windows.Forms.ToolBar();
     this.tbOpen = new System.Windows.Forms.ToolBarButton();
     this.tbNew = new System.Windows.Forms.ToolBarButton();
     this.tbSave = new System.Windows.Forms.ToolBarButton();
     this.tbSaveSplitSep = new System.Windows.Forms.ToolBarButton();
     this.tbScriptHelp = new System.Windows.Forms.ToolBarButton();
     this.tbSplit = new System.Windows.Forms.ToolBarButton();
     this.tbValidateExpandSep = new System.Windows.Forms.ToolBarButton();
     this.tbExpand = new System.Windows.Forms.ToolBarButton();
     this.spltDetails = new System.Windows.Forms.Splitter();
     this.pnlOutput = new System.Windows.Forms.Panel();
     this.lstOutput = new System.Windows.Forms.ListView();
     this.chLine = new System.Windows.Forms.ColumnHeader();
     this.chMessage = new System.Windows.Forms.ColumnHeader();
     this.imgCompletion = new System.Windows.Forms.ImageList(this.components);
     this.tbValidate = new System.Windows.Forms.ToolBarButton();
     this.pnlActionsNodes.SuspendLayout();
     this.pnlNodes.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dgNodes)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dgActions)).BeginInit();
     this.pnlEditor.SuspendLayout();
     this.pnlScriptEditor.SuspendLayout();
     this.pnlPadding.SuspendLayout();
     this.pnlOutput.SuspendLayout();
     this.SuspendLayout();
     //
     // editorContext
     //
     this.editorContext.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.mnuCollapseAll,
     this.mnuExpandAll,
     this.menuItem1,
     this.mnuScriptHelp});
     //
     // mnuCollapseAll
     //
     this.mnuCollapseAll.Index = 0;
     this.mnuCollapseAll.Text = "Collapse All";
     this.mnuCollapseAll.Click += new System.EventHandler(this.mnuCollapseAll_Click);
     //
     // mnuExpandAll
     //
     this.mnuExpandAll.Index = 1;
     this.mnuExpandAll.Text = "Expand All";
     this.mnuExpandAll.Click += new System.EventHandler(this.mnuExpandAll_Click);
     //
     // menuItem1
     //
     this.menuItem1.Index = 2;
     this.menuItem1.Text = "-";
     //
     // mnuScriptHelp
     //
     this.mnuScriptHelp.Index = 3;
     this.mnuScriptHelp.Text = "Script Help";
     this.mnuScriptHelp.Click += new System.EventHandler(this.mnuScriptHelp_Click);
     //
     // pnlActionsNodes
     //
     this.pnlActionsNodes.Controls.Add(this.pnlNodes);
     this.pnlActionsNodes.Controls.Add(this.spltActions);
     this.pnlActionsNodes.Controls.Add(this.dgActions);
     this.pnlActionsNodes.Dock = System.Windows.Forms.DockStyle.Left;
     this.pnlActionsNodes.Location = new System.Drawing.Point(0, 0);
     this.pnlActionsNodes.Name = "pnlActionsNodes";
     this.pnlActionsNodes.Size = new System.Drawing.Size(336, 552);
     this.pnlActionsNodes.TabIndex = 0;
     //
     // pnlNodes
     //
     this.pnlNodes.Controls.Add(this.dgNodes);
     this.pnlNodes.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pnlNodes.Location = new System.Drawing.Point(0, 252);
     this.pnlNodes.Name = "pnlNodes";
     this.pnlNodes.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0);
     this.pnlNodes.Size = new System.Drawing.Size(336, 300);
     this.pnlNodes.TabIndex = 2;
     //
     // dgNodes
     //
     this.dgNodes.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.dgNodes.CaptionBackColor = System.Drawing.Color.Beige;
     this.dgNodes.CaptionForeColor = System.Drawing.Color.Black;
     this.dgNodes.CaptionText = "Nodes";
     this.dgNodes.DataMember = "";
     this.dgNodes.Dock = System.Windows.Forms.DockStyle.Fill;
     this.dgNodes.HeaderBackColor = System.Drawing.Color.Beige;
     this.dgNodes.HeaderForeColor = System.Drawing.SystemColors.ControlText;
     this.dgNodes.Location = new System.Drawing.Point(0, 2);
     this.dgNodes.Name = "dgNodes";
     this.dgNodes.ReadOnly = true;
     this.dgNodes.Size = new System.Drawing.Size(336, 298);
     this.dgNodes.TabIndex = 0;
     this.dgNodes.TabStop = false;
     //
     // spltActions
     //
     this.spltActions.BackColor = System.Drawing.Color.Beige;
     this.spltActions.Dock = System.Windows.Forms.DockStyle.Top;
     this.spltActions.Location = new System.Drawing.Point(0, 248);
     this.spltActions.Name = "spltActions";
     this.spltActions.Size = new System.Drawing.Size(336, 4);
     this.spltActions.TabIndex = 1;
     this.spltActions.TabStop = false;
     //
     // dgActions
     //
     this.dgActions.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.dgActions.CaptionBackColor = System.Drawing.Color.Beige;
     this.dgActions.CaptionForeColor = System.Drawing.Color.Black;
     this.dgActions.CaptionText = "Actions";
     this.dgActions.DataMember = "";
     this.dgActions.Dock = System.Windows.Forms.DockStyle.Top;
     this.dgActions.HeaderBackColor = System.Drawing.Color.Beige;
     this.dgActions.HeaderForeColor = System.Drawing.SystemColors.ControlText;
     this.dgActions.Location = new System.Drawing.Point(0, 0);
     this.dgActions.Name = "dgActions";
     this.dgActions.ReadOnly = true;
     this.dgActions.Size = new System.Drawing.Size(336, 248);
     this.dgActions.TabIndex = 0;
     this.dgActions.TabStop = false;
     //
     // spltActionsNodes
     //
     this.spltActionsNodes.BackColor = System.Drawing.Color.Beige;
     this.spltActionsNodes.Location = new System.Drawing.Point(336, 0);
     this.spltActionsNodes.Name = "spltActionsNodes";
     this.spltActionsNodes.Size = new System.Drawing.Size(4, 552);
     this.spltActionsNodes.TabIndex = 1;
     this.spltActionsNodes.TabStop = false;
     //
     // imgToolbar
     //
     this.imgToolbar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgToolbar.ImageStream")));
     this.imgToolbar.TransparentColor = System.Drawing.Color.Transparent;
     this.imgToolbar.Images.SetKeyName(0, "");
     this.imgToolbar.Images.SetKeyName(1, "");
     this.imgToolbar.Images.SetKeyName(2, "");
     this.imgToolbar.Images.SetKeyName(3, "");
     this.imgToolbar.Images.SetKeyName(4, "");
     this.imgToolbar.Images.SetKeyName(5, "");
     this.imgToolbar.Images.SetKeyName(6, "");
     this.imgToolbar.Images.SetKeyName(7, "");
     this.imgToolbar.Images.SetKeyName(8, "");
     this.imgToolbar.Images.SetKeyName(9, "");
     this.imgToolbar.Images.SetKeyName(10, "");
     this.imgToolbar.Images.SetKeyName(11, "");
     //
     // pnlEditor
     //
     this.pnlEditor.Controls.Add(this.pnlScriptEditor);
     this.pnlEditor.Controls.Add(this.spltDetails);
     this.pnlEditor.Controls.Add(this.pnlOutput);
     this.pnlEditor.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pnlEditor.Location = new System.Drawing.Point(340, 0);
     this.pnlEditor.Name = "pnlEditor";
     this.pnlEditor.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0);
     this.pnlEditor.Size = new System.Drawing.Size(412, 552);
     this.pnlEditor.TabIndex = 5;
     //
     // pnlScriptEditor
     //
     this.pnlScriptEditor.Controls.Add(this.pnlPadding);
     this.pnlScriptEditor.Controls.Add(this.tbEditor);
     this.pnlScriptEditor.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pnlScriptEditor.Location = new System.Drawing.Point(0, 4);
     this.pnlScriptEditor.Name = "pnlScriptEditor";
     this.pnlScriptEditor.Padding = new System.Windows.Forms.Padding(3);
     this.pnlScriptEditor.Size = new System.Drawing.Size(412, 444);
     this.pnlScriptEditor.TabIndex = 7;
     //
     // pnlPadding
     //
     this.pnlPadding.Controls.Add(this.scriptEditor);
     this.pnlPadding.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pnlPadding.Location = new System.Drawing.Point(3, 43);
     this.pnlPadding.Name = "pnlPadding";
     this.pnlPadding.Padding = new System.Windows.Forms.Padding(2);
     this.pnlPadding.Size = new System.Drawing.Size(406, 398);
     this.pnlPadding.TabIndex = 6;
     //
     // scriptEditor
     //
     this.scriptEditor.AllowDrop = true;
     this.scriptEditor.BackColor = System.Drawing.Color.Beige;
     this.scriptEditor.ContextMenu = this.editorContext;
     this.scriptEditor.Dock = System.Windows.Forms.DockStyle.Fill;
     //defaultDocument1.FormattingStrategy = defaultFormattingStrategy1;
     defaultHighlightingStrategy1.Extensions = new string[0];
     //defaultDocument1.HighlightingStrategy = defaultHighlightingStrategy1;
     //defaultDocument1.ReadOnly = false;
     //defaultDocument1.TextBufferStrategy = gapTextBufferStrategy1;
     //defaultDocument1.TextContent = "";
     defaultTextEditorProperties1.AllowCaretBeyondEOL = false;
     defaultTextEditorProperties1.AutoInsertCurlyBracket = true;
     defaultTextEditorProperties1.BracketMatchingStyle = ICSharpCode.TextEditor.Document.BracketMatchingStyle.After;
     defaultTextEditorProperties1.ConvertTabsToSpaces = false;
     defaultTextEditorProperties1.CreateBackupCopy = false;
     defaultTextEditorProperties1.DocumentSelectionMode = ICSharpCode.TextEditor.Document.DocumentSelectionMode.Normal;
     defaultTextEditorProperties1.EnableFolding = true;
     defaultTextEditorProperties1.Encoding = ((System.Text.Encoding)(resources.GetObject("defaultTextEditorProperties1.Encoding")));
     defaultTextEditorProperties1.Font = new System.Drawing.Font("Courier New", 10F);
     defaultTextEditorProperties1.HideMouseCursor = false;
     defaultTextEditorProperties1.IndentStyle = ICSharpCode.TextEditor.Document.IndentStyle.Smart;
     defaultTextEditorProperties1.IsIconBarVisible = false;
     defaultTextEditorProperties1.LineTerminator = "\r\n";
     defaultTextEditorProperties1.LineViewerStyle = ICSharpCode.TextEditor.Document.LineViewerStyle.None;
     defaultTextEditorProperties1.MouseWheelScrollDown = true;
     defaultTextEditorProperties1.MouseWheelTextZoom = true;
     defaultTextEditorProperties1.ShowEOLMarker = true;
     defaultTextEditorProperties1.ShowHorizontalRuler = false;
     defaultTextEditorProperties1.ShowInvalidLines = true;
     defaultTextEditorProperties1.ShowLineNumbers = true;
     defaultTextEditorProperties1.ShowMatchingBracket = true;
     defaultTextEditorProperties1.ShowSpaces = true;
     defaultTextEditorProperties1.ShowTabs = true;
     defaultTextEditorProperties1.ShowVerticalRuler = true;
     defaultTextEditorProperties1.TabIndent = 4;
     defaultTextEditorProperties1.UseAntiAliasedFont = false;
     defaultTextEditorProperties1.UseCustomLine = false;
     defaultTextEditorProperties1.VerticalRulerRow = 80;
     //defaultDocument1.TextEditorProperties = defaultTextEditorProperties1;
     //this.scriptEditor.Document = defaultDocument1;
     this.scriptEditor.Encoding = ((System.Text.Encoding)(resources.GetObject("scriptEditor.Encoding")));
     this.scriptEditor.IsIconBarVisible = false;
     this.scriptEditor.Location = new System.Drawing.Point(2, 2);
     this.scriptEditor.Name = "scriptEditor";
     this.scriptEditor.ShowEOLMarkers = true;
     this.scriptEditor.ShowSpaces = true;
     this.scriptEditor.ShowTabs = true;
     this.scriptEditor.ShowVRuler = true;
     this.scriptEditor.Size = new System.Drawing.Size(402, 394);
     this.scriptEditor.TabIndex = 2;
     this.scriptEditor.TextEditorProperties = defaultTextEditorProperties1;
     //
     // tbEditor
     //
     this.tbEditor.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
     this.tbEditor.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
     this.tbOpen,
     this.tbNew,
     this.tbSave,
     this.tbSaveSplitSep,
     this.tbScriptHelp,
     this.tbSplit,
     this.tbValidateExpandSep,
     this.tbExpand,
     this.tbValidate});
     this.tbEditor.Divider = false;
     this.tbEditor.DropDownArrows = true;
     this.tbEditor.ImageList = this.imgToolbar;
     this.tbEditor.Location = new System.Drawing.Point(3, 3);
     this.tbEditor.Name = "tbEditor";
     this.tbEditor.ShowToolTips = true;
     this.tbEditor.Size = new System.Drawing.Size(406, 40);
     this.tbEditor.TabIndex = 5;
     //
     // tbOpen
     //
     this.tbOpen.ImageIndex = 0;
     this.tbOpen.Name = "tbOpen";
     this.tbOpen.Text = "Open";
     this.tbOpen.ToolTipText = "Open File";
     //
     // tbNew
     //
     this.tbNew.ImageIndex = 3;
     this.tbNew.Name = "tbNew";
     this.tbNew.Text = "New";
     this.tbNew.ToolTipText = "New Script";
     //
     // tbSave
     //
     this.tbSave.ImageIndex = 1;
     this.tbSave.Name = "tbSave";
     this.tbSave.Text = "Save";
     this.tbSave.ToolTipText = "Save File";
     //
     // tbSaveSplitSep
     //
     this.tbSaveSplitSep.Name = "tbSaveSplitSep";
     this.tbSaveSplitSep.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbScriptHelp
     //
     this.tbScriptHelp.ImageIndex = 11;
     this.tbScriptHelp.Name = "tbScriptHelp";
     this.tbScriptHelp.Text = "Help";
     this.tbScriptHelp.ToolTipText = "Script Help";
     //
     // tbSplit
     //
     this.tbSplit.ImageIndex = 2;
     this.tbSplit.Name = "tbSplit";
     this.tbSplit.Text = "Split";
     this.tbSplit.ToolTipText = "Split View";
     //
     // tbValidateExpandSep
     //
     this.tbValidateExpandSep.Name = "tbValidateExpandSep";
     this.tbValidateExpandSep.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbExpand
     //
     this.tbExpand.ImageIndex = 10;
     this.tbExpand.Name = "tbExpand";
     this.tbExpand.Text = "Collapse";
     this.tbExpand.ToolTipText = "Expand / Collapse";
     //
     // spltDetails
     //
     this.spltDetails.BackColor = System.Drawing.Color.Beige;
     this.spltDetails.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.spltDetails.Location = new System.Drawing.Point(0, 448);
     this.spltDetails.Name = "spltDetails";
     this.spltDetails.Size = new System.Drawing.Size(412, 4);
     this.spltDetails.TabIndex = 6;
     this.spltDetails.TabStop = false;
     //
     // pnlOutput
     //
     this.pnlOutput.Controls.Add(this.lstOutput);
     this.pnlOutput.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.pnlOutput.Location = new System.Drawing.Point(0, 452);
     this.pnlOutput.Name = "pnlOutput";
     this.pnlOutput.Size = new System.Drawing.Size(412, 100);
     this.pnlOutput.TabIndex = 5;
     //
     // lstOutput
     //
     this.lstOutput.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     this.chLine,
     this.chMessage});
     this.lstOutput.Dock = System.Windows.Forms.DockStyle.Fill;
     this.lstOutput.GridLines = true;
     this.lstOutput.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
     this.lstOutput.Location = new System.Drawing.Point(0, 0);
     this.lstOutput.Name = "lstOutput";
     this.lstOutput.Size = new System.Drawing.Size(412, 100);
     this.lstOutput.TabIndex = 0;
     this.lstOutput.TabStop = false;
     this.lstOutput.UseCompatibleStateImageBehavior = false;
     this.lstOutput.View = System.Windows.Forms.View.Details;
     //
     // chLine
     //
     this.chLine.Text = "Line";
     //
     // chMessage
     //
     this.chMessage.Text = "Message";
     this.chMessage.Width = 400;
     //
     // imgCompletion
     //
     this.imgCompletion.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgCompletion.ImageStream")));
     this.imgCompletion.TransparentColor = System.Drawing.Color.Transparent;
     this.imgCompletion.Images.SetKeyName(0, "");
     //
     // tbValidate
     //
     this.tbValidate.ImageIndex = 4;
     this.tbValidate.Name = "tbValidate";
     this.tbValidate.Text = "Validate";
     this.tbValidate.ToolTipText = "Validate Script";
     //
     // AIScriptEditor
     //
     this.Controls.Add(this.pnlEditor);
     this.Controls.Add(this.spltActionsNodes);
     this.Controls.Add(this.pnlActionsNodes);
     this.Name = "AIScriptEditor";
     this.Size = new System.Drawing.Size(752, 552);
     this.pnlActionsNodes.ResumeLayout(false);
     this.pnlNodes.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.dgNodes)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dgActions)).EndInit();
     this.pnlEditor.ResumeLayout(false);
     this.pnlScriptEditor.ResumeLayout(false);
     this.pnlScriptEditor.PerformLayout();
     this.pnlPadding.ResumeLayout(false);
     this.pnlOutput.ResumeLayout(false);
     this.ResumeLayout(false);
 }