private async Task PinRecord(PinRecord Record) { BookItem Book = await ItemProcessor.GetBookFromId(Record.Id); if (Book == null) { return; } TaskCompletionSource <bool> TCS = new TaskCompletionSource <bool>(); BookLoader BL = new BookLoader(async(b) => { if (b != null) { string TileId = await PageProcessor.PinToStart(Book); if (!string.IsNullOrEmpty(TileId)) { PM.RegPin(b, TileId, false); } } TCS.SetResult(true); }); BL.Load(Book); await TCS.Task; }
private async void PinSpider(object sender, RoutedEventArgs e) { string TileId = await PageProcessor.PinToStart(ThisBook); if (!string.IsNullOrEmpty(TileId)) { PinManager PM = new PinManager(); PM.RegPin(ThisBook, TileId, true); SpiderBook SpDef = await SpiderBook.CreateSAsync(ThisBook.ZItemId); await PageProcessor.RegLiveSpider(SpDef, ( BookInstruction )ThisBook, TileId); } }
private async void PinItemToStart(object sender, RoutedEventArgs e) { SpiderBook B = ( SpiderBook )(( FrameworkElement )sender).DataContext; if (B.ProcessSuccess) { BookInstruction Book = B.GetBook(); string TileId = await PageProcessor.PinToStart(Book); if (!string.IsNullOrEmpty(TileId)) { PinManager PM = new PinManager(); PM.RegPin(Book, TileId, true); await PageProcessor.RegLiveSpider(B, Book, TileId); } } }
private async void PinToStart_Click(object sender, RoutedEventArgs e) { if ((( FrameworkElement )sender).DataContext is GRRow <BookDisplay> BkRow) { BookItem BkItem = ItemProcessor.GetBookItem(BkRow.Source.Entry); string TileId = await PageProcessor.PinToStart(BkItem); if (!string.IsNullOrEmpty(TileId)) { PinManager PM = new PinManager(); PM.RegPin(BkItem, TileId, true); if (BkItem is BookInstruction BInst) { SpiderBook SBook = await SpiderBook.CreateSAsync(BkItem.ZoneId, BkItem.ZItemId, null); await PageProcessor.RegLiveSpider(SBook, BInst, TileId); } } } }