本文整理匯總了C#中MonoMac.AppKit.NSMenuItem.SetTitleWithMnemonic方法的典型用法代碼示例。如果您正苦於以下問題:C# NSMenuItem.SetTitleWithMnemonic方法的具體用法?C# NSMenuItem.SetTitleWithMnemonic怎麽用?C# NSMenuItem.SetTitleWithMnemonic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoMac.AppKit.NSMenuItem
的用法示例。
在下文中一共展示了NSMenuItem.SetTitleWithMnemonic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetItemValues
static void SetItemValues (NSMenuItem item, CommandInfo info)
{
item.SetTitleWithMnemonic (GetCleanCommandText (info));
item.Enabled = !IsGloballyDisabled && info.Enabled;
item.Hidden = !info.Visible;
SetAccel (item, info.AccelKey);
if (info.Checked) {
item.State = NSCellStateValue.On;
} else if (info.CheckedInconsistent) {
item.State = NSCellStateValue.Mixed;
} else {
item.State = NSCellStateValue.Off;
}
}
示例2: SetItemValues
void SetItemValues (NSMenuItem item, CommandInfo info, bool disabledVisible)
{
item.SetTitleWithMnemonic (GetCleanCommandText (info));
if (!string.IsNullOrEmpty (info.Description) && item.ToolTip != info.Description)
item.ToolTip = info.Description;
bool enabled = info.Enabled && (!IsGloballyDisabled || commandSource == CommandSource.ContextMenu);
bool visible = info.Visible && (disabledVisible || info.Enabled);
item.Enabled = enabled;
item.Hidden = !visible;
SetAccel (item, info.AccelKey);
if (info.Checked) {
item.State = NSCellStateValue.On;
} else if (info.CheckedInconsistent) {
item.State = NSCellStateValue.Mixed;
} else {
item.State = NSCellStateValue.Off;
}
}