NSMenuItem 类

定义

[Foundation.Register("NSMenuItem", true)]
public class NSMenuItem : Foundation.NSObject, AppKit.INSAccessibility, AppKit.INSUserInterfaceItemIdentification, AppKit.INSValidatedUserInterfaceItem, Foundation.INSCoding, Foundation.INSCopying, IDisposable
type NSMenuItem = class
    inherit NSObject
    interface INSAccessibility
    interface INativeObject
    interface IDisposable
    interface INSCoding
    interface INSCopying
    interface INSUserInterfaceItemIdentification
    interface INSValidatedUserInterfaceItem
继承
NSMenuItem
属性
实现

构造函数

NSMenuItem()
NSMenuItem(IntPtr)
NSMenuItem(NSCoder)
NSMenuItem(NSObjectFlag)
NSMenuItem(String)
NSMenuItem(String, EventHandler)
NSMenuItem(String, Selector, String)
NSMenuItem(String, String)
NSMenuItem(String, String, EventHandler)
NSMenuItem(String, String, EventHandler, Func<NSMenuItem,Boolean>)

属性

AccessibilityActivationPoint
AccessibilityAllowedValues
AccessibilityAlternateUIVisible
AccessibilityApplicationFocusedUIElement
AccessibilityCancelButton
AccessibilityChildren
AccessibilityChildrenInNavigationOrder
AccessibilityClearButton
AccessibilityCloseButton
AccessibilityColumnCount
AccessibilityColumnHeaderUIElements
AccessibilityColumnIndexRange
AccessibilityColumns
AccessibilityColumnTitles
AccessibilityContents
AccessibilityCriticalValue
AccessibilityCustomActions
AccessibilityCustomRotors
AccessibilityDecrementButton
AccessibilityDefaultButton
AccessibilityDisclosed
AccessibilityDisclosedByRow
AccessibilityDisclosedRows
AccessibilityDisclosureLevel
AccessibilityDocument
AccessibilityEdited
AccessibilityElement
AccessibilityEnabled
AccessibilityExpanded
AccessibilityExtrasMenuBar
AccessibilityFilename
AccessibilityFocused
AccessibilityFocusedWindow
AccessibilityFrame
AccessibilityFrameInParentSpace
AccessibilityFrontmost
AccessibilityFullScreenButton
AccessibilityGrowArea
AccessibilityHandles
AccessibilityHeader
AccessibilityHelp
AccessibilityHidden
AccessibilityHorizontalScrollBar
AccessibilityHorizontalUnitDescription
AccessibilityHorizontalUnits
AccessibilityIdentifier
AccessibilityIncrementButton
AccessibilityIndex
AccessibilityInsertionPointLineNumber
AccessibilityLabel
AccessibilityLabelUIElements
AccessibilityLabelValue
AccessibilityLinkedUIElements
AccessibilityMain
AccessibilityMainWindow
AccessibilityMarkerGroupUIElement
AccessibilityMarkerTypeDescription
AccessibilityMarkerUIElements
AccessibilityMarkerValues
AccessibilityMaxValue
AccessibilityMenuBar
AccessibilityMinimizeButton
AccessibilityMinimized
AccessibilityMinValue
AccessibilityModal
AccessibilityNextContents
AccessibilityNumberOfCharacters
AccessibilityOrderedByRow
AccessibilityOrientation
AccessibilityOverflowButton
AccessibilityParent
AccessibilityPlaceholderValue
AccessibilityPreviousContents
AccessibilityProtectedContent
AccessibilityProxy
AccessibilityRequired
AccessibilityRole
AccessibilityRoleDescription
AccessibilityRowCount
AccessibilityRowHeaderUIElements
AccessibilityRowIndexRange
AccessibilityRows
AccessibilityRulerMarkerType
AccessibilitySearchButton
AccessibilitySearchMenu
AccessibilitySelected
AccessibilitySelectedCells
AccessibilitySelectedChildren
AccessibilitySelectedColumns
AccessibilitySelectedRows
AccessibilitySelectedText
AccessibilitySelectedTextRange
AccessibilitySelectedTextRanges
AccessibilityServesAsTitleForUIElements
AccessibilitySharedCharacterRange
AccessibilitySharedFocusElements
AccessibilitySharedTextUIElements
AccessibilityShownMenu
AccessibilitySortDirection
AccessibilitySplitters
AccessibilitySubrole
AccessibilityTabs
AccessibilityTitle
AccessibilityTitleUIElement
AccessibilityToolbarButton
AccessibilityTopLevelUIElement
AccessibilityUnitDescription
AccessibilityUnits
AccessibilityUrl
AccessibilityValue
AccessibilityValueDescription
AccessibilityVerticalScrollBar
AccessibilityVerticalUnitDescription
AccessibilityVerticalUnits
AccessibilityVisibleCells
AccessibilityVisibleCharacterRange
AccessibilityVisibleChildren
AccessibilityVisibleColumns
AccessibilityVisibleRows
AccessibilityWarningValue
AccessibilityWindow
AccessibilityWindows
AccessibilityZoomButton
Action
AllowsKeyEquivalentWhenHidden
Alternate
AnnouncementRequestedNotification
ApplicationActivatedNotification
ApplicationDeactivatedNotification
ApplicationHiddenNotification
ApplicationShownNotification
AttributedTitle
Class (继承自 NSObject)
ClassHandle
CreatedNotification
DebugDescription

