Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Auto-generated from generator.cs, do not edit
- //
- // We keep references to objects, so warning 414 is expected
- #pragma warning disable 414
- using System;
- using System.Drawing;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Diagnostics;
- using System.ComponentModel;
- using MonoMac.CoreFoundation;
- using MonoMac.Foundation;
- using MonoMac.ObjCRuntime;
- using MonoMac.CoreGraphics;
- using MonoMac.CoreAnimation;
- using MonoMac.CoreLocation;
- using MonoMac.QTKit;
- using MonoMac.CoreVideo;
- using MonoMac.CoreMedia;
- using MonoMac.OpenGL;
- namespace MonoMac.Foundation {
- [Register("NSUserNotificationCenter", true)]
- public unsafe partial class NSUserNotificationCenter : NSObject {
- [CompilerGenerated]
- static readonly IntPtr selDefaultUserNotificationCenter = Selector.GetHandle ("defaultUserNotificationCenter");
- [CompilerGenerated]
- static readonly IntPtr selDelegate = Selector.GetHandle ("delegate");
- [CompilerGenerated]
- static readonly IntPtr selSetDelegate_ = Selector.GetHandle ("setDelegate:");
- [CompilerGenerated]
- static readonly IntPtr selScheduledNotifications = Selector.GetHandle ("scheduledNotifications");
- [CompilerGenerated]
- static readonly IntPtr selSetScheduledNotifications_ = Selector.GetHandle ("setScheduledNotifications:");
- [CompilerGenerated]
- static readonly IntPtr selDeliveredNotifications = Selector.GetHandle ("deliveredNotifications");
- [CompilerGenerated]
- static readonly IntPtr selScheduleNotification_ = Selector.GetHandle ("scheduleNotification:");
- [CompilerGenerated]
- static readonly IntPtr selRemoveScheduledNotification_ = Selector.GetHandle ("removeScheduledNotification:");
- [CompilerGenerated]
- static readonly IntPtr selDeliverNotification_ = Selector.GetHandle ("deliverNotification:");
- [CompilerGenerated]
- static readonly IntPtr selRemoveDeliveredNotification_ = Selector.GetHandle ("removeDeliveredNotification:");
- [CompilerGenerated]
- static readonly IntPtr selRemoveAllDeliveredNotifications = Selector.GetHandle ("removeAllDeliveredNotifications");
- [CompilerGenerated]
- static readonly IntPtr class_ptr = Class.GetHandle ("NSUserNotificationCenter");
- public override IntPtr ClassHandle { get { return class_ptr; } }
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [Export ("init")]
- public NSUserNotificationCenter () : base (NSObjectFlag.Empty)
- {
- if (IsDirectBinding) {
- Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, Selector.Init);
- } else {
- Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, Selector.Init);
- }
- }
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [Export ("initWithCoder:")]
- public NSUserNotificationCenter (NSCoder coder) : base (NSObjectFlag.Empty)
- {
- if (IsDirectBinding) {
- Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, Selector.InitWithCoder, coder.Handle);
- } else {
- Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, Selector.InitWithCoder, coder.Handle);
- }
- }
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- public NSUserNotificationCenter (NSObjectFlag t) : base (t) {}
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- public NSUserNotificationCenter (IntPtr handle) : base (handle) {}
- [Export ("scheduleNotification:")]
- public virtual void ScheduleNotification (NSUserNotification notification)
- {
- if (notification == null)
- throw new ArgumentNullException ("notification");
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selScheduleNotification_, notification.Handle);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selScheduleNotification_, notification.Handle);
- }
- #pragma warning disable 168
- var postget0 = ScheduledNotifications;
- #pragma warning restore 168
- }
- [Export ("removeScheduledNotification:")]
- public virtual void RemoveScheduledNotification (NSUserNotification notification)
- {
- if (notification == null)
- throw new ArgumentNullException ("notification");
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selRemoveScheduledNotification_, notification.Handle);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selRemoveScheduledNotification_, notification.Handle);
- }
- #pragma warning disable 168
- var postget0 = ScheduledNotifications;
- #pragma warning restore 168
- }
- [Export ("deliverNotification:")]
- public virtual void DeliverNotification (NSUserNotification notification)
- {
- if (notification == null)
- throw new ArgumentNullException ("notification");
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selDeliverNotification_, notification.Handle);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selDeliverNotification_, notification.Handle);
- }
- #pragma warning disable 168
- var postget0 = DeliveredNotifications;
- #pragma warning restore 168
- }
- [Export ("removeDeliveredNotification:")]
- public virtual void RemoveDeliveredNotification (NSUserNotification notification)
- {
- if (notification == null)
- throw new ArgumentNullException ("notification");
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selRemoveDeliveredNotification_, notification.Handle);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selRemoveDeliveredNotification_, notification.Handle);
- }
- #pragma warning disable 168
- var postget0 = DeliveredNotifications;
- #pragma warning restore 168
- }
- [Export ("removeAllDeliveredNotifications")]
- public virtual void RemoveAllDeliveredNotifications ()
- {
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend (this.Handle, selRemoveAllDeliveredNotifications);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper (this.SuperHandle, selRemoveAllDeliveredNotifications);
- }
- #pragma warning disable 168
- var postget0 = DeliveredNotifications;
- #pragma warning restore 168
- }
- [CompilerGenerated]
- static object __mt_DefaultUserNotificationCenter_var_static;
- public static NSUserNotificationCenter DefaultUserNotificationCenter {
- [Export ("defaultUserNotificationCenter")]
- get {
- NSUserNotificationCenter ret;
- ret = (NSUserNotificationCenter) Runtime.GetNSObject (MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (class_ptr, selDefaultUserNotificationCenter));
- __mt_DefaultUserNotificationCenter_var_static = ret;
- return ret;
- }
- }
- [CompilerGenerated]
- object __mt_WeakDelegate_var;
- public virtual NSObject WeakDelegate {
- [Export ("delegate")]
- get {
- NSObject ret;
- if (IsDirectBinding) {
- ret = (NSObject) Runtime.GetNSObject (MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, selDelegate));
- } else {
- ret = (NSObject) Runtime.GetNSObject (MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, selDelegate));
- }
- __mt_WeakDelegate_var = ret;
- return ret;
- }
- [Export ("setDelegate:")]
- set {
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetDelegate_, value == null ? IntPtr.Zero : value.Handle);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selSetDelegate_, value == null ? IntPtr.Zero : value.Handle);
- }
- __mt_WeakDelegate_var = value;
- }
- }
- public NSUserNotificationCenterDelegate Delegate {
- get {
- return WeakDelegate as NSUserNotificationCenterDelegate;
- }
- set {
- WeakDelegate = value;
- }
- }
- [CompilerGenerated]
- object __mt_ScheduledNotifications_var;
- public virtual NSUserNotification[] ScheduledNotifications {
- [Export ("scheduledNotifications")]
- get {
- NSUserNotification[] ret;
- if (IsDirectBinding) {
- ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, selScheduledNotifications));
- } else {
- ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, selScheduledNotifications));
- }
- __mt_ScheduledNotifications_var = ret;
- return ret;
- }
- [Export ("setScheduledNotifications:")]
- set {
- if (value == null)
- throw new ArgumentNullException ("value");
- var nsa_value = NSArray.FromNSObjects (value);
- if (IsDirectBinding) {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selSetScheduledNotifications_, nsa_value.Handle);
- } else {
- MonoMac.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selSetScheduledNotifications_, nsa_value.Handle);
- }
- nsa_value.Dispose ();
- __mt_ScheduledNotifications_var = value;
- }
- }
- [CompilerGenerated]
- object __mt_DeliveredNotifications_var;
- public virtual NSUserNotification[] DeliveredNotifications {
- [Export ("deliveredNotifications")]
- get {
- NSUserNotification[] ret;
- if (IsDirectBinding) {
- ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (this.Handle, selDeliveredNotifications));
- } else {
- ret = NSArray.ArrayFromHandle<MonoMac.Foundation.NSUserNotification>(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper (this.SuperHandle, selDeliveredNotifications));
- }
- __mt_DeliveredNotifications_var = ret;
- return ret;
- }
- }
- //
- // Events and properties from the delegate
- //
- _NSUserNotificationCenterDelegate EnsureNSUserNotificationCenterDelegate ()
- {
- var del = WeakDelegate;
- if (del == null || (!(del is _NSUserNotificationCenterDelegate))){
- del = new _NSUserNotificationCenterDelegate ();
- WeakDelegate = del;
- }
- return (_NSUserNotificationCenterDelegate) del;
- }
- #pragma warning disable 672
- [Register]
- sealed class _NSUserNotificationCenterDelegate : NSUserNotificationCenterDelegate {
- public _NSUserNotificationCenterDelegate () {}
- internal EventHandler<UNCDidDeliverNotificationEventArgs> didDeliverNotification;
- [Preserve (Conditional = true)]
- public override void DidDeliverNotification (NSUserNotificationCenter center, NSUserNotification notification)
- {
- EventHandler<UNCDidDeliverNotificationEventArgs> handler = didDeliverNotification;
- if (handler != null){
- var args = new UNCDidDeliverNotificationEventArgs (notification);
- handler (center, args);
- }
- }
- internal EventHandler<UNCDidActivateNotificationEventArgs> didActivateNotification;
- [Preserve (Conditional = true)]
- public override void DidActivateNotification (NSUserNotificationCenter center, NSUserNotification notification)
- {
- EventHandler<UNCDidActivateNotificationEventArgs> handler = didActivateNotification;
- if (handler != null){
- var args = new UNCDidActivateNotificationEventArgs (notification);
- handler (center, args);
- }
- }
- internal UNCShouldPresentNotification shouldPresentNotification;
- [Preserve (Conditional = true)]
- public override bool ShouldPresentNotification (NSUserNotificationCenter center, NSUserNotification notification)
- {
- UNCShouldPresentNotification handler = shouldPresentNotification;
- if (handler != null)
- return handler (center, notification);
- return false;
- }
- }
- #pragma warning restore 672
- public event EventHandler<UNCDidDeliverNotificationEventArgs> DidDeliverNotification {
- add { EnsureNSUserNotificationCenterDelegate ().didDeliverNotification += value; }
- remove { EnsureNSUserNotificationCenterDelegate ().didDeliverNotification -= value; }
- }
- public event EventHandler<UNCDidActivateNotificationEventArgs> DidActivateNotification {
- add { EnsureNSUserNotificationCenterDelegate ().didActivateNotification += value; }
- remove { EnsureNSUserNotificationCenterDelegate ().didActivateNotification -= value; }
- }
- public UNCShouldPresentNotification ShouldPresentNotification {
- get { return EnsureNSUserNotificationCenterDelegate ().shouldPresentNotification; }
- set { EnsureNSUserNotificationCenterDelegate ().shouldPresentNotification = value; }
- }
- protected override void Dispose (bool disposing)
- {
- __mt_WeakDelegate_var = null;
- __mt_ScheduledNotifications_var = null;
- __mt_DeliveredNotifications_var = null;
- base.Dispose (disposing);
- }
- } /* class NSUserNotificationCenter */
- //
- // EventArgs classes
- //
- public partial class UNCDidDeliverNotificationEventArgs : EventArgs {
- public UNCDidDeliverNotificationEventArgs (NSUserNotification notification)
- {
- this.Notification = notification;
- }
- public NSUserNotification Notification { get; set; }
- }
- public partial class UNCDidActivateNotificationEventArgs : EventArgs {
- public UNCDidActivateNotificationEventArgs (NSUserNotification notification)
- {
- this.Notification = notification;
- }
- public NSUserNotification Notification { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement