protected override void OnStart(string[] args) { try { log.Info("this is the first log message"); //Configure timer. _AutoUpdateTimer = new Timer(); _AutoUpdateTimer.Interval = Convert.ToDouble(ConfigurationManager.AppSettings["WinServiceTimer"]); _AutoUpdateTimer.Enabled = true; //Hook up the elapsed event for the Timer. _AutoUpdateTimer.Elapsed += new ElapsedEventHandler(myTimer_Elapsed); // Read configuration data. log.Info("OnStart: Reading configuration..."); _SettingsHandler = new GtSettingsHandler(); _Section = _SettingsHandler.GetConfig(); log.Info("Configuration Read..."); //Register on Google Authentication Server log.Info("OnStart: Registering on Google Authetication Server..."); _Auth = new Auth2Register(); //Create the Analytics Service. This will automatically call the previously registered authenticator. _Auth.RegisterAuthenticator(); log.Info("OnStart: Registered."); } catch (Exception e) { log.Error(e.Message); } }
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"; }