Jump to content


Need help on this piece of code, what is occurring in the following pi

what is occurring?

  • Please log in to reply
No replies to this topic

#1 lukan

lukan

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 22 November 2012 - 12:55 AM

public static ExportState Load( DirectoryInfo diTempFolder ) {
XmlSerializer xsSerializer = null;
StreamReader srReader = null;
FileInfo fi = null;
ExportState state = null;

try {
if( diTempFolder != null ) {
if( !diTempFolder.Exists ) {
diTempFolder.Create();
}
fi = new FileInfo( Path.Combine( diTempFolder.FullName, Constants.FNAME_EXPORT_STATE ) );
xsSerializer = new XmlSerializer( typeof( ExportState ) );
srReader = new StreamReader( fi.FullName, System.Text.Encoding.UTF8 );
state = (ExportState)xsSerializer.Deserialize( srReader );
state.TempDirectory = diTempFolder;
}
return state;
} finally {
if( srReader != null ) {
srReader.Close();
}
}
}


  • 0





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users