public bool LoadDocument(IImportExportCmdletBaseDataObject cmdlet, string path) { try { var pathToImportFile = cmdlet.Path; if (!System.IO.File.Exists(pathToImportFile)) { throw new Exception( "There is no such file '" + cmdlet.Path + "'."); } ImportedDocument = XDocument.Load(pathToImportFile); return(true); } catch (Exception eImportDocument) { throw new Exception( "Unable to load an XML report from the file '" + path + "'. " + eImportDocument.Message); } }
public bool LoadDocument(IImportExportCmdletBaseDataObject cmdlet, string path) { try { var pathToImportFile = cmdlet.Path; if (!System.IO.File.Exists(pathToImportFile)) { throw new Exception( "There is no such file '" + cmdlet.Path + "'."); } ImportedDocument = XDocument.Load(pathToImportFile); return true; } catch (Exception eImportDocument) { throw new Exception( "Unable to load an XML report from the file '" + path + "'. " + eImportDocument.Message); } }