Example #1
0
 /// <summary>
 /// Closes the current project and releases all data associated with it
 /// </summary>
 public static void Close()
 {
     if (CurrentProject != null)
     {
         CurrentProject.Dispose();
         CurrentProject = null;
     }
 }
Example #2
0
        /// <summary>
        /// Implementation for <see cref="AbstractMonitoringService.StopMonitoring"/>
        /// </summary>
        protected override void StopMonitoringImpl()
        {
            if (CurrentMonitor != null && CurrentSrcMLArchive != null)
            {
                SaveTimer.Stop();
                CurrentProject.StopMonitoring();

                CurrentMonitor.FileChanged             -= CurrentMonitor_FileChanged;
                CurrentMonitor.DirectoryAdded          -= CurrentMonitor_DirectoryAdded;
                CurrentMonitor.DirectoryRemoved        -= CurrentMonitor_DirectoryRemoved;
                CurrentMonitor.UpdateArchivesStarted   -= CurrentMonitor_UpdateArchivesStarted;
                CurrentMonitor.UpdateArchivesCompleted -= CurrentMonitor_UpdateArchivesCompleted;

                CurrentProject.Dispose();
                CurrentProject = null;
                CurrentMonitor = null;
            }
        }
 /// <summary>
 /// SrcML service stops monitoring the opened solution.
 /// </summary>
 public void StopMonitoring()
 {
     SrcMLFileLogger.DefaultLogger.Info("SrcMLGlobalService.StopMonitoring()");
     try {
         if (CurrentMonitor != null && CurrentSrcMLArchive != null)
         {
             OnMonitoringStopped(new EventArgs());
             SaveTimer.Stop();
             CurrentProject.StopMonitoring();
             CurrentMonitor.FileChanged      -= RespondToFileChangedEvent;
             CurrentMonitor.DirectoryAdded   -= RespondToDirectoryAddedEvent;
             CurrentMonitor.DirectoryRemoved -= RespondToDirectoryRemovedEvent;
             CurrentProject.Dispose();
             CurrentProject = null;
             CurrentMonitor = null;
         }
     } catch (Exception e) {
         SrcMLFileLogger.DefaultLogger.Error(SrcMLExceptionFormatter.CreateMessage(e, "Exception in SrcMLGlobalService.StopMonitoring()"));
     }
 }