此对象的开发人员有意义的说明。

(继承自 NSObject)
Description

对象的说明,即 ToString 的 Objective-C 版本。

(继承自 NSObject)
DrawerCreatedNotification
Enabled
FocusedWindowChangedNotification
Handle

处理指向非托管对象表示形式的 (指针) 。

(继承自 NSObject)
HasSubmenu
HelpTagCreatedNotification
Hidden
Highlighted
Identifier
Image
IndentationLevel
IsDirectBinding (继承自 NSObject)
IsHiddenOrHasHiddenAncestor
IsProxy (继承自 NSObject)
IsSeparatorItem
KeyEquivalent
KeyEquivalentModifierMask
LayoutChangedNotification
MainWindowChangedNotification
Menu
MixedStateImage
MovedNotification
OffStateImage
OnStateImage
ParentItem
RepresentedObject
ResizedNotification
RetainCount

返回对象的当前 Objective-C 保留计数。

(继承自 NSObject)
RowCollapsedNotification
RowCountChangedNotification
RowExpandedNotification
SelectedCellsChangedNotification
SelectedChildrenChangedNotification
SelectedChildrenMovedNotification
SelectedColumnsChangedNotification
SelectedRowsChangedNotification
SelectedTextChangedNotification
Self (继承自 NSObject)
SeparatorItem
SheetCreatedNotification
State
Submenu
Superclass (继承自 NSObject)
SuperHandle

用于表示此 NSObject 基类中方法的句柄。

(继承自 NSObject)
Tag
Target
Title
TitleChangedNotification
ToolTip
UIElementDestroyedNotification
UIElementFocusedChangedNotification
UnitsChangedNotification
UserKeyEquivalent
UsesUserKeyEquivalents
ValidateMenuItem
ValueChangedNotification
View
WindowCreatedNotification
WindowDeminiaturizedNotification
WindowMiniaturizedNotification
WindowMovedNotification
WindowResizedNotification
Zone (继承自 NSObject)

方法

AccessibilityAddChildElement(NSAccessibilityElement)
AccessibilityPerformCancel()
AccessibilityPerformConfirm()
AccessibilityPerformDecrement()
AccessibilityPerformDelete()
AccessibilityPerformIncrement()
AccessibilityPerformPick()
AccessibilityPerformPress()
AccessibilityPerformRaise()
AccessibilityPerformShowAlternateUI()
AccessibilityPerformShowDefaultUI()
AccessibilityPerformShowMenu()
AddObserver(NSObject, NSString, NSKeyValueObservingOptions, IntPtr)

使用 NSString keyPath) 注册一个对象,以便在外部 (观察到该对象。   观察到的更改将调度到观察者的 对象 ObserveValue(NSString, NSObject, NSDictionary, IntPtr) 方法。

(继承自 NSObject)
AddObserver(NSObject, String, NSKeyValueObservingOptions, IntPtr)

使用字符串 keyPath) 注册一个对象,以便在外部 (观察到该对象。   观察到的更改将调度到观察者的 对象 ObserveValue(NSString, NSObject, NSDictionary, IntPtr) 方法。

(继承自 NSObject)
AddObserver(NSString, NSKeyValueObservingOptions, Action<NSObservedChange>)

注册一个对象,以便使用任意方法在外部观察。

(继承自 NSObject)
AddObserver(String, NSKeyValueObservingOptions, Action<NSObservedChange>)

注册一个对象,以便使用任意方法在外部观察。

(继承自 NSObject)
AwakeFromNib()

从 nib 文件加载对象后调用。 替代器必须调用 base。AwakeFromNib () 。

(继承自 NSObject)
BeginInvokeOnMainThread(Action) (继承自 NSObject)
BeginInvokeOnMainThread(Selector, NSObject)

在主 UI 线程上异步调用指定的代码。

(继承自 NSObject)
Bind(NSString, NSObject, String, NSDictionary) (继承自 NSObject)
Bind(String, NSObject, String, NSDictionary)
已过时.
(继承自 NSObject)
BindingInfo(String)
已过时.
(继承自 NSObject)
BindingOptionDescriptions(String)
已过时.
(继承自 NSObject)
BindingValueClass(String)
已过时.
(继承自 NSObject)
CommitEditing() (继承自 NSObject)
CommitEditing(NSObject, Selector, IntPtr) (继承自 NSObject)
ConformsToProtocol(IntPtr)

调用以确定此对象是否实现指定的协议。

(继承自 NSObject)
Copy()

执行基础 Objective-C 对象的副本。

(继承自 NSObject)
Copy(NSZone)
CreateElement(NSString, CGRect, NSString, NSObject)
DangerousAutorelease() (继承自 NSObject)
DangerousRelease() (继承自 NSObject)
DangerousRetain() (继承自 NSObject)
DidChange(NSKeyValueChange, NSIndexSet, NSString)

指示对多关系的索引发生了更改。

(继承自 NSObject)
DidChange(NSString, NSKeyValueSetMutationKind, NSSet) (继承自 NSObject)
DidChangeValue(String)

指示对指定的键进行了更改。

(继承自 NSObject)
Dispose()

释放 NSObject 对象使用的资源。

(继承自 NSObject)
Dispose(Boolean)
DoesNotRecognizeSelector(Selector)

指示此对象无法识别指定的选择器。

(继承自 NSObject)
EncodeTo(NSCoder)
Equals(NSObject) (继承自 NSObject)
Equals(Object) (继承自 NSObject)
ExposedBindings() (继承自 NSObject)
GetAccessibilityAttributedString(NSRange)
GetAccessibilityCellForColumn(nint, nint)
GetAccessibilityFrame(NSRange)
GetAccessibilityLayoutForScreen(CGPoint)
GetAccessibilityLayoutForScreen(CGSize)
GetAccessibilityLine(nint)
GetAccessibilityRange(CGPoint)
GetAccessibilityRange(nint)
GetAccessibilityRangeForLine(nint)
GetAccessibilityRtf(NSRange)
GetAccessibilityScreenForLayout(CGPoint)
GetAccessibilityScreenForLayout(CGSize)
GetAccessibilityString(NSRange)
GetAccessibilityStyleRange(nint)
GetBindingInfo(NSString) (继承自 NSObject)
GetBindingOptionDescriptions(NSString) (继承自 NSObject)
GetBindingValueClass(NSString) (继承自 NSObject)
GetDictionaryOfValuesFromKeys(NSString[])

检索指定键的值。

(继承自 NSObject)
GetHashCode()

为当前实例生成哈希代码。

(继承自 NSObject)
GetMethodForSelector(Selector) (继承自 NSObject)
GetNativeField(String)
已过时.
(继承自 NSObject)
GetNativeHash() (继承自 NSObject)
Init() (继承自 NSObject)
InitializeHandle(IntPtr) (继承自 NSObject)
InitializeHandle(IntPtr, String) (继承自 NSObject)
Invoke(Action, Double) (继承自 NSObject)
Invoke(Action, TimeSpan) (继承自 NSObject)
InvokeOnMainThread(Action) (继承自 NSObject)
InvokeOnMainThread(Selector, NSObject)

同步调用主 UI 线程上的指定代码。

(继承自 NSObject)
IsAccessibilitySelectorAllowed(Selector)
IsEqual(NSObject) (继承自 NSObject)
IsKindOfClass(Class) (继承自 NSObject)
IsMemberOfClass(Class) (继承自 NSObject)
MarkDirty()

将常规对等对象 (IsDirectBinding 为 true) 提升为 toggleref 对象。

(继承自 NSObject)
MutableCopy()

创建指定 NSObject 的可变副本。

(继承自 NSObject)
ObjectDidEndEditing(NSObject) (继承自 NSObject)
ObserveValue(NSString, NSObject, NSDictionary, IntPtr)

指示相对于此对象的指定 keyPath 处的值已更改。

(继承自 NSObject)
PerformSelector(Selector) (继承自 NSObject)
PerformSelector(Selector, NSObject) (继承自 NSObject)
PerformSelector(Selector, NSObject, Double)

在当前实例上调用选择器,如果 obj 不为 null,则将其作为其单个参数传递。

(继承自 NSObject)
PerformSelector(Selector, NSObject, Double, NSString[]) (继承自 NSObject)
PerformSelector(Selector, NSObject, NSObject) (继承自 NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean) (继承自 NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean, NSString[]) (继承自 NSObject)
PrepareForInterfaceBuilder() (继承自 NSObject)
RemoveObserver(NSObject, NSString)

阻止指定观察程序接收指定 keyPath 的更改值的进一步通知。

(继承自 NSObject)
RemoveObserver(NSObject, NSString, IntPtr)

停止指定的观察程序接收指定 keyPath 和上下文的更改值的进一步通知。

(继承自 NSObject)
RemoveObserver(NSObject, String)

阻止指定观察程序接收指定 keyPath 的更改值的进一步通知。

(继承自 NSObject)
RemoveObserver(NSObject, String, IntPtr)

停止指定的观察程序接收指定 keyPath 和上下文的更改值的进一步通知。

(继承自 NSObject)
RespondsToSelector(Selector)

此对象是否识别指定的选择器。

(继承自 NSObject)
SetNativeField(String, NSObject)
已过时.
(继承自 NSObject)
SetNilValueForKey(NSString)

将指定键的值设置为 null。

(继承自 NSObject)
SetTitleWithMnemonic(String)
SetValueForKey(NSObject, NSString)

将键指定的属性的值设置为指定的值。

(继承自 NSObject)
SetValueForKeyPath(IntPtr, NSString)

创建非托管对象的托管表示形式时使用的构造函数;由运行时调用。

(继承自 NSObject)
SetValueForKeyPath(NSObject, NSString)

设置可以使用键路径访问的属性的值。

(继承自 NSObject)
SetValueForUndefinedKey(NSObject, NSString)

指示尝试将值写入未定义的键。 如果未重写,则引发 NSUndefinedKeyException。

(继承自 NSObject)
SetValuesForKeysWithDictionary(NSDictionary)

将此 NSObject 的值设置为指定字典中的值。

(继承自 NSObject)
ToString()

返回当前实例的值的字符串表示形式。

(继承自 NSObject)
Unbind(NSString) (继承自 NSObject)
Unbind(String)
已过时.
(继承自 NSObject)
ValueForKey(NSString)

返回与指定键关联的属性的值。

(继承自 NSObject)
ValueForKeyPath(NSString)

返回可以使用键路径访问的属性的值。

(继承自 NSObject)
ValueForUndefinedKey(NSString)

指示尝试读取未定义键的值。 如果未重写,则引发 NSUndefinedKeyException。

(继承自 NSObject)
WillChange(NSKeyValueChange, NSIndexSet, NSString)

指示指定键中指定索引的值即将更改。

(继承自 NSObject)
WillChange(NSString, NSKeyValueSetMutationKind, NSSet) (继承自 NSObject)
WillChangeValue(String)

指示指定键的值即将更改。

(继承自 NSObject)

事件

Activated

扩展方法

GetAccessibilityChildrenInNavigationOrder(INSAccessibility)
GetAccessibilityCustomActions(INSAccessibility)
GetAccessibilityCustomRotors(INSAccessibility)
GetAccessibilityRequired(INSAccessibility)
SetAccessibilityChildrenInNavigationOrder(INSAccessibility, NSAccessibilityElement[])
SetAccessibilityCustomActions(INSAccessibility, NSAccessibilityCustomAction[])
SetAccessibilityCustomRotors(INSAccessibility, NSAccessibilityCustomRotor[])
SetAccessibilityRequired(INSAccessibility, Boolean)
ObjectDidBeginEditing(NSObject, INSEditor)
ObjectDidEndEditing(NSObject, INSEditor)
GetValidModes(NSObject, NSFontPanel)
ValidateToolbarItem(NSObject, NSToolbarItem)
GetIdentifier(INSUserInterfaceItemIdentification)
SetIdentifier(INSUserInterfaceItemIdentification, String)
GetDebugDescription(INSObjectProtocol)
AcceptsPreviewPanelControl(NSObject, QLPreviewPanel)
BeginPreviewPanelControl(NSObject, QLPreviewPanel)
EndPreviewPanelControl(NSObject, QLPreviewPanel)

适用于