public async Task<bool> OpenSpider( IStorageFile ISF ) { try { SpiderBook SBook = await SpiderBook.ImportFile( await ISF.ReadString(), true ); List<LocalBook> NData; if( Data != null ) { NData = new List<LocalBook>( Data.Cast<LocalBook>() ); if ( NData.Any( x => x.aid == SBook.aid ) ) { Logger.Log( ID, "Already in collection, updating the data", LogType.DEBUG ); NData.Remove( NData.First( x => x.aid == SBook.aid ) ); } } else { NData = new List<LocalBook>(); } NData.Add( SBook ); Data = NData; NotifyChanged( "SearchSet" ); return SBook.CanProcess || SBook.ProcessSuccess; } catch( Exception ex ) { Logger.Log( ID, ex.Message, LogType.ERROR ); } return false; }
public async void ImportTable() { IStorageFile ISF = await AppStorage.OpenFileAsync(".txt"); if (ISF == null) { return; } ViewSource.ConvDataSource.ImportTable(await ISF.ReadString()); ToggleSaveBtn(true); }
public async Task <bool> OpenSpider(IStorageFile ISF) { try { SpiderBook SBook = await SpiderBook.ImportFile(await ISF.ReadString(), true); BSData.ImportItem(SBook); return(SBook.CanProcess || SBook.ProcessSuccess); } catch (Exception ex) { // Logger.Log( ID, ex.Message, LogType.ERROR ); } return(false); }
private async void ImportBookSpider(object sender, RoutedEventArgs e) { IStorageFile ISF = await AppStorage.OpenFileAsync(".xml"); if (ISF == null) { return; } try { EditTarget.ImportSpider(new XRegistry(await ISF.ReadString(), null, false).Parameter("Procedures")); } catch (Exception ex) { ProcManager.PanelMessage(EditTarget, Res.SSTR("InvalidXML", ex.Message), LogType.ERROR); } }
private async void PickFile(object sender, RoutedEventArgs e) { if (LockedFile) { return; } Message.Text = ""; IStorageFile ISF = await AppStorage.OpenFileAsync(".xml"); if (ISF == null) { return; } UploadBtn.IsLoading = true; try { SelectedBook = await SpiderBook.ImportFile(await ISF.ReadString(), false); if (!SelectedBook.CanProcess) { StringResources stx = StringResources.Load("ERROR"); throw new InvalidDataException(stx.Str("HS_INVALID")); } FileName.Text = ISF.Name; int LDot = ISF.Name.LastIndexOf('.'); NameInput.PlaceholderText = ~LDot == 0 ? ISF.Name : ISF.Name.Substring(0, LDot); } catch (Exception ex) { Message.Text = ex.Message; } UploadBtn.IsLoading = false; }
public async Task<IStorageFile> FilterContent( IStorageFile Src ) { return await FilterContent( await AppStorage.MkTemp(), await Src.ReadString() ); }
public async Task<bool> OpenFile( IStorageFile ISF ) { try { ZoneSpider ZS = ReadZone( await ISF.ReadString() ); EnterZone( ZS ); return true; } catch ( Exception ex ) { Logger.Log( ID, ex.Message, LogType.WARNING ); } return false; }