/// <devdoc>
/// We delegate this to the ClientConfigurationHost. The only thing we need to do here is to
/// build a configPath from the ConfigurationUserLevel we get passed in.
/// </devdoc>
public override void InitForConfiguration(ref string locationSubPath, out string configPath, out string locationConfigPath,
IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams)
{
ConfigurationUserLevel userLevel = (ConfigurationUserLevel)hostInitConfigurationParams[0];
string desiredConfigPath = null;
Host = (IInternalConfigHost)TypeUtil.CreateInstanceWithReflectionPermission(ClientConfigurationHostTypeName);
switch (userLevel)
{
case ConfigurationUserLevel.None:
desiredConfigPath = ClientHost.GetExeConfigPath();
break;
case ConfigurationUserLevel.PerUserRoaming:
desiredConfigPath = ClientHost.GetRoamingUserConfigPath();
break;
case ConfigurationUserLevel.PerUserRoamingAndLocal:
desiredConfigPath = ClientHost.GetLocalUserConfigPath();
break;
default:
throw new ArgumentException(SR.GetString(SR.UnknownUserLevel));
}
Host.InitForConfiguration(ref locationSubPath, out configPath, out locationConfigPath, configRoot, null, null, desiredConfigPath);
}