private void loadEventsInBackGround_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         DateTime startDate = calendarGetEvents_startDate.Value;
         DateTime endDate   = calendarGetEvents_endDate.Value;
         SortableBindingList <IndianCalendarEvent> test = calendarAPI.getEvents(startDate, endDate.AddHours(24), calendarGetEvents_SearchTextbox.Text);
         SpreadSheetAPI ssa   = new SpreadSheetAPI("Pair Results City And Event Names", "*****@*****.**", "kibitzer");
         DataTable      table = ssa.getValuesFromSheet("Sheet1");
         e.Result = Tuple.Create <SortableBindingList <IndianCalendarEvent>, DataTable>(test, table);
     }
     catch (Exception ex)
     {
         MessageBox.Show(" Here" + ex.Message);
         e.Result = null;
     }
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            TextBoxTraceListener _textBoxListener = new TextBoxTraceListener(calendarGetEvents_Status);

            Trace.Listeners.Add(_textBoxListener);
            try
            {
                CalendarAPI cApi = new CalendarAPI("*****@*****.**", "kibitzer");
                SortableBindingList <IndianCalendarEvent> test = cApi.getEvents(calendarGetEvents_startDate.Value, calendarGetEvents_endDate.Value, calendarGetEvents_SearchTextbox.Text);
                this.dataGridView1.DataSource = test;
                SpreadSheetAPI ssa   = new SpreadSheetAPI("Pair Results City And Event Names", "*****@*****.**", "kibitzer");
                DataTable      table = ssa.getValuesFromSheet("Sheet1");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Trace.Listeners.Remove(_textBoxListener);
        }