public async static Task <PDF> Load(IFile file) { using (Stream s = await file.OpenAsync(PCLStorage.FileAccess.Read)) { PDF p = (PDF)PDF.Serializer.Deserialize(s); p.File = PCLImport.MakeRelativeFile(p.File); p.SpellFile = PCLImport.MakeRelativeFile(p.SpellFile); p.LogFile = PCLImport.MakeRelativeFile(p.LogFile); p.SpellbookFile = PCLImport.MakeRelativeFile(p.SpellbookFile); p.ActionsFile = PCLImport.MakeRelativeFile(p.ActionsFile); p.ActionsFile2 = PCLImport.MakeRelativeFile(p.ActionsFile2); return(p); } }
public async static Task <PDF> Load(FileInfo file) { using (Stream s = new FileStream(file.FullName, FileMode.Open)) { PDF p = await Task.Run(() => (PDF)PDF.Serializer.Deserialize(s)).ConfigureAwait(false); p.File = PCLImport.MakeRelativeFile(p.File); p.SpellFile = PCLImport.MakeRelativeFile(p.SpellFile); p.LogFile = PCLImport.MakeRelativeFile(p.LogFile); p.SpellbookFile = PCLImport.MakeRelativeFile(p.SpellbookFile); p.ActionsFile = PCLImport.MakeRelativeFile(p.ActionsFile); p.ActionsFile2 = PCLImport.MakeRelativeFile(p.ActionsFile2); return(p); } }