| 1: | // OwnerStateCondition.cs | |
| 2: | // Copyright (C) 2002 Mike Krueger | |
| 3: | // | |
| 4: | // This program is free software; you can redistribute it and/or modify | |
| 5: | // it under the terms of the GNU General Public License as published by | |
| 6: | // the Free Software Foundation; either version 2 of the License, or | |
| 7: | // (at your option) any later version. | |
| 8: | // | |
| 9: | // This program is distributed in the hope that it will be useful, | |
| 10: | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11: | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 12: | // GNU General Public License for more details. | |
| 13: | // | |
| 14: | // You should have received a copy of the GNU General Public License | |
| 15: | // along with this program; if not, write to the Free Software | |
| 16: | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 17: | ||
| 18: | using System; | |
| 19: | using System.Xml; | |
| 20: | ||
| 21: | using Core.Util; | |
| 22: | using Core.AddIns.Conditions; | |
| 23: | using Core.AddIns; | |
| 24: | ||
| 25: | using SharpDevelop.Gui; | |
| 26: | using SharpDevelop.DefaultEditor.Gui.Editor; | |
| 27: | ||
| 28: | namespace SharpDevelop.DefaultEditor.Conditions { | |
| 29: | ||
| 30: | [ConditionAttribute()] | |
| 31: | public class TextContentCondition : AbstractCondition | |
| 32: | { | |
| 33: | [XmlMemberAttributeAttribute("textcontent", IsRequired = true)] | |
| 34: | string textcontent; | |
| 35: | ||
| 36: | public string TextContent { | |
| 37: | get { | |
| 38: | return textcontent; | |
| 39: | } | |
| 40: | set { | |
| 41: | textcontent = value; | |
| 42: | } | |
| 43: | } | |
| 44: | ||
| 45: | public override bool IsValid(object owner) | |
| 46: | { | |
| 47: | if (owner is TextAreaControl) { | |
| 48: | TextAreaControl ctrl = (TextAreaControl)owner; | |
| 49: | return textcontent == ctrl.Document.HighlightingStrategy.Name; | |
| 50: | } | |
| 51: | return false; | |
| 52: | } | |
| 53: | } | |
| 54: | } |
This page was automatically generated by SharpDevelop.