/// <summary>Creates a new thread and starts it.</summary>
            public VscThread(VolumeShadowCopySession session)
            {
                _session = session;

                var thread = new Thread(this.Main);

                thread.Start();
            }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
        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;
        }