public AvegaContactService(GoogleContactService googleContactService, IAvegaClientRepository avegaClientRepository) { GoogleContactService = googleContactService; AvegaClientRepository = avegaClientRepository; AvegaClientRepository.ContactDataFetched += (sender, ev) => { if (ContactDataFetched != null) ContactDataFetched(sender, ev); }; GoogleContactService.Warning += (sender, ev) => { if (Warning != null) Warning(sender, ev); }; }
protected void googleButton_Click(object sender, EventArgs e) { if (Session["serStatus"] != null) { GoogleContactService objService1 = new GoogleContactService(); List <ContactDetail> contactDetails = objService1.GetContacts((GooglePlusAccessToken)Session["serStatus"]); BindDataToDrid(contactDetails); } else { RedirectTOGoogle(); } }
public void ListAllContacts() { string code = Request.QueryString["code"]; string google_client_id = ConfigurationManager.AppSettings["google_client_id"].ToString(); string google_client_sceret = ConfigurationManager.AppSettings["google_client_sceret"].ToString(); string google_redirect_url = ConfigurationManager.AppSettings["google_redirect_url"].ToString(); /*Get Access Token and Refresh Token*/ GoogleContactService objService = new GoogleContactService(); GooglePlusAccessToken serStatus = objService.getAccessToken(code, google_client_id, google_client_sceret, google_redirect_url); /*End*/ List <ContactDetail> contactDetails = objService.GetContacts(serStatus); BindDataToDrid(contactDetails); }