OpenObject
(
String sFileName,
out Object oObject
)
{
Debug.Assert( !String.IsNullOrEmpty(sFileName) );
Debug.Assert( File.Exists(sFileName) );
AssertValid();
oObject = null;
String sWorkbookSettings = FileUtil.ReadTextFile(sFileName);
// Test for valid XML.
XmlDocument oXmlDocument = new XmlDocument();
try
{
oXmlDocument.LoadXml(sWorkbookSettings);
}
catch (XmlException)
{
throw new XmlException(
"This does not appear to be a NodeXL options file."
);
}
oObject = sWorkbookSettings;
}