/// <summary> /// CUSTOM /// </summary> /// <param name="appName"></param> /// <returns></returns> public static HybridDictionary ReadApp(string appName) { try { SSOConfigStore ssoStore = new SSOConfigStore(); ConfigurationPropertyBag appMgmtBag = new ConfigurationPropertyBag(); ((ISSOConfigStore)ssoStore).GetConfigInfo(appName, idenifierGUID, SSOFlag.SSO_FLAG_RUNTIME, (IPropertyBag)appMgmtBag); return appMgmtBag.properties; } catch (Exception e) { System.Diagnostics.Trace.WriteLine(e.Message); throw; } }
/// <summary> /// Write method helps write configuration data /// </summary> /// <param name="appName">The name of the affiliate application to represent the configuration container to access</param> /// <param name="propName">The property name to write</param> /// <param name="propName">The property value to write</param> public static void Write(string appName, string[] propNames, string[] propValues) { try { SSOConfigStore ssoStore = new SSOConfigStore(); ConfigurationPropertyBag appMgmtBag = new ConfigurationPropertyBag(); for (int i = 0; i < propNames.Length; i++) { object currentValue = propValues[i]; string currentName = propNames[i].ToString(); appMgmtBag.Write(currentName, ref currentValue); } ((ISSOConfigStore)ssoStore).SetConfigInfo(appName, idenifierGUID, appMgmtBag); } catch (Exception e) { System.Diagnostics.Trace.WriteLine(e.Message); throw; } }
/// <summary> /// Read method helps get configuration data /// </summary> /// <param name="appName">The name of the affiliate application to represent the configuration container to access</param> /// <param name="propName">The property name to read</param> /// <returns> /// The value of the property stored in the given affiliate application of this component. /// </returns> public static string Read(string appName, string propName) { try { SSOConfigStore ssoStore = new SSOConfigStore(); ConfigurationPropertyBag appMgmtBag = new ConfigurationPropertyBag(); ((ISSOConfigStore)ssoStore).GetConfigInfo(appName, idenifierGUID, SSOFlag.SSO_FLAG_RUNTIME, (IPropertyBag)appMgmtBag); object propertyValue = null; appMgmtBag.Read(propName, out propertyValue, 0); return (string)propertyValue; } catch (Exception e) { System.Diagnostics.Trace.WriteLine(e.Message); throw; } }