Click or drag to resize

VisualBasicFormattingInfo Class

Provides formatting info for Visual Basic code.
Inheritance Hierarchy
SystemObject
  Ookii.FormatCVisualBasicFormattingInfo

Namespace:  Ookii.FormatC
Assembly:  Ookii.FormatC (in Ookii.FormatC.dll) Version: 2.1.0
Syntax
public class VisualBasicFormattingInfo : IFormattingInfo, 
	IMultilanguageFormattingInfo, IFormattingInfoWithTypes

The VisualBasicFormattingInfo type exposes the following members.

Constructors
  NameDescription
Public methodVisualBasicFormattingInfo
Initializes a new instance of the VisualBasicFormattingInfo class.
Top
Properties
  NameDescription
Public propertyCaseSensitive
Gets a value that indicates whether the language to be formatted is case sensitive.
Public propertyPatterns
Gets a list of regular expression patterns used to identify elements of the code.
Public propertyTypes
Gets or sets a list of identifiers that should be treated as type names.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSplitRegions
Splits the source code into language regions.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Visual Basic contains several keywords that are contextual keywords. For example, From is a keyword in a Linq expression, but not elsewhere, and you can still have variables named From without enclosing them in [].

Because of the limitations of regular expressions, the VisualBasicFormattingInfo cannot determine when a contextual keyword should be treated as a keyword and when it should be treated as a regular identifier. Because of this, it always treats them as keywords.

You can prefix an identifier that is also a contextual keyword with ` (e.g. `From) to prevent it from being highlighted as a keyword. The ` character will not appear in the formatted output, and the identifier will not be highlighted.

You can specify identifiers that should be colored as type names using the Types property. These identifiers will then always be formatted as type names (even in contexts where they are not). Like with contextual keywords, you can prefix an identifier with ` to prevent it from being highlighted as a type name.

XML literals are supported, however the XML literals must be marked explicitly with with [xml][/xml]. For example, this would look like this with a simple XML literal: Dim xmlLiteral = [xml]<Foo />[/xml].

The [xml][/xml] tags will not be included in the output, and the contents of those tags will be formatted as XML literals. Embedded expressions in XML literals (which are delimited by <%= %> blocks) are also supported, and the contents of embedded expressions will be formatted as Visual Basic code. However, due to the limitations of regular expressions, having an XML literal inside an embedded expression in another XML literal is not supported.

Thread Safety
Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.
See Also