本文整理汇总了C#中MonoMac.AppKit.NSMenuItem类的典型用法代码示例。如果您正苦于以下问题:C# NSMenuItem类的具体用法?C# NSMenuItem怎么用?C# NSMenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSMenuItem类属于MonoMac.AppKit命名空间,在下文中一共展示了NSMenuItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Update
public void Update (MDMenu parent, ref NSMenuItem lastSeparator, ref int index)
{
var info = manager.GetCommandInfo (ce.CommandId);
if (!isArrayItem) {
SetItemValues (this, info);
if (!Hidden)
MDMenu.ShowLastSeparator (ref lastSeparator);
return;
}
Hidden = true;
if (index < parent.Count - 1) {
for (int i = index + 1; i < parent.Count; i++) {
var nextItem = parent.ItemAt (i);
if (nextItem == null || nextItem.Target != this)
break;
parent.RemoveItemAt (i);
i--;
}
}
PopulateArrayItems (info.ArrayInfo, parent, ref lastSeparator, ref index);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:25,代码来源:MDMenuItem.cs
示例2: CreateNsMenu
private void CreateNsMenu() {
var menu = new NSMenu ();
statusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(30);
statusItem.Menu = menu;
statusItem.Image = NSImage.ImageNamed("statusicon");
statusItem.HighlightMode = true;
menu.RemoveAllItems ();
browseMenuItem = new NSMenuItem ("Browse Media Library", "b", delegate {
Browse (NSApplication.SharedApplication);
});
menu.AddItem (browseMenuItem);
configureMenuItem = new NSMenuItem ("Configure Media Browser", "c", delegate {
Configure (NSApplication.SharedApplication);
});
menu.AddItem (configureMenuItem);
communityMenuItem = new NSMenuItem ("Visit Community", "v", delegate {
Community (NSApplication.SharedApplication);
});
menu.AddItem (communityMenuItem);
quitMenuItem = new NSMenuItem ("Quit", "q", delegate {
Quit (NSApplication.SharedApplication);
});
menu.AddItem (quitMenuItem);
}
开发者ID:paul-777,项目名称:Emby,代码行数:31,代码来源:MenuBarIcon.cs
示例3: Update
public void Update (MDMenu parent, ref NSMenuItem lastSeparator, ref int index)
{
Enabled = true;
Hidden = Submenu != NSApplication.SharedApplication.ServicesMenu;
if (!Hidden)
MDMenu.ShowLastSeparator (ref lastSeparator);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:MDServicesMenuItem.cs
示例4: Run
public void Run (NSMenuItem sender)
{
var a = sender as MDExpandedArrayItem;
if (a != null) {
manager.DispatchCommand (ce.CommandId, a.Info.DataItem, CommandSource.MainMenu);
} else {
manager.DispatchCommand (ce.CommandId, CommandSource.MainMenu);
}
}
开发者ID:IBBoard,项目名称:monodevelop,代码行数:9,代码来源:MDMenuItem.cs
示例5: ValidateMenuItem
public bool ValidateMenuItem(NSMenuItem item)
{
var h = Handler;
if (h != null)
{
h.Widget.OnValidate(EventArgs.Empty);
return h.Enabled;
}
return false;
}
开发者ID:Exe0,项目名称:Eto,代码行数:10,代码来源:MenuActionHandler.cs
示例6: Update
public void Update (MDMenu parent, ref NSMenuItem lastSeparator, ref int index)
{
if (ces.AutoHide) {
((MDMenu)Submenu).UpdateCommands ();
Hidden = Submenu.ItemArray ().All (item => item.Hidden);
}
if (!Hidden) {
MDMenu.ShowLastSeparator (ref lastSeparator);
}
}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:10,代码来源:MDSubMenuItem.cs
示例7: FinishedLaunching
public override void FinishedLaunching(NSObject notification)
{
// mainWindowController = new MainWindowController ();
// mainWindowController.Window.MakeKeyAndOrderFront (this);
// Construct menu that will be displayed when tray icon is clicked
var notifyMenu = new NSMenu();
var exitMenuItem = new NSMenuItem("Quit",
(a,b) => {
NSApplication.SharedApplication.Terminate(this);
//System.Environment.Exit(0);
});
var startMidiModMenuItem = new NSMenuItem("Run",
(a,b) => { RunMidiMod(); });
var mappingmodMidiModMenuItem = new NSMenuItem("Mapping Mod",
(a,b) => { ActivateMappingMod(); });
statusMenuItem = new NSMenuItem("STATUS",
(a,b) => { });
statusMenuItem.Enabled = false;
var versionMenuItem = new NSMenuItem("Version 1.0",
(a,b) => { });
versionMenuItem.Enabled = false;
var seperatorItem = NSMenuItem.SeparatorItem;
notifyMenu.AutoEnablesItems = false;
// Just add 'Quit' command
notifyMenu.AddItem (statusMenuItem);
notifyMenu.AddItem (versionMenuItem);
notifyMenu.AddItem (seperatorItem);
notifyMenu.AddItem (startMidiModMenuItem);
notifyMenu.AddItem (mappingmodMidiModMenuItem);
notifyMenu.AddItem(exitMenuItem);
// Display tray icon in upper-right-hand corner of the screen
sItem = NSStatusBar.SystemStatusBar.CreateStatusItem(16); //def 16
sItem.Menu = notifyMenu;
sItem.Title = "MidiMod";
sItem.ToolTip = "Midi Mod";
sItem.Image = NSImage.FromStream(System.IO.File.OpenRead(NSBundle.MainBundle.ResourcePath + @"/9b244f1232672041.icns"));
sItem.HighlightMode = true;
UpdateStatus ("Mod not startet");
// Remove the system tray icon from upper-right hand corner of the screen
// (works without adjusting the LSUIElement setting in Info.plist)
NSApplication.SharedApplication.ActivationPolicy =
NSApplicationActivationPolicy.Accessory;
}
开发者ID:cansik,项目名称:midimodifier,代码行数:54,代码来源:AppDelegate.cs
示例8: RepositoryMenuItem
public RepositoryMenuItem(Repository repo, StatusIconController controller) : base(repo.Name) {
this.repository = repo;
this.controller = controller;
this.Image = this.folderImage;
this.Image.Size = new SizeF(16, 16);
this.repository.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) => {
if (e.PropertyName == CmisSync.Lib.Utils.NameOf((Repository r) => r.Status)) {
this.Status = this.repository.Status;
}
if (e.PropertyName == CmisSync.Lib.Utils.NameOf((Repository r) => r.LastFinishedSync)) {
this.changesFoundAt = this.repository.LastFinishedSync;
this.UpdateStatusText();
}
if (e.PropertyName == CmisSync.Lib.Utils.NameOf((Repository r) => r.NumberOfChanges)) {
this.changesFound = this.repository.NumberOfChanges;
this.UpdateStatusText();
}
};
this.openLocalFolderItem = new NSMenuItem(Properties_Resources.OpenLocalFolder) {
Image = this.folderImage
};
this.openLocalFolderItem.Image.Size = new SizeF(16, 16);
this.openLocalFolderItem.Activated += this.OpenFolderDelegate();
this.editItem = new NSMenuItem(Properties_Resources.Settings);
this.editItem.Activated += this.EditFolderDelegate();
this.suspendItem = new NSMenuItem(Properties_Resources.PauseSync);
this.Status = repo.Status;
this.suspendItem.Activated += this.SuspendSyncFolderDelegate();
this.statusItem = new NSMenuItem(Properties_Resources.StatusSearchingForChanges) {
Enabled = false
};
this.removeFolderFromSyncItem = new NSMenuItem(Properties_Resources.RemoveFolderFromSync);
this.removeFolderFromSyncItem.Activated += this.RemoveFolderFromSyncDelegate();
var subMenu = new NSMenu();
subMenu.AddItem(this.statusItem);
subMenu.AddItem(NSMenuItem.SeparatorItem);
subMenu.AddItem(this.openLocalFolderItem);
subMenu.AddItem(this.suspendItem);
subMenu.AddItem(this.editItem);
subMenu.AddItem(NSMenuItem.SeparatorItem);
subMenu.AddItem(this.removeFolderFromSyncItem);
this.Submenu = subMenu;
}
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:52,代码来源:RepositoryMenuItem.cs
示例9: Run
public void Run (NSMenuItem sender)
{
var a = sender as MDExpandedArrayItem;
//if the command opens a modal subloop, give cocoa a chance to unhighlight the menu item
GLib.Timeout.Add (1, () => {
if (a != null) {
manager.DispatchCommand (ce.CommandId, a.Info.DataItem, CommandSource.MainMenu);
} else {
manager.DispatchCommand (ce.CommandId, CommandSource.MainMenu);
}
return false;
});
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:MDMenuItem.cs
示例10: ValidateMenuItem
public bool ValidateMenuItem(NSMenuItem menuItem)
{
switch ((MenuTag) (int)menuItem.Tag)
{
case MenuTag.AlwaysEnable:
return true;
case MenuTag.RequiresFile:
return mediaListController.Count > 0;
}
logger.Info("ValidateMenuItem: unexpected tag {0} for menu item '{1}'", menuItem.Tag, menuItem.Title);
return false;
}
开发者ID:kevintavog,项目名称:Radish.net,代码行数:13,代码来源:MenuHandlers.cs
示例11: DidFinishLaunching
public override void DidFinishLaunching(NSNotification notification)
{
var menu = new NSMenu ();
var menuItem = new NSMenuItem ();
menu.AddItem (menuItem);
var appMenu = new NSMenu ();
var quitItem = new NSMenuItem ("Quit " + NSProcessInfo.ProcessInfo.ProcessName, "q", (s, e) => NSApplication.SharedApplication.Terminate (menu));
appMenu.AddItem (quitItem);
var window = new NSWindow ();
menuItem.Submenu = appMenu;
NSApplication.SharedApplication.MainMenu = menu;
}
开发者ID:Sracinas,项目名称:XamarinTest,代码行数:16,代码来源:AppDelegate.cs
示例12: CreateNsMenu
private void CreateNsMenu() {
var menu = new NSMenu ();
statusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(30);
statusItem.Menu = menu;
statusItem.Image = NSImage.ImageNamed("statusicon");
statusItem.HighlightMode = true;
menu.RemoveAllItems ();
browseMenuItem = new NSMenuItem ("Browse Media Library", "b", delegate {
Browse (NSApplication.SharedApplication);
});
menu.AddItem (browseMenuItem);
configureMenuItem = new NSMenuItem ("Configure Media Browser", "c", delegate {
Configure (NSApplication.SharedApplication);
});
menu.AddItem (configureMenuItem);
developerMenuItem = new NSMenuItem ("Developer Resources");
menu.AddItem (developerMenuItem);
var developerMenu = new NSMenu ();
developerMenuItem.Submenu = developerMenu;
apiMenuItem = new NSMenuItem ("Api Documentation", "a", delegate {
ApiDocs (NSApplication.SharedApplication);
});
developerMenu.AddItem (apiMenuItem);
githubMenuItem = new NSMenuItem ("Github", "g", delegate {
Github (NSApplication.SharedApplication);
});
developerMenu.AddItem (githubMenuItem);
communityMenuItem = new NSMenuItem ("Visit Community", "v", delegate {
Community (NSApplication.SharedApplication);
});
menu.AddItem (communityMenuItem);
quitMenuItem = new NSMenuItem ("Quit", "q", delegate {
Quit (NSApplication.SharedApplication);
});
menu.AddItem (quitMenuItem);
}
开发者ID:jabbera,项目名称:MediaBrowser,代码行数:47,代码来源:MenuBarIcon.cs
示例13: MenuItemWrapper
public MenuItemWrapper(string text, Duplicati.GUI.TrayIcon.MenuIcons icon, Action callback, IList<Duplicati.GUI.TrayIcon.IMenuItem> subitems)
{
if (text == "-")
m_item = NSMenuItem.SeparatorItem;
else
{
m_item = new NSMenuItem(text, ClickHandler);
m_callback = callback;
if (subitems != null && subitems.Count > 0)
{
m_item.Submenu = new NSMenu();
foreach(var itm in subitems)
m_item.Submenu.AddItem(((MenuItemWrapper)itm).MenuItem);
}
}
}
开发者ID:admz,项目名称:duplicati,代码行数:17,代码来源:CocoaRunner.cs
示例14: SelectEncodingPopUpButton
public SelectEncodingPopUpButton (bool showAutoDetected)
{
Cell.UsesItemFromMenu = false;
if (showAutoDetected) {
autoDetectedItem = new NSMenuItem () {
Title = GettextCatalog.GetString ("Auto Detected"),
Tag = -1,
Target = this,
Action = itemActivationSel,
};
}
addRemoveItem = new NSMenuItem () {
Title = GettextCatalog.GetString ("Add or Remove..."),
Tag = -20,
Target = this,
Action = addRemoveActivationSel,
};
Populate (false);
SelectedEncodingId = 0;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:23,代码来源:SelectEncodingPopUpButton.cs
示例15: AwakeFromNib
public override void AwakeFromNib ()
{
base.AwakeFromNib ();
#region first two buttons
// add the image menu item back to the first menu item
NSMenuItem menuItem = new NSMenuItem ("", new Selector (""), "");
menuItem.Image = NSImage.ImageNamed ("moof.png");
buttonMenu.InsertItematIndex (menuItem, 0);
nibBasedPopUpDown.Menu = buttonMenu;
nibBasedPopUpRight.Menu = buttonMenu;
// create the pull down button pointing DOWN
RectangleF buttonFrame = placeHolder1.Frame;
codeBasedPopUpDown = new NSPopUpButton (buttonFrame, true);
((NSPopUpButtonCell)codeBasedPopUpDown.Cell).ArrowPosition = NSPopUpArrowPosition.Bottom;
((NSPopUpButtonCell)codeBasedPopUpDown.Cell).BezelStyle = NSBezelStyle.ThickSquare;
codeBasedPopUpDown.Menu = buttonMenu;
popupBox.AddSubview (codeBasedPopUpDown);
placeHolder1.RemoveFromSuperview ();
// create the pull down button pointing RIGHT
buttonFrame = placeHolder2.Frame;
codeBasedPopUpRight = new NSPopUpButton (buttonFrame, true);
((NSPopUpButtonCell)codeBasedPopUpRight.Cell).ArrowPosition = NSPopUpArrowPosition.Bottom;
((NSPopUpButtonCell)codeBasedPopUpRight.Cell).PreferredEdge = NSRectEdge.MaxXEdge;
((NSPopUpButtonCell)codeBasedPopUpRight.Cell).BezelStyle = NSBezelStyle.Circular;
codeBasedPopUpRight.Menu = buttonMenu;
((NSPopUpButtonCell)codeBasedPopUpRight.Cell).HighlightsBy = (int)NSCellMask.ChangeGrayCell;
popupBox.AddSubview (codeBasedPopUpRight);
placeHolder2.RemoveFromSuperview ();
#endregion
#region second two buttons
// create the rounded button
buttonFrame = placeHolder3.Frame;
// note: this button we want alternate title and image, so we need to call this:
codeBasedButtonRound = new NSButton (buttonFrame) {
Title = "NSButton",
AlternateTitle = "(pressed)",
Image = NSImage.ImageNamed ("moof.png"),
AlternateImage = NSImage.ImageNamed ("moof2.png"),
BezelStyle = NSBezelStyle.RegularSquare,
ImagePosition = NSCellImagePosition.ImageLeft,
Font = NSFont.SystemFontOfSize (NSFont.SmallSystemFontSize),
Sound = NSSound.FromName ("Pop"),
};
// Two choices, either use the .NET event system:
// foo.Activated += delegate {..} or += SomeMethod
//
// Or you can use the Target = this Action = new Selector ("buttonAction:")
// pattern
codeBasedButtonRound.Activated += delegate {
buttonAction (null);
};
codeBasedButtonRound.SetButtonType (NSButtonType.MomentaryChange);
codeBasedButtonRound.Cell.Alignment = NSTextAlignment.Left;
buttonBox.AddSubview (codeBasedButtonRound);
placeHolder3.RemoveFromSuperview (); // we are done with the place holder, remove it from the window
// create the square button
buttonFrame = placeHolder4.Frame;
codeBasedButtonSquare = new NSButton (buttonFrame){
Title = "NSButton",
BezelStyle = NSBezelStyle.ShadowlessSquare,
ImagePosition = NSCellImagePosition.ImageLeft,
Image = NSImage.ImageNamed ("moof.png"),
Font = NSFont.SystemFontOfSize (NSFont.SmallSystemFontSize),
Sound = NSSound.FromName ("Pop"),
};
codeBasedButtonSquare.Activated += delegate { buttonAction (null); };
codeBasedButtonSquare.Cell.Alignment = NSTextAlignment.Left;
buttonBox.AddSubview (codeBasedButtonSquare);
placeHolder4.RemoveFromSuperview (); // we are done with the place holder, remove it from the window
#endregion
#region segmented control
buttonFrame = placeHolder5.Frame;
codeBasedSegmentControl = new NSSegmentedControl(buttonFrame) {
SegmentCount = 3,
Target = this,
Action = new Selector("segmentAction:")
};
codeBasedSegmentControl.SetWidth (nibBasedSegControl.GetWidth(0), 0);
codeBasedSegmentControl.SetWidth (nibBasedSegControl.GetWidth (1), 1);
codeBasedSegmentControl.SetWidth (nibBasedSegControl.GetWidth (2), 2);
codeBasedSegmentControl.SetLabel ("One", 0);
codeBasedSegmentControl.SetLabel ("Two", 1);
codeBasedSegmentControl.SetLabel ("Three", 2);
segmentBox.AddSubview (codeBasedSegmentControl);
//.........这里部分代码省略.........
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:101,代码来源:TestWindowController.cs
示例16: ArrangeDateWise
/// <summary>
/// Arranges the Dock Menu with lastest change date.
/// Last 10 modified Notes are shown up in the Dock Menu.
/// </summary>
void ArrangeDateWise () {
if (Notes != null || Notes.Count > 0) {
int count = Notes.Count;
Dictionary<DateTime,Note> dateDict = new Dictionary<DateTime, Note>();
for (int i = 0; i < count; i++) {
Note temp = Notes.Values.ElementAt(i);
if(!dateDict.ContainsKey(temp.ChangeDate))
dateDict.Add(temp.ChangeDate, temp);
}
var dateList = dateDict.Keys.ToList();
dateList.Sort();
if (dateDict.Count >= MAXNOTES)
for (int i = 0; i < MAXNOTES && dockMenuNoteCounter <= MAXNOTES; i++) {
var item = new NSMenuItem();
DateTime date = dateList.ElementAt(dateDict.Count - i - 1);
item.Title = dateDict[date].Title;
item.Activated += HandleActivated;
dockMenu.AddItem(item);
dockMenuNoteCounter += 1;
}
else
for (int i = 0; i < dateDict.Count; i++) {
var item = new NSMenuItem();
DateTime date = dateList.ElementAt(dateDict.Count - i - 1);
item.Title = dateDict[date].Title;
item.Activated += HandleActivated;
dockMenu.AddItem(item);
dockMenuNoteCounter += 1;
}
}
}
开发者ID:rashoodkhan,项目名称:tomboy.osx,代码行数:40,代码来源:AppDelegate.cs
示例17: HandleNoteAdded
/// <summary>
/// Handles the note added.
/// </summary>
/// <param name="note">Note.</param>
void HandleNoteAdded (Note note) {
Logger.Debug ("AppDelegate Handling Note Added {0}", note.Title);
try {
NSMenuItem item = new NSMenuItem ();
item.Title = note.Title;
item.Activated += HandleActivated;
dockMenu.AddItem (item);
dockMenuNoteCounter += 1;
RefreshNotesWindowController();
} catch (Exception e) {
Logger.Error ("Failed to add item from Dock Menu {0}", e);
}
}
开发者ID:rashoodkhan,项目名称:tomboy.osx,代码行数:18,代码来源:AppDelegate.cs
示例18: CreateMenu
// Creates the menu that is popped up when the
// user clicks the status icon
public void CreateMenu()
{
Menu = new NSMenu ();
StateMenuItem = new NSMenuItem () {
Title = StateText
};
Menu.AddItem (StateMenuItem);
Menu.AddItem (NSMenuItem.SeparatorItem);
FolderMenuItem = new NSMenuItem () {
Title = "SparkleShare"
};
FolderMenuItem.Activated += delegate {
SparkleShare.Controller.OpenSparkleShareFolder ();
};
string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
"sparkleshare-mac.icns");
FolderMenuItem.Image = new NSImage (folder_icon_path);
FolderMenuItem.Image.Size = new SizeF (16, 16);
Menu.AddItem (FolderMenuItem);
if (SparkleShare.Controller.Folders.Count > 0) {
FolderMenuItems = new NSMenuItem [SparkleShare.Controller.Folders.Count];
Tasks = new EventHandler [SparkleShare.Controller.Folders.Count];
int i = 0;
foreach (string folder_name in SparkleShare.Controller.Folders) {
NSMenuItem item = new NSMenuItem ();
item.Title = folder_name;
if (SparkleShare.Controller.UnsyncedFolders.Contains (folder_name))
item.Image = NSImage.ImageNamed ("NSCaution");
else
item.Image = NSImage.ImageNamed ("NSFolder");
item.Image.Size = new SizeF (16, 16);
Tasks [i] = OpenFolderDelegate (folder_name);
FolderMenuItems [i] = item;
FolderMenuItems [i].Activated += Tasks [i];
Menu.AddItem (FolderMenuItems [i]);
i++;
};
} else {
FolderMenuItems = new NSMenuItem [1];
FolderMenuItems [0] = new NSMenuItem () {
Title = "No Remote Folders Yet"
};
Menu.AddItem (FolderMenuItems [0]);
}
Menu.AddItem (NSMenuItem.SeparatorItem);
SyncMenuItem = new NSMenuItem () {
Title = "Add Remote Folder…"
};
if (!SparkleShare.Controller.FirstRun) {
SyncMenuItem.Activated += delegate {
InvokeOnMainThread (delegate {
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
if (SparkleUI.Intro == null) {
SparkleUI.Intro = new SparkleIntro ();
SparkleUI.Intro.ShowServerForm (true);
}
if (!SparkleUI.Intro.IsVisible)
SparkleUI.Intro.ShowServerForm (true);
SparkleUI.Intro.OrderFrontRegardless ();
SparkleUI.Intro.MakeKeyAndOrderFront (this);
});
};
}
Menu.AddItem (SyncMenuItem);
Menu.AddItem (NSMenuItem.SeparatorItem);
RecentEventsMenuItem = new NSMenuItem () {
Title = "Show Recent Events"
};
if (SparkleShare.Controller.Folders.Count > 0) {
RecentEventsMenuItem.Activated += delegate {
InvokeOnMainThread (delegate {
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
//.........这里部分代码省略.........
开发者ID:ktze,项目名称:SparkleShare,代码行数:101,代码来源:SparkleStatusIcon.cs
示例19: FlashMenu
// http://lists.apple.com/archives/cocoa-dev/2008/Apr/msg01696.html
void FlashMenu ()
{
var f35 = ((char)0xF726).ToString ();
var blink = new NSMenuItem ("* blink *") {
KeyEquivalent = f35,
};
var f35Event = NSEvent.KeyEvent (
NSEventType.KeyDown, System.Drawing.PointF.Empty, NSEventModifierMask.CommandKeyMask, 0, 0,
NSGraphicsContext.CurrentContext, f35, f35, false, 0);
AddItem (blink);
PerformKeyEquivalent (f35Event);
RemoveItem (blink);
}
开发者ID:segaman,项目名称:monodevelop,代码行数:14,代码来源:MDMenu.cs
示例20: 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;
}
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:MDMenuItem.cs
注:本文中的MonoMac.AppKit.NSMenuItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论