public SPRemoteEventResult ProcessInstallation(SPRemoteEventProperties properties) { SPRemoteEventResult result = new SPRemoteEventResult(); using (ClientContext clientContext = TokenHelper.CreateAppEventClientContext(properties, true)) { if (clientContext != null) { WebInformation parentWeb = clientContext.Web.ParentWeb; clientContext.Load(parentWeb); clientContext.ExecuteQuery(); List lst = clientContext.Web.Lists.GetByTitle("Configuration Values"); ListItem item = lst.AddItem(new ListItemCreationInformation()); item["Title"] = "AppInstalled"; item["Value"] = (parentWeb.WebTemplate == "APPCATALOG") ? "Tenant Installation" : "Web Installation"; item.Update(); clientContext.ExecuteQuery(); } } return(result); }
public virtual void Preprocess(SiteInformation siteCollection, WebInformation web, TimerJobRunEventArgs e) { }