public override void Initialize(string name, NameValueCollection attributes)
 {
     if (attributes != null)
     {
         if (string.IsNullOrEmpty(attributes["description"]))
         {
             attributes.Remove("description");
             attributes.Add("description", base.GetType().Name);
         }
         ProviderUtil.GetAndRemoveBooleanAttribute(attributes, "securityTrimmingEnabled", this.Name, ref this._securityTrimmingEnabled);
     }
     base.Initialize(name, attributes);
 }
 public override void Initialize(string name, NameValueCollection config)
 {
     ProviderUtil.GetAndRemoveBooleanAttribute(config, "buffer", name, ref this._buffer);
     if (this._buffer)
     {
         ProviderUtil.GetAndRemoveRequiredNonEmptyStringAttribute(config, "bufferMode", name, ref this._bufferMode);
         this._webEventBuffer = new WebEventBuffer(this, this._bufferMode, new WebEventBufferFlushCallback(this.ProcessEventFlush));
     }
     else
     {
         ProviderUtil.GetAndRemoveStringAttribute(config, "bufferMode", name, ref this._bufferMode);
     }
     base.Initialize(name, config);
     ProviderUtil.CheckUnrecognizedAttributes(config, name);
 }
        public override void Initialize(string name, NameValueCollection config)
        {
            // create buffer according to the buffer mode settings specified, like we do in sql/mail providers
            // wire up the delegate to the ProcessEventFlush method
            Debug.Trace("BufferedWebEventProvider", "Initializing: name=" + name);

            ProviderUtil.GetAndRemoveBooleanAttribute(config, "buffer", name, ref _buffer);

            if (_buffer)
            {
                ProviderUtil.GetAndRemoveRequiredNonEmptyStringAttribute(config, "bufferMode", name, ref _bufferMode);
                _webEventBuffer = new WebEventBuffer(this, _bufferMode, new WebEventBufferFlushCallback(this.ProcessEventFlush));
            }
            else
            {
                ProviderUtil.GetAndRemoveStringAttribute(config, "bufferMode", name, ref _bufferMode);
            }

            base.Initialize(name, config);

            ProviderUtil.CheckUnrecognizedAttributes(config, name);
        }
Example #4
0
        public override void Initialize(string name, NameValueCollection config)
        {
            Debug.Trace("TemplatedMailWebEventProvider", "Initializing: name=" + name);

            ProviderUtil.GetAndRemoveStringAttribute(config, "template", name, ref _templateUrl);

            if (_templateUrl == null)
            {
                throw new ConfigurationErrorsException(SR.GetString(SR.Provider_missing_attribute, "template", name));
            }

            _templateUrl = _templateUrl.Trim();

            if (_templateUrl.Length == 0)
            {
                throw new ConfigurationErrorsException(SR.GetString(SR.Invalid_provider_attribute, "template", name, _templateUrl));
            }

            if (!UrlPath.IsRelativeUrl(_templateUrl))
            {
                throw new ConfigurationErrorsException(SR.GetString(SR.Invalid_mail_template_provider_attribute,
                                                                    "template", name, _templateUrl));
            }

            _templateUrl = UrlPath.Combine(HttpRuntime.AppDomainAppVirtualPathString, _templateUrl);

            // VSWhidbey 440081: Guard against templates outside the AppDomain path
            if (!HttpRuntime.IsPathWithinAppRoot(_templateUrl))
            {
                throw new ConfigurationErrorsException(SR.GetString(SR.Invalid_mail_template_provider_attribute,
                                                                    "template", name, _templateUrl));
            }

            ProviderUtil.GetAndRemoveBooleanAttribute(config, "detailedTemplateErrors", name, ref _detailedTemplateErrors);

            base.Initialize(name, config);
        }
 public override void Initialize(string name, NameValueCollection config)
 {
     ProviderUtil.GetAndRemoveStringAttribute(config, "template", name, ref this._templateUrl);
     if (this._templateUrl == null)
     {
         throw new ConfigurationErrorsException(System.Web.SR.GetString("Provider_missing_attribute", new object[] { "template", name }));
     }
     this._templateUrl = this._templateUrl.Trim();
     if (this._templateUrl.Length == 0)
     {
         throw new ConfigurationErrorsException(System.Web.SR.GetString("Invalid_provider_attribute", new object[] { "template", name, this._templateUrl }));
     }
     if (!System.Web.Util.UrlPath.IsRelativeUrl(this._templateUrl))
     {
         throw new ConfigurationErrorsException(System.Web.SR.GetString("Invalid_mail_template_provider_attribute", new object[] { "template", name, this._templateUrl }));
     }
     this._templateUrl = System.Web.Util.UrlPath.Combine(HttpRuntime.AppDomainAppVirtualPathString, this._templateUrl);
     if (!HttpRuntime.IsPathWithinAppRoot(this._templateUrl))
     {
         throw new ConfigurationErrorsException(System.Web.SR.GetString("Invalid_mail_template_provider_attribute", new object[] { "template", name, this._templateUrl }));
     }
     ProviderUtil.GetAndRemoveBooleanAttribute(config, "detailedTemplateErrors", name, ref this._detailedTemplateErrors);
     base.Initialize(name, config);
 }