~ubuntu-branches/ubuntu/saucy/monodevelop/saucy-proposed

« back to all changes in this revision

Viewing changes to src/tools/MacCrashLogger/AppDelegate.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields, 1840cc1
  • Date: 2012-02-05 10:49:36 UTC
  • mfrom: (10.2.12)
  • Revision ID: package-import@ubuntu.com-20120205104936-f3dutq6lnseokb6d
Tags: 2.8.6.3+dfsg-1
[1840cc1] Imported Upstream version 2.8.6.3+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
using MonoMac.ObjCRuntime;
32
32
 
33
33
using MonoDevelop;
34
 
using MonoDevelop.Monitoring;
35
 
using MonoDevelop.CrashReporting;
36
 
using MonoDevelop.CrashLog;
 
34
using MonoDevelop.Core.LogReporting;
37
35
 
38
36
namespace MacCrashLogger
39
37
{
40
38
        public partial class AppDelegate : NSApplicationDelegate
41
39
        {
42
 
                ICrashMonitor Monitor {
43
 
                        get; set;
44
 
                }
45
 
                
46
 
                bool ProcessingCrashLog {
47
 
                        get; set;
48
 
                }
49
 
                
50
 
                CrashReporter Reporter {
51
 
                        get; set;
52
 
                }
53
 
                
54
 
                bool ShouldExit {
55
 
                        get; set;
56
 
                }
57
 
                
58
 
                public AppDelegate ()
59
 
                {
60
 
                        Reporter = new CrashReporter (CrashLogOptions.LogPath, CrashLogOptions.Email);
61
 
                        
62
 
                        Monitor = CrashMonitor.Create (CrashLogOptions.Pid);
63
 
                        Monitor.ApplicationExited += HandleMonitorApplicationExited;
64
 
                        Monitor.CrashDetected += HandleMonitorCrashDetected;
65
 
                }
66
 
                
67
 
                public override void FinishedLaunching (NSObject notification)
68
 
                {
69
 
                        Monitor.Start ();
70
 
                        Reporter.ProcessCache ();
71
 
                }
72
 
                
73
 
                void HandleMonitorCrashDetected (object sender, CrashEventArgs e)
74
 
                {
75
 
                        InvokeOnMainThread (() => {
76
 
                                try {
77
 
                                        ProcessingCrashLog = true;
78
 
                                        Reporter.UploadOrCache (e.CrashLogPath);
79
 
                                        
80
 
                                        if (ShouldExit)
81
 
                                                NSApplication.SharedApplication.Terminate (this);
82
 
                                } finally {
83
 
                                        ProcessingCrashLog = false;
84
 
                                }
85
 
                        });
86
 
                }
87
 
 
88
 
                void HandleMonitorApplicationExited (object sender, EventArgs e)
89
 
                {
90
 
                        InvokeOnMainThread (() => {
91
 
                                ShouldExit = true;
92
 
                                if (!ProcessingCrashLog) {
93
 
                                        NSApplication.SharedApplication.Terminate (null);
94
 
                                }
95
 
                        });
96
 
                }
 
40
//              ICrashMonitor Monitor {
 
41
//                      get; set;
 
42
//              }
 
43
//              
 
44
//              bool ProcessingCrashLog {
 
45
//                      get; set;
 
46
//              }
 
47
//              
 
48
//              CrashReporter Reporter {
 
49
//                      get; set;
 
50
//              }
 
51
//              
 
52
//              bool ShouldExit {
 
53
//                      get; set;
 
54
//              }
 
55
//              
 
56
//              public AppDelegate ()
 
57
//              {
 
58
//                      Reporter = new CrashReporter (CrashLogOptions.LogPath, CrashLogOptions.Email);
 
59
//                      
 
60
//                      Monitor = CrashMonitor.Create (CrashLogOptions.Pid);
 
61
//                      Monitor.ApplicationExited += HandleMonitorApplicationExited;
 
62
//                      Monitor.CrashDetected += HandleMonitorCrashDetected;
 
63
//              }
 
64
//              
 
65
//              public override void FinishedLaunching (NSObject notification)
 
66
//              {
 
67
//                      Monitor.Start ();
 
68
//                      Reporter.ProcessCache ();
 
69
//              }
 
70
//              
 
71
//              void HandleMonitorCrashDetected (object sender, CrashEventArgs e)
 
72
//              {
 
73
//                      InvokeOnMainThread (() => {
 
74
//                              try {
 
75
//                                      ProcessingCrashLog = true;
 
76
//                                      Reporter.UploadOrCache (e.CrashLogPath);
 
77
//                                      
 
78
//                                      if (ShouldExit)
 
79
//                                              NSApplication.SharedApplication.Terminate (this);
 
80
//                              } finally {
 
81
//                                      ProcessingCrashLog = false;
 
82
//                              }
 
83
//                      });
 
84
//              }
 
85
//
 
86
//              void HandleMonitorApplicationExited (object sender, EventArgs e)
 
87
//              {
 
88
//                      InvokeOnMainThread (() => {
 
89
//                              ShouldExit = true;
 
90
//                              if (!ProcessingCrashLog) {
 
91
//                                      NSApplication.SharedApplication.Terminate (null);
 
92
//                              }
 
93
//                      });
 
94
//              }
97
95
        }
98
96
}
 
 
b'\\ No newline at end of file'