/// <summary>Creates a new thread and starts it.</summary> public VscThread(VolumeShadowCopySession session) { _session = session; var thread = new Thread(this.Main); thread.Start(); }
public void Dispose() { if (_process != null) { _process.Dispose(); // incl. killing it if currently running + waiting for it to exit and the Exited event handler to complete _process = null; } if (_vscSession != null) { _vscSession.Dispose(); _vscSession = null; } }
private void StartInVscSession() { string sourceVolume = PathHelper.RemoveTrailingSeparator(Path.GetPathRoot(SourceFolder)); _vscSession = new VolumeShadowCopySession(); _vscSession.Error += VscSession_Error; _vscSession.Ready += VscSession_Ready; _status.OnEnterNewStage("Preparing...", string.Format("Creating shadow copy of volume {0} ...", PathHelper.Quote(sourceVolume))); // create and mount the shadow copy _vscSession.Start(SourceFolder); _status.IsAbortingSupported = true; }