src/Foundation/Infrastructure/Gimela.Infrastructure.Serialization/FileSerializer.cs
/// <summary>
/// Deserialize an object from a file
/// </summary>
/// <typeparam name="T">Data type of object</typeparam>
/// <param name="uri">Full path to file</param>
/// <returns>New instance of the desired object</returns>
Deserialize an object from a file
Deserialize an object from a file
public static T LoadItem<T>(Uri uri)
    {
      if (uri == null)
        throw new ArgumentNullException("uri");
      T target = default(T);
      using (FileStream fs = new FileStream(uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read))
      {
        target = LoadItem<T>(fs);
      }
      return target;
    }
public static T LoadItem < T > ( Uri uri ) { if ( uri == null ) throw new ArgumentNullException ( " " ) ; T target = default ( T ) ; using ( FileStream fs = new FileStream ( uri . LocalPath , FileMode . Open , FileAccess . Read , FileShare . Read ) ) { target = LoadItem < T > ( fs ) ; } return target ; }
Deserialize an object from a file
Deserialize an object from a file
New instance of the desired object
New instance of the desired object
uri
Uri
Full path to file
Full path to file
typeparam
Data type of object
Data type of object