Click here to Skip to main content
12,634,117 members (23,794 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads

Stats

92.9K views
5.6K downloads
81 bookmarked
Posted

CodeDom Assistant

, 21 Sep 2007
Generating CodeDom Code By Parsing C# or VB
CodeDomAssistant_Demo
CodeDomAssistant.exe
ICSharpCode.NRefactory.dll
RemoteLoader.dll
SciLexer.dll
ScintillaNet.dll
sln.CodeDomAssistant
CodeDomAssistant
bin
Debug
SciLexer.dll
Properties
NRefactory
NRefactoryASTGenerator
AST
Project
Configuration
Resources
ICSharpCode.NRefactory.snk
Src
Ast
General
Lexer
BuildKeywords.pl
CSharp
Special
VBNet
Parser
CSharp
cs.ATG
Frames
Parser.frame
Scanner.frame
SharpCoco.exe
VBNet
VBNET.ATG
PrettyPrinter
CSharp
VBNet
Visitors
Test
General
Lexer
CSharp
VBNet
Output
CodeDOM
CSharp
VBNet
Parser
Expressions
GlobalScope
Statements
TypeLevel
RemoteLoader
Properties
ScintillaNET
Configuration
Builtin
LexerKeywordListNames
LexerStyleNames
FindReplace
Printing
Properties
Resources
DeleteHS.png
GoToNextMessage - Copy.png
GoToNextMessage.png
GoToPreviousMessage.png
LineColorHS.png
Thumbs.db
ScintillaNET.csproj.vspscc
Snippets
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Drawing;

namespace ScintillaNet
{
	[TypeConverterAttribute(typeof(System.ComponentModel.ExpandableObjectConverter))]
	public class HotspotStyle : ScintillaHelperBase
	{
		internal HotspotStyle(Scintilla scintilla) : base(scintilla) 
		{
			ActiveForeColor = SystemColors.HotTrack;
			ActiveBackColor = SystemColors.Window;
		}

		internal bool ShouldSerialize()
		{
			return ShouldSerializeActiveBackColor() || 
				ShouldSerializeActiveForeColor() ||
				ShouldSerializeActiveUnderline() ||
				ShouldSerializeSingleLine() ||
				ShouldSerializeUseActiveBackColor() ||
				ShouldSerializeUseActiveForeColor();
		}

		#region ActiveFore
		public Color ActiveForeColor
		{
			get
			{
				if (Scintilla.ColorBag.ContainsKey("HotspotStyle.ActiveForeColor"))
					return Scintilla.ColorBag["HotspotStyle.ActiveForeColor"];

				return Utilities.RgbToColor(NativeScintilla.GetHotSpotActiveFore());
			}
			set
			{
				if (value.IsKnownColor)
					Scintilla.ColorBag["HotspotStyle.ActiveForeColor"] = value;
				else
					Scintilla.ColorBag.Remove("HotspotStyle.ActiveForeColor");

				NativeScintilla.SetHotspotActiveFore(_useActiveForeColor, Utilities.ColorToRgb(value));
			}
		}

		private bool ShouldSerializeActiveForeColor()
		{
			return ActiveForeColor != SystemColors.HotTrack;
		}

		private void ResetActiveForeColor()
		{
			ActiveForeColor = SystemColors.HotTrack;
		}

		#endregion

		#region ActiveBack
		public Color ActiveBackColor
		{
			get
			{
				if (Scintilla.ColorBag.ContainsKey("HotspotStyle.ActiveBackColor"))
					return Scintilla.ColorBag["HotspotStyle.ActiveBackColor"];

				return Utilities.RgbToColor(NativeScintilla.GetHotSpotActiveBack());
			}
			set
			{
				if (value.IsKnownColor)
					Scintilla.ColorBag["HotspotStyle.ActiveBackColor"] = value;
				else
					Scintilla.ColorBag.Remove("HotspotStyle.ActiveBackColor");

				NativeScintilla.SetHotspotActiveBack(_useActiveBackColor, Utilities.ColorToRgb(value));
			}
		}

		private bool ShouldSerializeActiveBackColor()
		{
			return ActiveBackColor != SystemColors.Window;
		}

		private void ResetActiveBackColor()
		{
			ActiveBackColor = SystemColors.Window;
		}

		#endregion

		#region ActiveUnderline
		public bool ActiveUnderline
		{
			get
			{
				return NativeScintilla.GetHotSpotActiveUnderline();
			}
			set
			{
				NativeScintilla.SetHotspotActiveUnderline(value);
			}
		}

		private bool ShouldSerializeActiveUnderline()
		{
			return !ActiveUnderline;
		}

		private void ResetActiveUnderline()
		{
			ActiveUnderline = true;
		}

		#endregion

		#region SingleLine
		public bool SingleLine
		{
			get
			{
				return NativeScintilla.GetHotSpotSingleLine();
			}
			set
			{
				NativeScintilla.SetHotspotSingleLine(value);
			}
		}

		private bool ShouldSerializeSingleLine()
		{
			return !SingleLine;
		}

		private void ResetSingleLine()
		{
			SingleLine = true;
		}

		#endregion

		#region UseActiveForeColor
		private bool _useActiveForeColor = true;
		public bool UseActiveForeColor
		{
			get
			{
				return _useActiveForeColor;
			}
			set
			{
				_useActiveForeColor = value;
			}
		}

		private bool ShouldSerializeUseActiveForeColor()
		{
			return !UseActiveForeColor;
		}

		private void ResetUseActiveForeColor()
		{
			UseActiveForeColor = true;
		}

		#endregion

		#region UseActiveBackColor
		private bool _useActiveBackColor = true;
		public bool UseActiveBackColor
		{
			get
			{
				return _useActiveBackColor;
			}
			set
			{
				_useActiveBackColor = value;
			}
		}

		private bool ShouldSerializeUseActiveBackColor()
		{
			return !UseActiveBackColor;
		}

		private void ResetUseActiveBackColor()
		{
			UseActiveBackColor = true;
		}


		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

raygilbert
Web Developer
Australia Australia
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 21 Sep 2007
Article Copyright 2007 by raygilbert
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid