~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/monomac/docs/en/MonoMac.Foundation/NSUndoManager.xml

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        <Attribute>
31
31
          <AttributeName>MonoMac.Foundation.Export("init")</AttributeName>
32
32
        </Attribute>
 
33
        <Attribute>
 
34
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
 
35
        </Attribute>
33
36
      </Attributes>
34
37
      <Parameters />
35
38
      <Docs>
49
52
        <Attribute>
50
53
          <AttributeName>MonoMac.Foundation.Export("initWithCoder:")</AttributeName>
51
54
        </Attribute>
 
55
        <Attribute>
 
56
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
 
57
        </Attribute>
52
58
      </Attributes>
53
59
      <Parameters>
54
60
        <Parameter Name="coder" Type="MonoMac.Foundation.NSCoder" />
66
72
      <AssemblyInfo>
67
73
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
68
74
      </AssemblyInfo>
 
75
      <Attributes>
 
76
        <Attribute>
 
77
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
 
78
        </Attribute>
 
79
      </Attributes>
69
80
      <Parameters>
70
81
        <Parameter Name="t" Type="MonoMac.Foundation.NSObjectFlag" />
71
82
      </Parameters>
72
83
      <Docs>
73
84
        <param name="t">Unused sentinel value, pass NSObjectFlag.Empty.</param>
74
 
        <summary>Constructor to call on derived classes to skip initialization and merely allocate the object.</summary>
 
85
        <summary>Constructor to call on derived classes when the derived class has an [Export] constructor.</summary>
75
86
        <remarks>
76
 
          <para>This constructor should be called by derived classes when they completely construct the object in managed code and merely want the runtime to allocate and initialize the NSObject.   This is required to implement the two-step initialization process that Objective-C uses, the first step is to perform the object allocation, the second step is to initialize the object.   When you invoke the constructor that takes the NSObjectFlag.Empty you taking advatnage of a direct path that goes all the way up to NSObject to merely allocate the object's memory and bind the Objective-C and C# objects together.    The actual initialization of the object is up to you.</para>
77
 
          <para>This constructor is typically used by the binding generator to allocate the object, but prevent the actual initialization to take place.   Once the allocation has taken place, the constructor has to initialize the object.   With constructors generated by the binding generator this means that it manually invokes one of the "init" methods to initialize the object.</para>
78
 
          <para>It is your responsability to completely initialize the object if you chain up using the NSObjectFlag.Empty path.</para>
79
 
          <para>In general, if your constructors invokes the NSObjectFlag.Empty base implementation, then it should be calling an Objective-C init method.   If this is not the case, you should instead chain to the proper constructor in your class. </para>
80
 
          <para>The argument value is ignored and merely ensures that the only code that is executed is the construction phase is the basic NSObject allocation and runtime type registration.  Typically the chaining would look like this:</para>
 
87
          <para>This constructor should be called by derived classes when they are initialized using an [Export] attribute. The argument value is ignore, typically the chaining would look like this:</para>
81
88
          <example>
82
89
            <code lang="C#">
83
 
//
84
 
// The NSObjectFlag merely allocates the object and registers the
85
 
// C# class with the Objective-C runtime if necessary, but no actual
86
 
// initXxx method is invoked, that is done later in the constructor
87
 
//
88
 
// This is taken from MonoMac's source code:
89
 
//
90
 
[Export ("initWithFrame:")]
91
 
public UIView (System.Drawing.RectangleF frame) : base (NSObjectFlag.Empty)
92
 
{
93
 
// Invoke the init method now.
94
 
        var initWithFrame = new Selector ("initWithFrame:").Handle;
95
 
        if (IsDirectBinding)
96
 
                Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_RectangleF (this.Handle, initWithFrame, frame);
97
 
        else
98
 
                Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_RectangleF (this.SuperHandle, initWithFrame, frame);
99
 
}
 
90
public class MyClass : BaseClass {
 
91
    [Export ("initWithFoo:")]
 
92
    public MyClass (string foo) : base (NSObjectFlag.Empty)
 
93
    {
 
94
        ...
 
95
    }
100
96
</code>
101
97
          </example>
102
98
        </remarks>
109
105
      <AssemblyInfo>
110
106
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
111
107
      </AssemblyInfo>
 
108
      <Attributes>
 
109
        <Attribute>
 
110
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
 
111
        </Attribute>
 
112
      </Attributes>
112
113
      <Parameters>
113
114
        <Parameter Name="handle" Type="System.IntPtr" />
114
115
      </Parameters>
197
198
        <summary>Notification constant for Checkpoint</summary>
198
199
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
199
200
        <remarks>
200
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
201
 
          <example>
202
 
            <code lang="c#">
203
 
// Lambda style
204
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.CheckpointNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
201
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
202
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveCheckpoint" /> method which offers strongly typed access to the parameters of the notification.</para>
 
203
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
204
          <example>
 
205
            <code lang="c#">
 
206
//
 
207
// Lambda style
 
208
//
 
209
 
 
210
// listening
 
211
notification = NSUndoManager.Notifications.ObserveCheckpoint ((sender, args) =&gt; {
 
212
    /* Access strongly typed args */
 
213
    Console.WriteLine ("Notification: {0}", args.Notification);
 
214
});
 
215
 
 
216
// To stop listening:
 
217
notification.Dispose ();
 
218
 
 
219
//
 
220
// Method style
 
221
//
 
222
NSObject notification;
 
223
void Callback (object sender, Checkpoint args)
 
224
{
 
225
    // Access strongly typed args
 
226
    Console.WriteLine ("Notification: {0}", args.Notification);
 
227
}
 
228
 
 
229
void Setup ()
 
230
{
 
231
    notification = NSUndoManager.Notifications.ObserveCheckpoint (Callback);
 
232
}
 
233
 
 
234
void Teardown ()
 
235
{
 
236
    notification.Dispose ();
 
237
}</code>
 
238
          </example>
 
239
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
240
          <example>
 
241
            <code lang="c#">
 
242
// Lambda style
 
243
NSNotificationCenter.DefaultCenter.AddObserver (
 
244
        NSUndoManager.CheckpointNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
205
245
 
206
246
 
207
247
// Method style
209
249
{
210
250
    Console.WriteLine ("Received a notification NSUndoManager", notification);
211
251
}
 
252
 
212
253
void Setup ()
213
254
{
214
255
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.CheckpointNotification, Callback);
248
289
        <summary>Notification constant for DidCloseUndoGroup</summary>
249
290
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
250
291
        <remarks>
251
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
252
 
          <example>
253
 
            <code lang="c#">
254
 
// Lambda style
255
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidCloseUndoGroupNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
292
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
293
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveDidCloseUndoGroup" /> method which offers strongly typed access to the parameters of the notification.</para>
 
294
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
295
          <example>
 
296
            <code lang="c#">
 
297
//
 
298
// Lambda style
 
299
//
 
300
 
 
301
// listening
 
302
notification = NSUndoManager.Notifications.ObserveDidCloseUndoGroup ((sender, args) =&gt; {
 
303
    /* Access strongly typed args */
 
304
    Console.WriteLine ("Notification: {0}", args.Notification);
 
305
 
 
306
    Console.WriteLine ("Discardable", args.Discardable);
 
307
});
 
308
 
 
309
// To stop listening:
 
310
notification.Dispose ();
 
311
 
 
312
//
 
313
// Method style
 
314
//
 
315
NSObject notification;
 
316
void Callback (object sender, DidCloseUndoGroup args)
 
317
{
 
318
    // Access strongly typed args
 
319
    Console.WriteLine ("Notification: {0}", args.Notification);
 
320
 
 
321
    Console.WriteLine ("Discardable", args.Discardable);
 
322
}
 
323
 
 
324
void Setup ()
 
325
{
 
326
    notification = NSUndoManager.Notifications.ObserveDidCloseUndoGroup (Callback);
 
327
}
 
328
 
 
329
void Teardown ()
 
330
{
 
331
    notification.Dispose ();
 
332
}</code>
 
333
          </example>
 
334
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
335
          <example>
 
336
            <code lang="c#">
 
337
// Lambda style
 
338
NSNotificationCenter.DefaultCenter.AddObserver (
 
339
        NSUndoManager.DidCloseUndoGroupNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
256
340
 
257
341
 
258
342
// Method style
260
344
{
261
345
    Console.WriteLine ("Received a notification NSUndoManager", notification);
262
346
}
 
347
 
263
348
void Setup ()
264
349
{
265
350
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidCloseUndoGroupNotification, Callback);
283
368
        <summary>Notification constant for DidOpenUndoGroup</summary>
284
369
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
285
370
        <remarks>
286
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
287
 
          <example>
288
 
            <code lang="c#">
289
 
// Lambda style
290
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidOpenUndoGroupNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
371
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
372
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveDidOpenUndoGroup" /> method which offers strongly typed access to the parameters of the notification.</para>
 
373
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
374
          <example>
 
375
            <code lang="c#">
 
376
//
 
377
// Lambda style
 
378
//
 
379
 
 
380
// listening
 
381
notification = NSUndoManager.Notifications.ObserveDidOpenUndoGroup ((sender, args) =&gt; {
 
382
    /* Access strongly typed args */
 
383
    Console.WriteLine ("Notification: {0}", args.Notification);
 
384
});
 
385
 
 
386
// To stop listening:
 
387
notification.Dispose ();
 
388
 
 
389
//
 
390
// Method style
 
391
//
 
392
NSObject notification;
 
393
void Callback (object sender, DidOpenUndoGroup args)
 
394
{
 
395
    // Access strongly typed args
 
396
    Console.WriteLine ("Notification: {0}", args.Notification);
 
397
}
 
398
 
 
399
void Setup ()
 
400
{
 
401
    notification = NSUndoManager.Notifications.ObserveDidOpenUndoGroup (Callback);
 
402
}
 
403
 
 
404
void Teardown ()
 
405
{
 
406
    notification.Dispose ();
 
407
}</code>
 
408
          </example>
 
409
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
410
          <example>
 
411
            <code lang="c#">
 
412
// Lambda style
 
413
NSNotificationCenter.DefaultCenter.AddObserver (
 
414
        NSUndoManager.DidOpenUndoGroupNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
291
415
 
292
416
 
293
417
// Method style
295
419
{
296
420
    Console.WriteLine ("Received a notification NSUndoManager", notification);
297
421
}
 
422
 
298
423
void Setup ()
299
424
{
300
425
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidOpenUndoGroupNotification, Callback);
318
443
        <summary>Notification constant for DidRedoChange</summary>
319
444
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
320
445
        <remarks>
321
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
322
 
          <example>
323
 
            <code lang="c#">
324
 
// Lambda style
325
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidRedoChangeNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
446
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
447
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveDidRedoChange" /> method which offers strongly typed access to the parameters of the notification.</para>
 
448
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
449
          <example>
 
450
            <code lang="c#">
 
451
//
 
452
// Lambda style
 
453
//
 
454
 
 
455
// listening
 
456
notification = NSUndoManager.Notifications.ObserveDidRedoChange ((sender, args) =&gt; {
 
457
    /* Access strongly typed args */
 
458
    Console.WriteLine ("Notification: {0}", args.Notification);
 
459
});
 
460
 
 
461
// To stop listening:
 
462
notification.Dispose ();
 
463
 
 
464
//
 
465
// Method style
 
466
//
 
467
NSObject notification;
 
468
void Callback (object sender, DidRedoChange args)
 
469
{
 
470
    // Access strongly typed args
 
471
    Console.WriteLine ("Notification: {0}", args.Notification);
 
472
}
 
473
 
 
474
void Setup ()
 
475
{
 
476
    notification = NSUndoManager.Notifications.ObserveDidRedoChange (Callback);
 
477
}
 
478
 
 
479
void Teardown ()
 
480
{
 
481
    notification.Dispose ();
 
482
}</code>
 
483
          </example>
 
484
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
485
          <example>
 
486
            <code lang="c#">
 
487
// Lambda style
 
488
NSNotificationCenter.DefaultCenter.AddObserver (
 
489
        NSUndoManager.DidRedoChangeNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
326
490
 
327
491
 
328
492
// Method style
330
494
{
331
495
    Console.WriteLine ("Received a notification NSUndoManager", notification);
332
496
}
 
497
 
333
498
void Setup ()
334
499
{
335
500
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidRedoChangeNotification, Callback);
353
518
        <summary>Notification constant for DidUndoChange</summary>
354
519
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
355
520
        <remarks>
356
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
357
 
          <example>
358
 
            <code lang="c#">
359
 
// Lambda style
360
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidUndoChangeNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
521
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
522
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveDidUndoChange" /> method which offers strongly typed access to the parameters of the notification.</para>
 
523
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
524
          <example>
 
525
            <code lang="c#">
 
526
//
 
527
// Lambda style
 
528
//
 
529
 
 
530
// listening
 
531
notification = NSUndoManager.Notifications.ObserveDidUndoChange ((sender, args) =&gt; {
 
532
    /* Access strongly typed args */
 
533
    Console.WriteLine ("Notification: {0}", args.Notification);
 
534
});
 
535
 
 
536
// To stop listening:
 
537
notification.Dispose ();
 
538
 
 
539
//
 
540
// Method style
 
541
//
 
542
NSObject notification;
 
543
void Callback (object sender, DidUndoChange args)
 
544
{
 
545
    // Access strongly typed args
 
546
    Console.WriteLine ("Notification: {0}", args.Notification);
 
547
}
 
548
 
 
549
void Setup ()
 
550
{
 
551
    notification = NSUndoManager.Notifications.ObserveDidUndoChange (Callback);
 
552
}
 
553
 
 
554
void Teardown ()
 
555
{
 
556
    notification.Dispose ();
 
557
}</code>
 
558
          </example>
 
559
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
560
          <example>
 
561
            <code lang="c#">
 
562
// Lambda style
 
563
NSNotificationCenter.DefaultCenter.AddObserver (
 
564
        NSUndoManager.DidUndoChangeNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
361
565
 
362
566
 
363
567
// Method style
365
569
{
366
570
    Console.WriteLine ("Received a notification NSUndoManager", notification);
367
571
}
 
572
 
368
573
void Setup ()
369
574
{
370
575
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.DidUndoChangeNotification, Callback);
469
674
        <ReturnType>MonoMac.Foundation.NSString</ReturnType>
470
675
      </ReturnValue>
471
676
      <Docs>
472
 
        <summary>To be added.</summary>
473
 
        <value>To be added.</value>
 
677
        <summary>Represents the value associated with the constant NSUndoManagerGroupIsDiscardableKey</summary>
 
678
        <value>
 
679
        </value>
474
680
        <remarks>To be added.</remarks>
475
681
      </Docs>
476
682
    </Member>
640
846
      </AssemblyInfo>
641
847
      <Attributes>
642
848
        <Attribute>
 
849
          <AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
 
850
        </Attribute>
 
851
        <Attribute>
643
852
          <AttributeName>get: MonoMac.Foundation.Export("redoActionIsDiscardable")</AttributeName>
644
853
        </Attribute>
645
854
      </Attributes>
894
1103
      </AssemblyInfo>
895
1104
      <Attributes>
896
1105
        <Attribute>
 
1106
          <AttributeName>MonoMac.ObjCRuntime.Since(5, 0)</AttributeName>
 
1107
        </Attribute>
 
1108
        <Attribute>
897
1109
          <AttributeName>get: MonoMac.Foundation.Export("undoActionIsDiscardable")</AttributeName>
898
1110
        </Attribute>
899
1111
      </Attributes>
1008
1220
        <summary>Notification constant for WillCloseUndoGroup</summary>
1009
1221
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
1010
1222
        <remarks>
1011
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
1012
 
          <example>
1013
 
            <code lang="c#">
1014
 
// Lambda style
1015
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.WillCloseUndoGroupNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
1223
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
1224
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveWillCloseUndoGroup" /> method which offers strongly typed access to the parameters of the notification.</para>
 
1225
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
1226
          <example>
 
1227
            <code lang="c#">
 
1228
//
 
1229
// Lambda style
 
1230
//
 
1231
 
 
1232
// listening
 
1233
notification = NSUndoManager.Notifications.ObserveWillCloseUndoGroup ((sender, args) =&gt; {
 
1234
    /* Access strongly typed args */
 
1235
    Console.WriteLine ("Notification: {0}", args.Notification);
 
1236
 
 
1237
    Console.WriteLine ("Discardable", args.Discardable);
 
1238
});
 
1239
 
 
1240
// To stop listening:
 
1241
notification.Dispose ();
 
1242
 
 
1243
//
 
1244
// Method style
 
1245
//
 
1246
NSObject notification;
 
1247
void Callback (object sender, WillCloseUndoGroup args)
 
1248
{
 
1249
    // Access strongly typed args
 
1250
    Console.WriteLine ("Notification: {0}", args.Notification);
 
1251
 
 
1252
    Console.WriteLine ("Discardable", args.Discardable);
 
1253
}
 
1254
 
 
1255
void Setup ()
 
1256
{
 
1257
    notification = NSUndoManager.Notifications.ObserveWillCloseUndoGroup (Callback);
 
1258
}
 
1259
 
 
1260
void Teardown ()
 
1261
{
 
1262
    notification.Dispose ();
 
1263
}</code>
 
1264
          </example>
 
1265
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
1266
          <example>
 
1267
            <code lang="c#">
 
1268
// Lambda style
 
1269
NSNotificationCenter.DefaultCenter.AddObserver (
 
1270
        NSUndoManager.WillCloseUndoGroupNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
1016
1271
 
1017
1272
 
1018
1273
// Method style
1020
1275
{
1021
1276
    Console.WriteLine ("Received a notification NSUndoManager", notification);
1022
1277
}
 
1278
 
1023
1279
void Setup ()
1024
1280
{
1025
1281
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.WillCloseUndoGroupNotification, Callback);
1043
1299
        <summary>Notification constant for WillRedoChange</summary>
1044
1300
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
1045
1301
        <remarks>
1046
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
1047
 
          <example>
1048
 
            <code lang="c#">
1049
 
// Lambda style
1050
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.WillRedoChangeNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
1302
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
1303
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveWillRedoChange" /> method which offers strongly typed access to the parameters of the notification.</para>
 
1304
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
1305
          <example>
 
1306
            <code lang="c#">
 
1307
//
 
1308
// Lambda style
 
1309
//
 
1310
 
 
1311
// listening
 
1312
notification = NSUndoManager.Notifications.ObserveWillRedoChange ((sender, args) =&gt; {
 
1313
    /* Access strongly typed args */
 
1314
    Console.WriteLine ("Notification: {0}", args.Notification);
 
1315
});
 
1316
 
 
1317
// To stop listening:
 
1318
notification.Dispose ();
 
1319
 
 
1320
//
 
1321
// Method style
 
1322
//
 
1323
NSObject notification;
 
1324
void Callback (object sender, WillRedoChange args)
 
1325
{
 
1326
    // Access strongly typed args
 
1327
    Console.WriteLine ("Notification: {0}", args.Notification);
 
1328
}
 
1329
 
 
1330
void Setup ()
 
1331
{
 
1332
    notification = NSUndoManager.Notifications.ObserveWillRedoChange (Callback);
 
1333
}
 
1334
 
 
1335
void Teardown ()
 
1336
{
 
1337
    notification.Dispose ();
 
1338
}</code>
 
1339
          </example>
 
1340
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
1341
          <example>
 
1342
            <code lang="c#">
 
1343
// Lambda style
 
1344
NSNotificationCenter.DefaultCenter.AddObserver (
 
1345
        NSUndoManager.WillRedoChangeNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
1051
1346
 
1052
1347
 
1053
1348
// Method style
1055
1350
{
1056
1351
    Console.WriteLine ("Received a notification NSUndoManager", notification);
1057
1352
}
 
1353
 
1058
1354
void Setup ()
1059
1355
{
1060
1356
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.WillRedoChangeNotification, Callback);
1078
1374
        <summary>Notification constant for WillUndoChange</summary>
1079
1375
        <value>NSString constant, should be used as a token to NSNotificationCenter.</value>
1080
1376
        <remarks>
1081
 
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoMac.Foundation.NSNotificationCenter" /> to register a listener for this notification.</para>
1082
 
          <example>
1083
 
            <code lang="c#">
1084
 
// Lambda style
1085
 
NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.WillUndoChangeNotification, (notification) =&gt; Console.WriteLine ("Received the notification NSUndoManager", notification);
 
1377
          <para id="tool-remark">This constant can be used with the <see cref="T:MonoTouch.Foundation.NSNotificationCenter" /> to register a listener for this notification.   This is an NSString instead of a string, because these values can be used as tokens in some native libraries instead of being used purely for their actual string content.    The 'notification' parameter to the callback contains extra information that is specific to the notification type.</para>
 
1378
          <para id="tool-remark">If you want to subscribe to this notification, you can use the convenience <see cref="T:NSUndoManager+Notifications" />.<see cref="M:NSUndoManager+Notifications.ObserveWillUndoChange" /> method which offers strongly typed access to the parameters of the notification.</para>
 
1379
          <para>The following example shows how to use the strongly typed Notifications class, to take the guesswork out of the available properties in the notification:</para>
 
1380
          <example>
 
1381
            <code lang="c#">
 
1382
//
 
1383
// Lambda style
 
1384
//
 
1385
 
 
1386
// listening
 
1387
notification = NSUndoManager.Notifications.ObserveWillUndoChange ((sender, args) =&gt; {
 
1388
    /* Access strongly typed args */
 
1389
    Console.WriteLine ("Notification: {0}", args.Notification);
 
1390
});
 
1391
 
 
1392
// To stop listening:
 
1393
notification.Dispose ();
 
1394
 
 
1395
//
 
1396
// Method style
 
1397
//
 
1398
NSObject notification;
 
1399
void Callback (object sender, WillUndoChange args)
 
1400
{
 
1401
    // Access strongly typed args
 
1402
    Console.WriteLine ("Notification: {0}", args.Notification);
 
1403
}
 
1404
 
 
1405
void Setup ()
 
1406
{
 
1407
    notification = NSUndoManager.Notifications.ObserveWillUndoChange (Callback);
 
1408
}
 
1409
 
 
1410
void Teardown ()
 
1411
{
 
1412
    notification.Dispose ();
 
1413
}</code>
 
1414
          </example>
 
1415
          <para>The following example shows how to use the notification with the DefaultCenter API:</para>
 
1416
          <example>
 
1417
            <code lang="c#">
 
1418
// Lambda style
 
1419
NSNotificationCenter.DefaultCenter.AddObserver (
 
1420
        NSUndoManager.WillUndoChangeNotification, (notification) =&gt; {Console.WriteLine ("Received the notification NSUndoManager", notification); }
1086
1421
 
1087
1422
 
1088
1423
// Method style
1090
1425
{
1091
1426
    Console.WriteLine ("Received a notification NSUndoManager", notification);
1092
1427
}
 
1428
 
1093
1429
void Setup ()
1094
1430
{
1095
1431
    NSNotificationCenter.DefaultCenter.AddObserver (NSUndoManager.WillUndoChangeNotification, Callback);