Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/AppKit/NSControlTextEditingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSControlTextEditingEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public NSTextView? FieldEditor {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSFieldEditor");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<NSTextView> (value);
}
}
}
#endif // !__MACCATALYST__
23 changes: 23 additions & 0 deletions src/AppKit/NSMenuItemEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSMenuItemEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public NSMenu? MenuItem {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("MenuItem");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<NSMenu> (value);
}
}
}
#endif // !__MACCATALYST__
23 changes: 23 additions & 0 deletions src/AppKit/NSMenuItemIndexEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSMenuItemIndexEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public nint MenuItemIndex {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return 0;

using var key = new TransientCFString ("NSMenuItemIndex");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSNumber> (value)?.NIntValue ?? 0;
}
}
}
#endif // !__MACCATALYST__
23 changes: 23 additions & 0 deletions src/AppKit/NSOutlineViewItemEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSOutlineViewItemEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public Foundation.NSObject? Item {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSObject");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSObject> (value);
}
}
}
#endif // !__MACCATALYST__
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSTextAlternativesSelectedAlternativeStringEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public string? AlternativeString {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSAlternativeString");
var value = userinfo.LowlevelObjectForKey (key);
return CoreFoundation.CFString.FromHandle (value);
}
}
}
#endif // !__MACCATALYST__
23 changes: 23 additions & 0 deletions src/AppKit/NSTextDidEndEditingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSTextDidEndEditingEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public nint Movement {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return 0;

using var key = new TransientCFString ("NSTextMovement");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSNumber> (value)?.NIntValue ?? 0;
}
}
}
#endif // !__MACCATALYST__
23 changes: 23 additions & 0 deletions src/AppKit/NSTextViewDidChangeSelectionEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSTextViewDidChangeSelectionEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public Foundation.NSValue? OldSelectedCharacterRange {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSOldSelectedCharacterRange");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSValue> (value);
}
}
}
#endif // !__MACCATALYST__
36 changes: 36 additions & 0 deletions src/AppKit/NSTextViewWillChangeNotifyingTextViewEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSTextViewWillChangeNotifyingTextViewEventArgs : NSNotificationEventArgs {
// These properties need manual bindings, because they're not using constant string values,
// they're using literal string values (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public NSTextView? OldView {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSOldNotifyingTextView");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<NSTextView> (value);
}
}

[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public NSTextView? NewView {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSNewNotifyingTextView");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<NSTextView> (value);
}
}
}
#endif // !__MACCATALYST__
36 changes: 36 additions & 0 deletions src/AppKit/NSViewColumnMoveEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSViewColumnMoveEventArgs : NSNotificationEventArgs {
// These properties need manual bindings, because they're not using constant string values,
// they're using literal string values (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public nint OldColumn {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return 0;

using var key = new TransientCFString ("NSOldColumn");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSNumber> (value)?.NIntValue ?? 0;
}
}

[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public nint NewColumn {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return 0;

using var key = new TransientCFString ("NSNewColumn");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSNumber> (value)?.NIntValue ?? 0;
}
}
}
#endif // !__MACCATALYST__
36 changes: 36 additions & 0 deletions src/AppKit/NSViewColumnResizeEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSViewColumnResizeEventArgs : NSNotificationEventArgs {
// These properties need manual bindings, because they're not using constant string values,
// they're using literal string values (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public NSTableColumn? Column {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return null;

using var key = new TransientCFString ("NSTableColumn");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<NSTableColumn> (value);
}
}

[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public nint OldWidth {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return 0;

using var key = new TransientCFString ("NSOldWidth");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSNumber> (value)?.NIntValue ?? 0;
}
}
}
#endif // !__MACCATALYST__
23 changes: 23 additions & 0 deletions src/AppKit/NSWorkspaceFileOperationEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#if !__MACCATALYST__
namespace AppKit;

partial class NSWorkspaceFileOperationEventArgs : NSNotificationEventArgs {
// This property needs a manual binding, because it's not using a constant string value,
// it's using a literal string value (as per Apple's documentation).
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public nint FileType {
get {
var userinfo = Notification.UserInfo;
if (userinfo is null)
return 0;

using var key = new TransientCFString ("NSOperationNumber");
var value = userinfo.LowlevelObjectForKey (key);
return Runtime.GetNSObject<Foundation.NSNumber> (value)?.NIntValue ?? 0;
}
}
}
#endif // !__MACCATALYST__
Loading
Loading