/
GCController+Notifications.xml
249 lines (235 loc) · 12.9 KB
/
GCController+Notifications.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<Type Name="GCController+Notifications" FullName="GameController.GCController+Notifications">
<TypeSignature Language="C#" Value="public static class GCController.Notifications" />
<TypeSignature Language="ILAsm" Value=".class nested public auto ansi abstract sealed beforefieldinit GCController/Notifications extends System.Object" />
<TypeSignature Language="DocId" Value="T:GameController.GCController.Notifications" />
<TypeSignature Language="F#" Value="type GCController.Notifications = class" />
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Notification posted by the <see cref="T:GameController.GCController" /> class.</summary>
<remarks>
<para>This is a static class which contains various helper methods that allow developers to observe events posted in the iOS notification hub (<see cref="T:Foundation.NSNotificationCenter" />).</para>
<para>The methods defined in this class post events invoke the provided method or lambda with a <see cref="T:Foundation.NSNotificationEventArgs" /> parameter which contains strongly typed properties for the notification arguments.</para>
</remarks>
</Docs>
<Members>
<Member MemberName="ObserveDidConnect">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidConnect (EventHandler<Foundation.NSNotificationEventArgs> handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidConnect(class System.EventHandler`1<class Foundation.NSNotificationEventArgs> handler) cil managed" />
<MemberSignature Language="DocId" Value="M:GameController.GCController.Notifications.ObserveDidConnect(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidConnect : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject" Usage="GameController.GCController.Notifications.ObserveDidConnect handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler<Foundation.NSNotificationEventArgs>" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:GameController.GCController.DidConnectNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = GCController.Notifications.ObserveDidConnect ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = GCController.Notifications.ObserveDidConnect (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidConnect">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidConnect (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidConnect(class Foundation.NSObject objectToObserve, class System.EventHandler`1<class Foundation.NSNotificationEventArgs> handler) cil managed" />
<MemberSignature Language="DocId" Value="M:GameController.GCController.Notifications.ObserveDidConnect(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidConnect : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject" Usage="GameController.GCController.Notifications.ObserveDidConnect (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler<Foundation.NSNotificationEventArgs>" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:GameController.GCController.DidConnectNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:GameController.GCController.DidConnectNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = GCController.Notifications.ObserveDidConnect ((notification) => {
Console.WriteLine ("Observed DidConnectNotification!");
};
// Listen to all notifications posted for a single object
var token = GCController.Notifications.ObserveDidConnect (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidConnectNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidDisconnect">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidDisconnect (EventHandler<Foundation.NSNotificationEventArgs> handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidDisconnect(class System.EventHandler`1<class Foundation.NSNotificationEventArgs> handler) cil managed" />
<MemberSignature Language="DocId" Value="M:GameController.GCController.Notifications.ObserveDidDisconnect(System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidDisconnect : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject" Usage="GameController.GCController.Notifications.ObserveDidDisconnect handler" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="handler" Type="System.EventHandler<Foundation.NSNotificationEventArgs>" />
</Parameters>
<Docs>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:GameController.GCController.DidDisconnectNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para>The following example shows how you can use this method in your code</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// Lambda style
//
// listening
notification = GCController.Notifications.ObserveDidDisconnect ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = GCController.Notifications.ObserveDidDisconnect (Callback);
}
void Teardown ()
{
notification.Dispose ();
}]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName="ObserveDidDisconnect">
<MemberSignature Language="C#" Value="public static Foundation.NSObject ObserveDidDisconnect (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Foundation.NSObject ObserveDidDisconnect(class Foundation.NSObject objectToObserve, class System.EventHandler`1<class Foundation.NSNotificationEventArgs> handler) cil managed" />
<MemberSignature Language="DocId" Value="M:GameController.GCController.Notifications.ObserveDidDisconnect(Foundation.NSObject,System.EventHandler{Foundation.NSNotificationEventArgs})" />
<MemberSignature Language="F#" Value="static member ObserveDidDisconnect : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject" Usage="GameController.GCController.Notifications.ObserveDidDisconnect (objectToObserve, handler)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Foundation.NSObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="objectToObserve" Type="Foundation.NSObject" />
<Parameter Name="handler" Type="System.EventHandler<Foundation.NSNotificationEventArgs>" />
</Parameters>
<Docs>
<param name="objectToObserve">The object to observe.</param>
<param name="handler">Method to invoke when the notification is posted.</param>
<summary>Strongly typed notification for the <see cref="P:GameController.GCController.DidDisconnectNotification" /> constant.</summary>
<returns>Token object that can be used to stop receiving notifications by either disposing it or passing it to <see cref="M:Foundation.NSNotificationCenter.RemoveObservers(System.Collections.Generic.IEnumerable{Foundation.NSObject})" /></returns>
<remarks>
<para id="tool-remark">This method can be used to subscribe for <see cref="P:GameController.GCController.DidDisconnectNotification" /> notifications.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
// Listen to all notifications posted for any object
var token = GCController.Notifications.ObserveDidDisconnect ((notification) => {
Console.WriteLine ("Observed DidDisconnectNotification!");
};
// Listen to all notifications posted for a single object
var token = GCController.Notifications.ObserveDidDisconnect (objectToObserve, (notification) => {
Console.WriteLine ($"Observed DidDisconnectNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
]]></code>
</example>
</remarks>
</Docs>
</Member>
</Members>
</Type>