public CompendiumItemsOverviewPage() { InitializeComponent(); Refresh = new Command(async() => { Entries.ReplaceRange(new List <string>()); if (IsBusy) { return; } IsBusy = true; await PCLSourceManager.InitAsync(); ConfigManager config = await Context.LoadConfigAsync(await PCLSourceManager.Data.GetFileAsync("Config.xml").ConfigureAwait(false)).ConfigureAwait(false); DependencyService.Get <IHTMLService>().Reset(config); Entries.Add("Items"); foreach (string s in await PCLImport.EnumerateCategories(Context, Context.Config.Items_Directory)) { Entries.Add(s); } IsBusy = false; }); Title = "Item Categories"; BindingContext = this; }
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); } }
public CompendiumBackgroundsPage() { InitializeComponent(); Refresh = new Command(async() => { Entries.ReplaceRange(new List <Background>()); if (IsBusy) { return; } IsBusy = true; await PCLSourceManager.InitAsync(); ConfigManager config = await Context.LoadConfigAsync(await PCLSourceManager.Data.GetFileAsync("Config.xml").ConfigureAwait(false)).ConfigureAwait(false); DependencyService.Get <IHTMLService>().Reset(config); await PCLImport.ImportBackgroundsAsync(Context); UpdateEntries(); IsBusy = false; }); Title = "Backgrounds"; BindingContext = this; }