protected override void OnExecute(CommandProcessor theProcessor)
 {
     // backup
     if (_studyXml.Contains(_seriesUid))
     {
         Platform.Log(LogLevel.Info, "Removing SOP {0} from StudyXML for study {1}", _sopInstanceUid, _studyInstanceUid);
         _oldInstanceXml = _studyXml[_seriesUid][_sopInstanceUid];
         if (!_studyXml.RemoveInstance(_seriesUid, _sopInstanceUid))
         {
             throw new ApplicationException(String.Format("Could not remove SOP Instance {0} from study {1}", _sopInstanceUid, _studyInstanceUid));
         }
     }
 }
        protected override void OnExecute(CommandProcessor commandProcessor)
        {
            _instanceXml = _studyXml.FindInstanceXml(_seriesInstanceUid, _sopInstanceUid);

            _studyXml.RemoveInstance(_seriesInstanceUid, _sopInstanceUid);

            // flush it into disk
            // Write it back out.  We flush it out with every added image so that if a failure happens,
            // we can recover properly.
            if (!commandProcessor.ExecuteSubCommand(this, new SaveXmlCommand(_studyXml, _studyLocation)))
            {
                throw new ApplicationException(commandProcessor.FailureReason);
            }
        }
 protected override void OnUndo()
 {
     _stream.RemoveInstance(_seriesInstanceUid, _sopInstanceUid);
 }