// STEP4 STEP4 STEP4 private string ReadWebRequestCallback(IAsyncResult callbackResult) { try { HttpWebRequest myRequest = (HttpWebRequest)callbackResult.AsyncState; HttpWebResponse myResponse = (HttpWebResponse)myRequest.EndGetResponse(callbackResult); using (StreamReader httpwebStreamReader = new StreamReader(myResponse.GetResponseStream())) { string fil = httpwebStreamReader.ReadToEnd(); FileToSave = fil; if (FileToSave != "") { FileManip f = new FileManip(); XML x = new XML(); list = x.Retrive(fil); if (list.Select(e=>e.Pubdate).Contains(LatestDate)) { } f.Update(Filename, FileToSave); } } myResponse.Close(); } catch (Exception we) { } }
public MainPage() { InitializeComponent(); FileManip m = new FileManip(); IEnumerable<ShellTile> tilelist = ShellTile.ActiveTiles; m.Delete(tilelist); Data = Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.IsCellularDataEnabled; if (!Data) { MessageBox.Show("Data connection is not enabled. Kindly switch it on and comeback"); Dispatcher.BeginInvoke(() => btn_Search.IsEnabled=false); Dispatcher.BeginInvoke(() => btn_SearchR.IsEnabled=false); } }
private void Create_Click(object sender, RoutedEventArgs e) { try { if (TXT_Create.Text != "") { FileManip f = new FileManip(); if (!f.LinkList(ShellTile.ActiveTiles).Contains(Link)) { string filename = f.CreateTile(FileToSave); if (filename != null) { ShellTile.Create(new Uri("/Navigate.xaml?Link=" + Link + "&FileName=" + filename, UriKind.RelativeOrAbsolute), new StandardTileData { Title = TXT_Create.Text, BackContent = list.First().Content }); } } else { Dispatcher.BeginInvoke(() => MessageBox.Show("Tile exist")); } } } catch { Dispatcher.BeginInvoke(() => MessageBox.Show("Error")); } }
private void ReadWebRequestCallback(IAsyncResult callbackResult) { try { HttpWebRequest myRequest = (HttpWebRequest)callbackResult.AsyncState; HttpWebResponse myResponse = (HttpWebResponse)myRequest.EndGetResponse(callbackResult); using (StreamReader httpwebStreamReader = new StreamReader(myResponse.GetResponseStream())) { string fil = httpwebStreamReader.ReadToEnd(); string FileToSave = fil; EasyPin.XML x = new EasyPin.XML(); list = x.Retrive(fil); FileManip manip = new FileManip(); if (manip.Update(filename, FileToSave) == "Updated") { Dispatcher.BeginInvoke(() => image1.Visibility = Visibility.Collapsed); Dispatcher.BeginInvoke(() => listBox1.ItemsSource = list); Dispatcher.BeginInvoke(() => listBox1.Visibility = Visibility.Visible); } } myResponse.Close(); } catch (Exception s) { Dispatcher.BeginInvoke(() => image1.Visibility = Visibility.Collapsed); Dispatcher.BeginInvoke(() => listBox1.Visibility = Visibility.Visible); } }