private void btnReaderRead_Click(object sender, EventArgs e)
        {
            try
            {
                _sdataResourceCollectionRequest = new SDataResourceCollectionRequest(Service)
                                                  {
                                                      ResourceKind = tbCollectionResourceKind.Text,
                                                      StartIndex = (int) numStartIndex.Value,
                                                      Count = (int) numCount.Value
                                                  };

                _feed = null;
                _reader = _sdataResourceCollectionRequest.ExecuteReader();

                tbReaderCount.Text = _reader.Count.ToString();

                UpdateReaderGrid();
            }
            catch (SDataClientException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void UpdateCollection()
        {
            try
            {
                _sdataResourceCollectionRequest = new SDataResourceCollectionRequest(Service)
                                                  {
                                                      ResourceKind = tbCollectionResourceKind.Text,
                                                      StartIndex = (int) numStartIndex.Value,
                                                      Count = (int) numCount.Value
                                                  };
                _feed = _sdataResourceCollectionRequest.Read();
                _reader = null;

                var lookup = _feed.Links.ToLookup(link => link.Relation);
                btnFirst.Enabled = lookup["first"].Any();
                btnPrevious.Enabled = lookup["previous"].Any();
                btnNext.Enabled = lookup["next"].Any();
                btnLast.Enabled = lookup["last"].Any();

                var table = new DataTable();
                table.Columns.Add("Author");
                table.Columns.Add("Id");
                table.Columns.Add("Title");

                // iterate through the list of entries in the feed
                foreach (var atomentry in _feed.Entries)
                {
                    var dr = table.NewRow();
                    dr[0] = atomentry.Authors.Select(author => author.Name).FirstOrDefault();
                    dr[1] = atomentry.Id.Uri.AbsoluteUri;
                    dr[2] = atomentry.Title.Content;

                    table.Rows.Add(dr);
                }

                // show it in the grid
                atomEntryGrid.DataSource = table;
                atomEntryGrid.Refresh();
                atomEntryGrid.AutoResizeColumns();

                if (atomEntryGrid.SelectedRows.Count != 0)
                {
                    atomEntryGrid_CellContentClick(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 /// <summary>
 /// Performs initial read from AtomFeedReader
 /// </summary>
 /// <returns></returns>
 public AtomFeedReader ExecuteReader()
 {
     var reader = new AtomFeedReader(this);
     return reader.Read() ? reader : null;
 }