// Specify what you want to happen when the Elapsed event is raised. void myTimer_Elapsed(object sender, ElapsedEventArgs e) { try { //Set the analytics account log.Info("Setting account..."); _Adapter = new GtAccountAdapter(); //Create the first account in the listAccounts. _Account = _Adapter.ConvertToGtAccount(_Section.AccountsItems[0]); log.Info("Account set..."); //Register Analytics Service log.Info("OnStart: Set down Analytics Service..."); _AnalyticsService = new GAnalyticsService(_Auth, _Account); log.Info("OnStart: Analytics Service On."); string xmlChoice = ConfigurationManager.AppSettings["SingleXml"]; Int32 chosen = Convert.ToInt32(xmlChoice); if (chosen == 1) { _AnalyticsService.getAllSingleResults(_Account); } else { _AnalyticsService.getAllResults(_Account); } //Writes in a xml file all the query responses. log.Info("Responses Retrieved..."); log.Info("Displaying responses..."); } catch (GDataRequestException ex) { log.Error("Excepción: " + ex.InnerException); } }
/// <summary> /// Handles the RowEnter event of the cbQueries control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.DataGridViewCellEventArgs"/> instance containing the event data.</param> private void cbAccounts_SelectedIndexChanged(object sender, EventArgs e) { GtAccount accountDetails = (GtAccount)cbAccounts.SelectedItem; GtAccountAdapter _Adapter = new GtAccountAdapter(); var section = _SettingsHandler.GetConfig(); _AccountList = _Adapter.ConvertToGtAccountList(section.AccountsItems); if (accountDetails == null) { throw new Exception("No account selected"); } }
public TrackingForm() { InitializeComponent(); _Auth = new Auth2Register(); _SettingsHandler = new GtSettingsHandler(); _Section = _SettingsHandler.GetConfig(); _Adapter = new GtAccountAdapter(); _AccountList = _Adapter.ConvertToGtAccountList(_Section.AccountsItems); //As DropDownList dataSource it's used a BidingSource with the object list we want displaying. cbAccounts.DataSource = new BindingSource(_AccountList, null); cbAccounts.DisplayMember = "Key"; }