-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
RecognitionEventArgs.xml
141 lines (125 loc) · 8.41 KB
/
RecognitionEventArgs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<Type Name="RecognitionEventArgs" FullName="System.Speech.Recognition.RecognitionEventArgs">
<TypeSignature Language="C#" Value="public abstract class RecognitionEventArgs : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit RecognitionEventArgs extends System.EventArgs" FrameworkAlternate="net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0" />
<TypeSignature Language="DocId" Value="T:System.Speech.Recognition.RecognitionEventArgs" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class RecognitionEventArgs
Inherits EventArgs" />
<TypeSignature Language="F#" Value="type RecognitionEventArgs = class
 inherit EventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class RecognitionEventArgs abstract : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract serializable beforefieldinit RecognitionEventArgs extends System.EventArgs" FrameworkAlternate="netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<AssemblyInfo>
<AssemblyName>System.Speech</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Serializable]</AttributeName>
<AttributeName Language="F#">[<System.Serializable>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides information about speech recognition events.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Speech.Recognition.RecognitionEventArgs.Result%2A> property obtains the recognition information as a <xref:System.Speech.Recognition.RecognitionResult> object. For more information about speech recognition events, see [Using Speech Recognition Events](https://msdn.microsoft.com/library/01c598ca-2e0e-4e89-b303-cd1cef9e8482).
**RecognitionEventArgs** is the base for the following classes:
- <xref:System.Speech.Recognition.SpeechRecognizedEventArgs>
- <xref:System.Speech.Recognition.SpeechRecognitionRejectedEventArgs>
- <xref:System.Speech.Recognition.SpeechHypothesizedEventArgs>
<xref:System.Speech.Recognition.RecognitionEventArgs> derives from <xref:System.EventArgs>.
## Examples
The following example attaches a handler for the <xref:System.Speech.Recognition.SpeechRecognitionEngine.SpeechHypothesized>, <xref:System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognized>, and <xref:System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognitionRejected> events of the speech recognizer. The event argument types for the three events all derive from <xref:System.Speech.Recognition.RecognitionEventArgs>, which is used as the event data parameter in the handler.
```csharp
// Initialize the speech recognizer.
private void Initialize(SpeechRecognitionEngine recognizer)
{
// Attach handlers for the SpeechHypothesized, SpeechRecognitionRejected,
// and SpeechRecognized events.
recognizer.SpeechHypothesized +=
new EventHandler<SpeechHypothesizedEventArgs>(DisplayResult);
recognizer.SpeechRecognitionRejected +=
new EventHandler<SpeechRecognitionRejectedEventArgs>(DisplayResult);
recognizer.SpeechRecognized +=
new EventHandler<SpeechRecognizedEventArgs>(DisplayResult);
// Add other initialization code here.
}
// Handle the SpeechHypothesized, SpeechRecognitionRejected,
// and SpeechRecognized events.
private void DisplayResult(object sender, RecognitionEventArgs e)
{
if (e is SpeechHypothesizedEventArgs)
{
Console.WriteLine("Speech hypothesized:");
}
else if (e is SpeechRecognitionRejectedEventArgs)
{
Console.WriteLine("Speech recognition rejected:");
}
else if (e is SpeechRecognizedEventArgs)
{
Console.WriteLine("Speech recognized:");
}
// Add code to handle the event.
}
```
]]></format>
</remarks>
<altmember cref="T:System.Speech.Recognition.RecognitionResult" />
<altmember cref="E:System.Speech.Recognition.Grammar.SpeechRecognized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognitionEngine.SpeechHypothesized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognitionRejected" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognizer.SpeechHypothesized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognizer.SpeechRecognitionRejected" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognizer.SpeechRecognized" />
</Docs>
<Members>
<Member MemberName="Result">
<MemberSignature Language="C#" Value="public System.Speech.Recognition.RecognitionResult Result { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Speech.Recognition.RecognitionResult Result" />
<MemberSignature Language="DocId" Value="P:System.Speech.Recognition.RecognitionEventArgs.Result" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Result As RecognitionResult" />
<MemberSignature Language="F#" Value="member this.Result : System.Speech.Recognition.RecognitionResult" Usage="System.Speech.Recognition.RecognitionEventArgs.Result" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Speech::Recognition::RecognitionResult ^ Result { System::Speech::Recognition::RecognitionResult ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Speech</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Speech.Recognition.RecognitionResult</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the recognition result data associated with the speech recognition event.</summary>
<value>The <see cref="P:System.Speech.Recognition.RecognitionEventArgs.Result" /> property returns the <see cref="T:System.Speech.Recognition.RecognitionResult" /> that contains the information about the recognition.</value>
<remarks>To be added.</remarks>
<altmember cref="T:System.Speech.Recognition.SpeechHypothesizedEventArgs" />
<altmember cref="T:System.Speech.Recognition.SpeechRecognitionRejectedEventArgs" />
<altmember cref="T:System.Speech.Recognition.SpeechRecognizedEventArgs" />
<altmember cref="E:System.Speech.Recognition.Grammar.SpeechRecognized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognitionEngine.SpeechHypothesized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognitionRejected" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognizer.SpeechHypothesized" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognizer.SpeechRecognitionRejected" />
<altmember cref="E:System.Speech.Recognition.SpeechRecognizer.SpeechRecognized" />
</Docs>
</Member>
</Members>
</Type>