public static string[] GetCurrentUserApplications() { if (_applications == null) { ISSOMapper mapper = new ISSOMapper(); AffiliateApplicationType appTypes = AffiliateApplicationType.ConfigStore; IPropertyBag propBag = (IPropertyBag)mapper; uint appFilterFlagMask = SSOFlag.SSO_FLAG_APP_FILTER_BY_TYPE; uint appFilterFlags = (uint)appTypes; object appFilterFlagsObj = appFilterFlags; object appFilterFlagMaskObj = appFilterFlagMask; propBag.Write("AppFilterFlags", ref appFilterFlagsObj); propBag.Write("AppFilterFlagMask", ref appFilterFlagMaskObj); string[] descs; string[] contacts; mapper.GetApplications(out _applications, out descs, out contacts); } return(_applications); }
public static IDictionary <string, string> GetApplications() { ISSOMapper ssoMapper = (ISSOMapper) new SSOMapper(); AffiliateApplicationType affiliateApplicationType = AffiliateApplicationType.ConfigStore; IPropertyBag propertyBag = (IPropertyBag)ssoMapper; uint num = 1; object ptrVar1 = (object)(uint)affiliateApplicationType; object ptrVar2 = (object)num; propertyBag.Write("AppFilterFlags", ref ptrVar1); propertyBag.Write("AppFilterFlagMask", ref ptrVar2); string[] applications = (string[])null; string[] descriptions = (string[])null; string[] contactInfo = (string[])null; ssoMapper.GetApplications(out applications, out descriptions, out contactInfo); Dictionary <string, string> dictionary1 = new Dictionary <string, string>(applications.Length); Dictionary <string, string> dictionary2 = new Dictionary <string, string>(applications.Length); for (int index = 0; index < applications.Length; ++index) { if (applications[index].StartsWith("{")) { dictionary2.Add(applications[index], descriptions[index]); } else { dictionary1.Add(applications[index], descriptions[index]); } } foreach (string key in dictionary2.Keys) { dictionary1.Add(key, dictionary2[key]); } return((IDictionary <string, string>)dictionary1); }
/// <summary> /// Retrieves the list of existing SSO applications /// </summary> /// <returns>List of application names</returns> public static string[] GetApplications() { if (Applications == null) { string[] descs; string[] contacts; ISSOMapper mapper = new ISSOMapper(); mapper.GetApplications(out Applications, out descs, out contacts); } return(Applications); }
/// <summary> /// Returns a list of applications in the SSO store /// </summary> /// <returns>Application names</returns> public static List <string> GetApplications() { //get the app list: string[] applications = null; string[] descs; string[] contacts = null; try { var mapper = new ISSOMapper(); AffiliateApplicationType appTypes = AffiliateApplicationType.ConfigStore; appTypes |= AffiliateApplicationType.All; IPropertyBag propBag = (IPropertyBag)mapper; uint appFilterFlagMask = SSOFlag.SSO_FLAG_APP_FILTER_BY_TYPE; uint appFilterFlags = (uint)appTypes; object appFilterFlagsObj = (object)appFilterFlags; object appFilterFlagMaskObj = (object)appFilterFlagMask; propBag.Write("AppFilterFlags", ref appFilterFlagsObj); propBag.Write("AppFilterFlagMask", ref appFilterFlagMaskObj); mapper.GetApplications(out applications, out descs, out contacts); } catch (COMException comEx) { HandleCOMException(comEx, 0); } List <string> apps = new List <string>(); if (contacts != null) { for (int i = 0; i < applications.Length; i++) { if (string.Equals(contacts[i], ApplicationManager.ContactInfo)) { apps.Add(applications[i]); } } } return(apps); }