Прочитај на енглеском Уреди

Делите путем


Grammar.IsStg Property

Definition

Gets whether a grammar is strongly typed.

C#
protected internal virtual bool IsStg { get; }

Property Value

The IsStg property returns true if the grammar is strongly-typed; otherwise the property returns false.

Remarks

A strongly-typed Grammar object (IsStg equals true) can return strongly-typed results (objects, rather than raw text) to a client application. For example, a strongly-typed grammar might return DateTime objects rather than raw recognized input.

You can implement strongly-typed grammars by attaching code to the rules of a grammar. As a recognition engine processes any given rule, taking as input the current partial results, the associated code is executed and the textual information becomes rich type objects. This allows a client to more easily make use of enhanced semantic checking, support for multiple cultures, and internal grammar logic.

Instances of strongly-typed Grammar objects are typically obtained from resources in an assembly as a Type of the Common Language Runtime (CLR). The localized types used to support different languages are examples of such Grammar objects.

Notes to Inheritors

Strongly-typed grammars inheriting from Grammar need to override the default behavior of IsStg, which is to return false.

Applies to

Производ Верзије
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)