From 116d5c5be2a8c4b3e84dfb3d50b32ca596994115 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 18 Dec 2010 21:37:50 +0100 Subject: [PATCH] More work on [osx] --- SparkleShare/Mac/SparkleShare/AppDelegate.cs | 0 SparkleShare/Mac/SparkleShare/Main.cs | 60 ------- SparkleShare/Mac/SparkleShare/MainWindow.cs | 35 ---- .../SparkleShare/MainWindow.xib.designer.cs | 23 --- .../Mac/SparkleShare/MainWindowController.cs | 46 ----- SparkleShare/Mac/SparkleShare/SparkleLog.cs | 18 +- .../Mac/SparkleShare/SparkleMacController.cs | 8 +- .../Mac/SparkleShare/SparkleShare.csproj | 6 +- .../Mac/SparkleShare/SparkleStatusIcon.cs | 128 ++++++------- SparkleShare/Mac/SparkleShare/SparkleUI.cs | 169 ++++-------------- .../Mac/SparkleShare/SparkleWindow.cs | 73 ++++++++ 11 files changed, 192 insertions(+), 374 deletions(-) delete mode 100644 SparkleShare/Mac/SparkleShare/AppDelegate.cs delete mode 100644 SparkleShare/Mac/SparkleShare/Main.cs delete mode 100644 SparkleShare/Mac/SparkleShare/MainWindow.cs delete mode 100644 SparkleShare/Mac/SparkleShare/MainWindow.xib.designer.cs delete mode 100644 SparkleShare/Mac/SparkleShare/MainWindowController.cs create mode 100644 SparkleShare/Mac/SparkleShare/SparkleWindow.cs diff --git a/SparkleShare/Mac/SparkleShare/AppDelegate.cs b/SparkleShare/Mac/SparkleShare/AppDelegate.cs deleted file mode 100644 index e69de29b..00000000 diff --git a/SparkleShare/Mac/SparkleShare/Main.cs b/SparkleShare/Mac/SparkleShare/Main.cs deleted file mode 100644 index caaee850..00000000 --- a/SparkleShare/Mac/SparkleShare/Main.cs +++ /dev/null @@ -1,60 +0,0 @@ -// SparkleShare, an instant update workflow to Git. -// Copyright (C) 2010 Hylke Bons -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - - -using System; -using System.Drawing; -using System.Timers; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.ObjCRuntime; -using MonoMac.WebKit; - -namespace SparkleShare { - - public partial class AppDelegate : NSApplicationDelegate { - // Workaround to be able to work with SparkleUI as the main class - } - - - public class SparkleUI : AppDelegate - { - - public SparkleStatusIcon StatusIcon; - - - public SparkleUI () - { - - NSApplication.Init (); - //NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - //NSApplication.SharedApplication.applicationIconImage = NSImage.ImageNamed ("sparkleshare.icns"); - - //StatusIcon = new SparkleStatusIcon (); - - } - - - public void Run () - { - - NSApplication.Main (new string [0]); - - } - - } - -} diff --git a/SparkleShare/Mac/SparkleShare/MainWindow.cs b/SparkleShare/Mac/SparkleShare/MainWindow.cs deleted file mode 100644 index 2cbe2ae5..00000000 --- a/SparkleShare/Mac/SparkleShare/MainWindow.cs +++ /dev/null @@ -1,35 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using MonoMac.Foundation; -using MonoMac.AppKit; - -namespace SparkleShare -{ - public partial class MainWindow : MonoMac.AppKit.NSWindow - { - #region Constructors - - // Called when created from unmanaged code - public MainWindow (IntPtr handle) : base(handle) - { - Initialize (); - } - - // Called when created directly from a XIB file - [Export("initWithCoder:")] - public MainWindow (NSCoder coder) : base(coder) - { - Initialize (); - } - - // Shared initialization code - void Initialize () - { - } - - #endregion - } -} - diff --git a/SparkleShare/Mac/SparkleShare/MainWindow.xib.designer.cs b/SparkleShare/Mac/SparkleShare/MainWindow.xib.designer.cs deleted file mode 100644 index 2be04caa..00000000 --- a/SparkleShare/Mac/SparkleShare/MainWindow.xib.designer.cs +++ /dev/null @@ -1,23 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace SparkleShare { - - - // Should subclass MonoMac.AppKit.NSWindow - [MonoMac.Foundation.Register("MainWindow")] - public partial class MainWindow { - } - - // Should subclass MonoMac.AppKit.NSWindowController - [MonoMac.Foundation.Register("MainWindowController")] - public partial class MainWindowController { - } -} diff --git a/SparkleShare/Mac/SparkleShare/MainWindowController.cs b/SparkleShare/Mac/SparkleShare/MainWindowController.cs deleted file mode 100644 index 22f30d23..00000000 --- a/SparkleShare/Mac/SparkleShare/MainWindowController.cs +++ /dev/null @@ -1,46 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using MonoMac.Foundation; -using MonoMac.AppKit; - -namespace SparkleShare -{ - public partial class MainWindowController : MonoMac.AppKit.NSWindowController - { - #region Constructors - - // Called when created from unmanaged code - public MainWindowController (IntPtr handle) : base(handle) - { - Initialize (); - } - - // Called when created directly from a XIB file - [Export("initWithCoder:")] - public MainWindowController (NSCoder coder) : base(coder) - { - Initialize (); - } - - // Call to load from the XIB/NIB file - public MainWindowController () : base("MainWindow") - { - Initialize (); - } - - // Shared initialization code - void Initialize () - { - } - - #endregion - - //strongly typed window accessor - public new MainWindow Window { - get { return (MainWindow)base.Window; } - } - } -} - diff --git a/SparkleShare/Mac/SparkleShare/SparkleLog.cs b/SparkleShare/Mac/SparkleShare/SparkleLog.cs index ce433148..e666792a 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleLog.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleLog.cs @@ -61,7 +61,7 @@ namespace SparkleShare { }; OpenFolderButton.Activated += delegate { - // SparkleShare.Controller.OpenSparkleShareFolder (LocalPath); + SparkleShare.Controller.OpenSparkleShareFolder (LocalPath); }; ContentView.AddSubview (OpenFolderButton); @@ -73,7 +73,7 @@ namespace SparkleShare { }; CloseButton.Activated += delegate { - Close (); + PerformClose (this); }; ContentView.AddSubview (CloseButton); @@ -87,14 +87,16 @@ namespace SparkleShare { } - - new public void Close () + + public override void PerformClose (NSObject sender) { - - InvokeOnMainThread (delegate { - base.Close (); + + InvokeOnMainThread (delegate { + Console.WriteLine ("!!!!!!!!!!"); + SparkleUI.OpenLogs.Remove ((SparkleLog) this); + base.PerformClose (this); }); - + } diff --git a/SparkleShare/Mac/SparkleShare/SparkleMacController.cs b/SparkleShare/Mac/SparkleShare/SparkleMacController.cs index e954479c..7cdf0df7 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleMacController.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleMacController.cs @@ -15,6 +15,7 @@ // along with this program. If not, see . +using SparkleLib; using System; using System.Diagnostics; using System.IO; @@ -66,7 +67,12 @@ namespace SparkleShare { public override void OpenSparkleShareFolder (string subfolder) { - + string folder = Path.Combine (SparklePaths.SparklePath, subfolder); + + Process process = new Process (); + process.StartInfo.Arguments = folder.Replace (" ", "\\ "); // Escape space-characters + process.StartInfo.FileName = "open"; + process.Start (); } diff --git a/SparkleShare/Mac/SparkleShare/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare/SparkleShare.csproj index 85062258..bc6e4845 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare/SparkleShare.csproj @@ -47,7 +47,6 @@ - MainMenu.xib @@ -61,6 +60,8 @@ SparkleController.cs + + @@ -80,6 +81,9 @@ + + Pixmaps\side-splash.png + diff --git a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs index f3d30f8e..a279f94f 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs @@ -58,45 +58,45 @@ namespace SparkleShare { StatusItem.HighlightMode = true; - SetAnimationState (); + SetNormalState (); CreateMenu (); -/* SparkleShare.Controller.FolderSizeChanged += delegate { - Application.Invoke (delegate { + SparkleShare.Controller.FolderSizeChanged += delegate { + InvokeOnMainThread (delegate { UpdateMenu (); }); }; SparkleShare.Controller.FolderListChanged += delegate { - Application.Invoke (delegate { + InvokeOnMainThread (delegate { SetNormalState (); CreateMenu (); }); }; SparkleShare.Controller.OnIdle += delegate { - Application.Invoke (delegate { + InvokeOnMainThread (delegate { SetNormalState (); UpdateMenu (); }); }; SparkleShare.Controller.OnSyncing += delegate { - Application.Invoke (delegate { + InvokeOnMainThread (delegate { SetAnimationState (); UpdateMenu (); }); }; SparkleShare.Controller.OnError += delegate { - Application.Invoke (delegate { + InvokeOnMainThread (delegate { SetNormalState (true); UpdateMenu (); }); }; -*/ + } @@ -119,10 +119,10 @@ namespace SparkleShare { InvokeOnMainThread (delegate { - StatusItem.AlternateImage = NSImage.ImageNamed ("idle" + FrameNumber + ".png"); + StatusItem.AlternateImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/idle" + FrameNumber + ".png"); StatusItem.AlternateImage.Size = new SizeF (16, 16); - StatusItem.Image = NSImage.ImageNamed ("idle" + FrameNumber + ".png"); + StatusItem.Image = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/idle" + FrameNumber + ".png"); StatusItem.Image.Size = new SizeF (16, 16); }); @@ -138,7 +138,7 @@ namespace SparkleShare { // user clicks the status icon public void CreateMenu () { - + Menu = new NSMenu (); StateMenuItem = new NSMenuItem () { @@ -154,49 +154,49 @@ namespace SparkleShare { }; FolderMenuItem.Activated += delegate { - // SparkleShare.Controller.OpenSparkleShareFolder (); + SparkleShare.Controller.OpenSparkleShareFolder (); }; - FolderMenuItem.Image = NSImage.ImageNamed ("sparkleshare.icns"); + //FolderMenuItem.Image = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare.icns"); + FolderMenuItem.Image = NSImage.ImageNamed ("NSFolder"); FolderMenuItem.Image.Size = new SizeF (16, 16); Menu.AddItem (FolderMenuItem); - - FolderMenuItems = new NSMenuItem [2] { - new NSMenuItem () { Title = "gnome-design" }, - new NSMenuItem () { Title = "tango-icons" } - }; - - -// if (SparkleShare.Controller.Folders.Count > 0) { + if (SparkleShare.Controller.Folders.Count > 0) { -// foreach (string path in SparkleShare.Controller.Folders) { - - foreach (NSMenuItem item in FolderMenuItems) { + FolderMenuItems = new NSMenuItem [SparkleShare.Controller.Folders.Count]; + Tasks = new EventHandler [SparkleShare.Controller.Folders.Count]; + + int i = 0; + + foreach (string path in SparkleShare.Controller.Folders) { // if (repo.HasUnsyncedChanges) // folder_action.IconName = "dialog-error"; - + + NSMenuItem item = new NSMenuItem (); + + item.Title = System.IO.Path.GetFileName (path); item.Image = NSImage.ImageNamed ("NSFolder"); item.Image.Size = new SizeF (16, 16); + + Tasks [i] = OpenEventLogDelegate(item.Title); + + FolderMenuItems [i] = item; + FolderMenuItems [i].Activated += Tasks [i]; + Menu.AddItem (FolderMenuItems [i]); - item.Activated += delegate { - - }; - - item.Activated += OpenEventLogDelegate (item.Title); - - Menu.AddItem (item); + i++; }; - // } else { + } else { // TODO: No Remote Folders Yet - // } + } Menu.AddItem (NSMenuItem.SeparatorItem); @@ -205,11 +205,11 @@ namespace SparkleShare { Title = "Add Remote Folder..." }; -// if (SparkleShare.Controller.FirstRun) -// SyncMenuItem.Enabled = false; + if (SparkleShare.Controller.FirstRun) + SyncMenuItem.Enabled = false; SyncMenuItem.Activated += delegate { - // TODO + SparkleWindow w = new SparkleWindow (); }; Menu.AddItem (SyncMenuItem); @@ -219,16 +219,21 @@ namespace SparkleShare { NotificationsMenuItem = new NSMenuItem () { - Title = "Show Notifications", - State = NSCellStateValue.On + Title = "Show Notifications" }; -// if (SparkleShare.Controller.NotificationsEnabled) -// NotificationsMenuItem.State = NSCellStateValue.On; -// else -// NotificationsMenuItem.State = NSCellStateValue.On; + if (SparkleShare.Controller.NotificationsEnabled) + NotificationsMenuItem.State = NSCellStateValue.On; + NotificationsMenuItem.Activated += delegate { -// SparkleShare.Controller.ToggleNotifications (); + + SparkleShare.Controller.ToggleNotifications (); + + if (SparkleShare.Controller.NotificationsEnabled) + NotificationsMenuItem.State = NSCellStateValue.On; + else + NotificationsMenuItem.State = NSCellStateValue.Off; + }; Menu.AddItem (NotificationsMenuItem); @@ -248,33 +253,30 @@ namespace SparkleShare { Menu.AddItem (AboutMenuItem); StatusItem.Menu = Menu; + StatusItem.Menu.Update (); + Console.WriteLine ("MENU UPDATED"); } - + + public delegate void Task(); + EventHandler [] Tasks; + // A method reference that makes sure that opening the // event log for each repository works correctly private EventHandler OpenEventLogDelegate (string path) { + return delegate { - SparkleLog log = null; //SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { return l.LocalPath.Equals (path); }); + SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { return l.LocalPath.Equals (path); }); // Check whether the log is already open, create a new one if - //that's not the case or present it to the user if it is + // that's not the case or present it to the user if it is if (log == null) { - log = new SparkleLog (path); - - /*log.Hidden += delegate { - - SparkleUI.OpenLogs.Remove (log); - log.Destroy (); - - }; - - SparkleUI.OpenLogs.Add (log);*/ + SparkleUI.OpenLogs.Add (new SparkleLog (path)); } @@ -306,15 +308,15 @@ namespace SparkleShare { Animation.Stop (); - if (false /* SparkleShare.Controller.Folders.Count == 0 */) { + if (SparkleShare.Controller.Folders.Count == 0) { StateText = _("Welcome to SparkleShare!"); InvokeOnMainThread (delegate { - StatusItem.Image = NSImage.ImageNamed ("idle.png"); + StatusItem.Image = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/idle.png"); StatusItem.Image.Size = new SizeF (16, 16); - StatusItem.AlternateImage = NSImage.ImageNamed ("idle-active.png"); + StatusItem.AlternateImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/idle-active.png"); StatusItem.AlternateImage.Size = new SizeF (16, 16); }); @@ -330,13 +332,13 @@ namespace SparkleShare { } else { - StateText = _("Up to date") + " ("/* + SparkleShare.Controller.FolderSize + ")" */; + StateText = _("Up to date") + " (" + SparkleShare.Controller.FolderSize + ")"; InvokeOnMainThread (delegate { - StatusItem.Image = NSImage.ImageNamed ("idle.png"); + StatusItem.Image = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/idle.png"); StatusItem.Image.Size = new SizeF (16, 16); - StatusItem.AlternateImage = NSImage.ImageNamed ("idle-active.png"); + StatusItem.AlternateImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/idle-active.png"); StatusItem.AlternateImage.Size = new SizeF (16, 16); }); diff --git a/SparkleShare/Mac/SparkleShare/SparkleUI.cs b/SparkleShare/Mac/SparkleShare/SparkleUI.cs index 8ce3cf2f..598cee4c 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleUI.cs @@ -8,164 +8,59 @@ // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . -using Gtk; -using Mono.Unix; -using Mono.Unix.Native; -using SparkleLib; + using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; +using System.Drawing; +using System.Timers; +using MonoMac.Foundation; +using MonoMac.AppKit; +using MonoMac.ObjCRuntime; +using MonoMac.WebKit; namespace SparkleShare { - public class SparkleUI { - + public partial class AppDelegate : NSApplicationDelegate { + // Workaround to be able to work with SparkleUI as the main class + } + + + public class SparkleUI : AppDelegate + { + public static SparkleStatusIcon StatusIcon; public static List OpenLogs; - - - // Short alias for the translations - public static string _(string s) - { - return Catalog.GetString (s); - } - - + + public SparkleUI () { - // Initialize the application - Application.Init (); - - // Create the statusicon + NSApplication.Init (); + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + //NSApplication.SharedApplication.applicationIconImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkeshare.icns"); + + OpenLogs = new List (); StatusIcon = new SparkleStatusIcon (); - // Keep track of which event logs are open - SparkleUI.OpenLogs = new List (); - - SparkleShare.Controller.OnFirstRun += delegate { - Application.Invoke (delegate { - - SparkleIntro intro = new SparkleIntro (); - intro.ShowAll (); - - }); - }; - - SparkleShare.Controller.OnInvitation += delegate (string invitation_file_path) { - Application.Invoke (delegate { - - SparkleInvitation invitation = new SparkleInvitation (invitation_file_path); - invitation.Present (); - - }); - }; - - // Show a bubble when there are new changes - SparkleShare.Controller.NotificationRaised += delegate (SparkleCommit commit, string repository_path) { - - string file_name = ""; - string message = null; - - if (commit.Added.Count > 0) { - - foreach (string added in commit.Added) { - file_name = added; - break; - } - - message = String.Format (_("added ‘{0}’"), file_name); - - } - - if (commit.Edited.Count > 0) { - - foreach (string modified in commit.Edited) { - file_name = modified; - break; - } - - message = String.Format (_("edited ‘{0}’"), file_name); - - } - - if (commit.Deleted.Count > 0) { - - foreach (string removed in commit.Deleted) { - file_name = removed; - break; - } - - message = String.Format (_("deleted ‘{0}’"), file_name); - - } - - int changes_count = (commit.Added.Count + - commit.Edited.Count + - commit.Deleted.Count); - - if (changes_count > 1) - message += " + " + (changes_count - 1); - - - Application.Invoke (delegate { - - SparkleBubble bubble = new SparkleBubble (commit.UserName, message); - - string avatar_file_path = SparkleUIHelpers.GetAvatar (commit.UserEmail, 32); - - if (avatar_file_path != null) - bubble.Icon = new Gdk.Pixbuf (avatar_file_path); - else - bubble.Icon = SparkleUIHelpers.GetIcon ("avatar-default", 32); - -// bubble.AddAction ("", "Show Events", delegate { - -// SparkleLog log = new SparkleLog (repository_path); -// log.ShowAll (); - -// }); - -// bubble.Show (); - - }); - - }; - - // Show a bubble when there was a conflict - SparkleShare.Controller.ConflictNotificationRaised += delegate { - Application.Invoke (delegate { - - string title = _("Ouch! Mid-air collision!"); - string subtext = _("Don't worry, SparkleShare made a copy of each conflicting file."); - - SparkleBubble bubble = new SparkleBubble(title, subtext); -// bubble.Show (); - - }); - }; + + } - - // Runs the application + public void Run () { - - Application.Run (); - + + NSApplication.Main (new string [0]); + } - + } - -} \ No newline at end of file + +} diff --git a/SparkleShare/Mac/SparkleShare/SparkleWindow.cs b/SparkleShare/Mac/SparkleShare/SparkleWindow.cs new file mode 100644 index 00000000..fb8ebb9c --- /dev/null +++ b/SparkleShare/Mac/SparkleShare/SparkleWindow.cs @@ -0,0 +1,73 @@ +// SparkleShare, an instant update workflow to Git. +// Copyright (C) 2010 Hylke Bons +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + +using System; +using System.Drawing; +using MonoMac.Foundation; +using MonoMac.AppKit; +using MonoMac.ObjCRuntime; +using MonoMac.WebKit; + +namespace SparkleShare { + + public class SparkleWindow : NSWindow { + + public readonly string LocalPath; + + private WebView WebView; + private NSButton CloseButton; + private NSButton OpenFolderButton; + + private NSImage SideSplash; + + public SparkleWindow () : base () + { + + SetFrame (new RectangleF (0, 0, 640, 480), true); + + Center (); + + StyleMask = (NSWindowStyle.Closable | + NSWindowStyle.Miniaturizable | + NSWindowStyle.Titled); + + MaxSize = new SizeF (640, 480); + MinSize = new SizeF (640, 480); + HasShadow = true; + BackingType = NSBackingStore.Buffered; + + SideSplash = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/side-splash.png"); + SideSplash.Size = new SizeF (150, 480); + + + NSText tv = new NSText (new RectangleF (200, 200, 200, 200)) { + Value = "TEST" + }; + + ContentView.AddSubview (new NSImageView (new RectangleF (0, 0, 150, 480)) { Image = SideSplash}); + ContentView.AddSubview (new NSTextField (new RectangleF (200, 100, 128, 31)) { BezelStyle = NSTextFieldBezelStyle.Rounded}); + + + + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + MakeKeyAndOrderFront (this); + + } + + } + +}