private void Delete(SPProfileSyncProviderList managerList, string data) { foreach (var idData in data.Split('&')) { managerList.Remove(idData); } }
public SPProfileSyncPresenter(SPProfileSyncProvider syncSettings, SPProfileSyncProviderList settingsList, string baseUrl, string syncSettingsListKey) : this(syncSettings) { this.baseUrl = baseUrl; this.syncSettingsListKey = syncSettingsListKey; Init(); }
private void Add(SPProfileSyncProviderList managerList, string dataXml) { SPProfileSyncProvider spProfileSyncSettings; if (SPProfileSyncProvider.TryParse(dataXml, out spProfileSyncSettings)) { managerList.Add(spProfileSyncSettings); } }
private void TempStoreSPSyncSettingsList(bool delete) { var spProfileSyncSettingsListKey = Request.QueryString[SPProfileSyncControl.SettingsListKeyName]; if (!String.IsNullOrEmpty(spProfileSyncSettingsListKey)) { spSyncSettingsList = new SPProfileSyncProviderList(TemporaryStore.Get(new Guid(spProfileSyncSettingsListKey), delete)); } }
private static IEnumerable <SPProfileSyncProvider> GetProfileSyncProviders() { var profileSyncPlugin = Plugin; if (profileSyncPlugin != null) { var settingsList = new SPProfileSyncProviderList(profileSyncPlugin.Configuration.GetString(PropertyId.SPProfileSyncSettings)); return(settingsList.All()); } return(new List <SPProfileSyncProvider>()); }
private void ProcessSubmitedData(SPProfileSyncProviderList managerList) { if (!String.IsNullOrEmpty(hdnManagerAction.Value) && !String.IsNullOrEmpty(hdnManagerData.Value)) { switch (hdnManagerAction.Value) { case "add": Add(managerList, hdnManagerData.Value); break; case "delete": Delete(managerList, hdnManagerData.Value); break; } } }
private static string AddBtnLink(SPProfileSyncProviderList settingsList, string baseUrl) { const string functionCallback = "AddSyncSettings"; const string queryString = "?mode=add"; return(String.Format("javascript: Telligent_Modal.Open('{0}', {1}, {2}, {3})", String.Concat(baseUrl, ConfigurationModalRelativeUrl, queryString), AddEditModalWidth, AddEditModalHeight, functionCallback)); }
protected override void OnPreRender(EventArgs e) { if (Page.IsPostBack) { syncSettingsList = new SPProfileSyncProviderList(hdnSyncSettingsList.Value); } ProcessSubmitedData(syncSettingsList); hdnSyncSettingsList.Value = syncSettingsList.ToXml(); string syncSettingsListKey = TemporaryStore.Add(syncSettingsList.ToXml()).ToString(); var presenters = (from settings in syncSettingsList.All() orderby settings.Id select new SPProfileSyncPresenter(settings, syncSettingsList, BaseUrl, syncSettingsListKey)).ToList(); Bind(presenters, true); base.OnPreRender(e); SetControlStyles(); }
public static List <Control> HeaderButtons(SPProfileSyncProviderList settingsList, string contentDivId, string baseUrl) { var addBtn = new HtmlGenericControl("a") { InnerText = "Add" }; addBtn.Attributes["href"] = AddBtnLink(settingsList, baseUrl); addBtn.Attributes["class"] = "PanelSaveButton CommonTextButton"; addBtn.Attributes["style"] = "float: right;"; var deleteBtn = new HtmlGenericControl("a") { InnerText = "Delete Selected" }; deleteBtn.Attributes["href"] = String.Format("javascript: DeleteSelectedSyncSettings(jQuery('#{0}'))", contentDivId); deleteBtn.Attributes["class"] = "PanelSaveButton CommonTextButton"; deleteBtn.Attributes["style"] = "float: right;"; return(new List <Control> { addBtn, deleteBtn }); }
public void SetConfigurationPropertyValue(object value) { string xmlData = value != null?value.ToString() : String.Empty; syncSettingsList = new SPProfileSyncProviderList(xmlData); }