lukan

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About lukan

  • Rank
    Newbie
  1. 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(); } } }