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-02-14 23:25:59 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-02-15 21:29:50 +0400
commit986afa593b9f4e4d485bdc9f29a40a1d61c4c682 (patch)
tree19a81c393e96b748f08b6d3d947f6be7c08b3630 /BookmarkPopover.cs
parentd5b32e3670d5749f539a7a6d01c33e1b2f7d03cd (diff)
[macdoc] Add bookmark support
Diffstat (limited to 'BookmarkPopover.cs')
-rw-r--r--BookmarkPopover.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/BookmarkPopover.cs b/BookmarkPopover.cs
new file mode 100644
index 0000000..97d772b
--- /dev/null
+++ b/BookmarkPopover.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoMac.Foundation;
+using MonoMac.AppKit;
+
+namespace macdoc
+{
+ public partial class BookmarkPopover : MonoMac.AppKit.NSView
+ {
+ public class BookmarkEventArgs : EventArgs
+ {
+ public string Name { get; set; }
+ public string Notes { get; set; }
+ }
+
+ public event EventHandler<BookmarkEventArgs> Done;
+ public event EventHandler Delete;
+
+ public BookmarkPopover (IntPtr handle) : base (handle)
+ {
+ Initialize ();
+ }
+
+ [Export ("initWithCoder:")]
+ public BookmarkPopover (NSCoder coder) : base (coder)
+ {
+ Initialize ();
+ }
+
+ public void PostInitialization ()
+ {
+ nameField.StringValue = Name ?? string.Empty;
+ notesField.PlaceholderString = "You can add additional notes to this bookmark if you wish";
+ doneButton.Activated += (sender, e) => Done (this, new BookmarkEventArgs () { Name = nameField.StringValue, Notes = notesField.StringValue });
+ deleteButton.Activated += (sender, e) => Delete (this, EventArgs.Empty);
+ }
+
+ void Initialize ()
+ {
+ }
+
+ public string Name {
+ get;
+ set;
+ }
+ }
+}
+