~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/tools/mdmonitor/Main.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
using System;
27
27
using Gtk;
28
28
using MonoDevelop.Core.Instrumentation;
 
29
using MonoDevelop.MacInterop;
29
30
 
30
31
namespace Mono.Instrumentation.Monitor
31
32
{
63
64
                        
64
65
                        InstrumentationViewerDialog win = new InstrumentationViewerDialog ();
65
66
                        win.Show ();
 
67
                        
 
68
                        if (MacIntegration.PlatformDetection.IsMac) {
 
69
                                try {
 
70
                                        Carbon.SetProcessName ("MDMonitor");
 
71
                                        
 
72
                                        ApplicationEvents.Quit += delegate (object sender, ApplicationQuitEventArgs e) {
 
73
                                                Application.Quit ();
 
74
                                                e.Handled = true;
 
75
                                        };
 
76
                                        
 
77
                                        ApplicationEvents.Reopen += delegate (object sender, ApplicationEventArgs e) {
 
78
                                                if (win != null) {
 
79
                                                        win.Deiconify ();
 
80
                                                        win.Visible = true;
 
81
                                                        e.Handled = true;
 
82
                                                }
 
83
                                        };
 
84
                                } catch (Exception ex) {
 
85
                                        Console.Error.WriteLine ("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex);
 
86
                                }
 
87
                                try {
 
88
                                        win.InstallMacGlobalMenu ();
 
89
                                } catch (Exception ex) {
 
90
                                        Console.Error.WriteLine ("Installing Mac IGE Main Menu failed. Skipping.\n" + ex);
 
91
                                }
 
92
                        }
 
93
                        
66
94
                        Application.Run ();
67
95
                }
68
96