Sign in to follow this  
Followers 0
lukan

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

1 post in this topic

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0