SrgsItem Constructors

Definition

Initializes a new instance of the SrgsItem class.

Overloads

SrgsItem()

Initializes a new instance of the SrgsItem class.

SrgsItem(Int32)

Initializes a new instance of the SrgsItem class and specifies the number of times that its contents must be spoken.

SrgsItem(SrgsElement[])

Initializes a new instance of the SrgsItem class and specifies an array of SrgsElement objects to add to this instance.

SrgsItem(String)

Initializes a new instance of the SrgsItem class and specifies its textual contents.

SrgsItem(Int32, Int32)

Initializes a new instance of the SrgsItem class and specifies minimum and maximum repetition counts.

SrgsItem(Int32, Int32, SrgsElement[])

Initializes a new instance of the SrgsItem class, specifies an array of SrgsElement objects to add to this instance, and sets minimum and maximum repetition counts.

SrgsItem(Int32, Int32, String)

Initializes a new instance of the SrgsItem class, specifies the text associated with the item, and specifies minimum and maximum repetition counts.

Remarks

This overloaded constructor for SrgsItem initializes the object with a default repeatCount property of 0.

SrgsItem()

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class.

C#
public SrgsItem ();

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SrgsItem(Int32)

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class and specifies the number of times that its contents must be spoken.

C#
public SrgsItem (int repeatCount);

Parameters

repeatCount
Int32

The number of times that the item must be spoken.

Exceptions

repeatCount is negative or is larger than 255.

Remarks

This constructor sets MaxRepeat and MinRepeat properties of the new SrgsItem to the value in repeatCount.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SrgsItem(SrgsElement[])

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class and specifies an array of SrgsElement objects to add to this instance.

C#
public SrgsItem (params System.Speech.Recognition.SrgsGrammar.SrgsElement[] elements);

Parameters

elements
SrgsElement[]

The array of objects to add to the SrgsItem instance.

Exceptions

elements is null.

Any member of the elements array is null.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SrgsItem(String)

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class and specifies its textual contents.

C#
public SrgsItem (string text);

Parameters

text
String

The text associated with the item.

Exceptions

text is null.

text is an empty string.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SrgsItem(Int32, Int32)

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class and specifies minimum and maximum repetition counts.

C#
public SrgsItem (int min, int max);

Parameters

min
Int32

The minimum number of times that the text in the item must be repeated.

max
Int32

The maximum number of times that the text in the item can be repeated.

Exceptions

min is negative or larger than 255.

max is negative or larger than 255.

min is larger than max.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SrgsItem(Int32, Int32, SrgsElement[])

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class, specifies an array of SrgsElement objects to add to this instance, and sets minimum and maximum repetition counts.

C#
public SrgsItem (int min, int max, params System.Speech.Recognition.SrgsGrammar.SrgsElement[] elements);

Parameters

min
Int32

The minimum number of times that the contents of the SrgsItem object must be repeated.

max
Int32

The maximum number of times that the contents of the SrgsItem object can be repeated.

elements
SrgsElement[]

The array of objects to add to the SrgsItem instance.

Exceptions

elements is null.

Any member of the elements array is null.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

SrgsItem(Int32, Int32, String)

Source:
SrgsItem.cs
Source:
SrgsItem.cs
Source:
SrgsItem.cs

Initializes a new instance of the SrgsItem class, specifies the text associated with the item, and specifies minimum and maximum repetition counts.

C#
public SrgsItem (int min, int max, string text);

Parameters

min
Int32

The minimum number of times that the item must be repeated.

max
Int32

The maximum number of times that the item can be repeated.

text
String

The text associated with the item.

Exceptions

min is negative or larger than 255.

max is negative or larger than 255.

min is larger than max.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)