Exemple #1
0
 private void CheckFirstRun()
 {
     if (MegaDesktop.Properties.Settings.Default.FirstRunLatestVer !=
         GoogleAnalytics.AppVersion)
     {
         GoogleAnalytics.SendTrackingRequest("FirstRun_Desktop");
         MegaDesktop.Properties.Settings.Default.FirstRunLatestVer =
             GoogleAnalytics.AppVersion;
         MegaDesktop.Properties.Settings.Default.Save();
     }
     else
     {
         GoogleAnalytics.SendTrackingRequest("Run_Desktop");
     }
 }
Exemple #2
0
        private void StartSync(Mega m, bool needResync)
        {
            api = m;
            m.SaveAccount(GetUserKeyFilePath());
            Invoke(new Action(() =>
            {
                buttonExit.Enabled = true;
                WindowState        = FormWindowState.Minimized;
            }));

            Log("Working...");


            var sync = new Sync(Properties.Settings.Default.folderPath, api, "sync");

            sync.ChangePerformed += (s, e) =>
            {
                Log("{0} [{1}]: {2}", e.IsLocal ? "local" : "remote", e.Time.ToShortTimeString(), e.Message);
            };
            sync.SyncError += (s, e) =>
            {
                Log("Synchronization error: {1} \r\n{0}", e.Exception, e.Message);
                Invoke(new Action(() =>
                {
                    notifyIcon1.ShowBalloonTip(60000, "Synchronization Error", e.Message + "\r\n" + e.Exception.Message, ToolTipIcon.Error);
                }));
                GoogleAnalytics.SendTrackingRequest("/SyncError");
            };
            sync.SyncEnded += (s, e) =>
            {
                Log("Sync ended at {0}", DateTime.Now.ToShortTimeString());
            };
            sync.SyncStarted += (s, e) =>
            {
                Log("Sync started at {0}", DateTime.Now.ToShortTimeString());
            };
            sync.StartSyncing(needResync);
        }
Exemple #3
0
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     GoogleAnalytics.SendTrackingRequest("/CurrentDomain_UnhandledException_" + e.ExceptionObject.GetType().Name);
 }
Exemple #4
0
 static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     GoogleAnalytics.SendTrackingRequest("/Application_ThreadException_" + e.Exception.GetType().Name);
 }
Exemple #5
0
 void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     GoogleAnalytics.SendTrackingRequest("/Desktop_Current_DispatcherUnhandledException_" + e.Exception.GetType().Name);
 }