/// <devdoc> /// If the stream we are asked for represents a user.config file that we know about, we wrap it in a /// QuotaEnforcedStream, after asking the host to assert appropriate permissions./// /// </devdoc> public override Stream OpenStreamForWrite(string streamName, string templateStreamName, ref object writeContext) { Stream stream = null; if (String.Equals(streamName, ConfigurationManagerInternalFactory.Instance.ExeLocalConfigPath, StringComparison.OrdinalIgnoreCase)) { stream = new QuotaEnforcedStream( Host.OpenStreamForWrite(streamName, templateStreamName, ref writeContext, true), false); } else if (String.Equals(streamName, ConfigurationManagerInternalFactory.Instance.ExeRoamingConfigPath, StringComparison.OrdinalIgnoreCase)) { stream = new QuotaEnforcedStream( Host.OpenStreamForWrite(streamName, templateStreamName, ref writeContext, true), true); } else { stream = Host.OpenStreamForWrite(streamName, templateStreamName, ref writeContext); } return(stream); }
/// <devdoc> /// If the stream we are asked for represents a user.config file that we know about, we wrap it in a /// QuotaEnforcedStream, after asking the host to assert appropriate permissions./// /// </devdoc> public override Stream OpenStreamForWrite(string streamName, string templateStreamName, ref object writeContext) { Stream stream = null; if (String.Equals(streamName, ConfigurationManagerInternalFactory.Instance.ExeLocalConfigPath, StringComparison.OrdinalIgnoreCase)) { stream = new QuotaEnforcedStream( Host.OpenStreamForWrite(streamName, templateStreamName, ref writeContext, true), false); } else if (String.Equals(streamName, ConfigurationManagerInternalFactory.Instance.ExeRoamingConfigPath, StringComparison.OrdinalIgnoreCase)) { stream = new QuotaEnforcedStream( Host.OpenStreamForWrite(streamName, templateStreamName, ref writeContext, true), true); } else { stream = Host.OpenStreamForWrite(streamName, templateStreamName, ref writeContext); } return stream; }