Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-03-06 15:54:49 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-03-06 15:54:49 +0400
commitd1cd5197f03c059dbefa2b6eb24d834992a3446b (patch)
treebe6e5d2ca6f1091a2ac8cb14cc62d08c6cacdc8c /BookmarkAssistant.cs
parent46ac66f0038074be45406f7cdc8c29a3da8ad02f (diff)
Rework how we delete bookmark from the assistant popover to close match Mac OS X
Diffstat (limited to 'BookmarkAssistant.cs')
-rw-r--r--BookmarkAssistant.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/BookmarkAssistant.cs b/BookmarkAssistant.cs
index 6c8405e..0501f6a 100644
--- a/BookmarkAssistant.cs
+++ b/BookmarkAssistant.cs
@@ -8,6 +8,8 @@ namespace macdoc
{
public partial class BookmarkAssistant : MonoMac.AppKit.NSView
{
+ public event Action<int> BookmarkDeleted;
+
public BookmarkAssistant (IntPtr handle) : base (handle)
{
}
@@ -17,15 +19,22 @@ namespace macdoc
{
}
- public NSTableView TableView {
- get {
- return bookmarkTableView;
- }
+ partial void DeleteButtonClicked (NSButton sender)
+ {
+ if (bookmarkTableView.SelectedRowCount != 1)
+ return;
+
+ var index = bookmarkTableView.SelectedRow;
+ if (index < 0 || index > bookmarkTableView.RowCount)
+ return;
+ var temp = BookmarkDeleted;
+ if (temp != null)
+ temp (index);
}
- public NSButtonCell DeleteButtonCell {
+ public NSTableView TableView {
get {
- return bookmarkTableDeleteBtn;
+ return bookmarkTableView;
}
}
}