123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections;
- namespace URLRewriter.Config
- {
- /// <summary>
- /// The RewriterRuleCollection models a set of RewriterRules in the Web.config file.
- /// </summary>
- /// <remarks>
- /// The RewriterRuleCollection is expressed in XML as:
- /// <code>
- /// <RewriterRule>
- /// <LookFor><i>pattern to search for</i></LookFor>
- /// <SendTo><i>string to redirect to</i></LookFor>
- /// <RewriterRule>
- /// <RewriterRule>
- /// <LookFor><i>pattern to search for</i></LookFor>
- /// <SendTo><i>string to redirect to</i></LookFor>
- /// <RewriterRule>
- /// ...
- /// <RewriterRule>
- /// <LookFor><i>pattern to search for</i></LookFor>
- /// <SendTo><i>string to redirect to</i></LookFor>
- /// <RewriterRule>
- /// </code>
- /// </remarks>
- [Serializable()]
- public class RewriterRuleCollection : CollectionBase
- {
- /// <summary>
- /// Adds a new RewriterRule to the collection.
- /// </summary>
- /// <param name="r">A RewriterRule instance.</param>
- public virtual void Add(RewriterRule r)
- {
- this.InnerList.Add(r);
- }
- /// <summary>
- /// Gets or sets a RewriterRule at a specified ordinal index.
- /// </summary>
- public RewriterRule this[int index]
- {
- get
- {
- return (RewriterRule) this.InnerList[index];
- }
- set
- {
- this.InnerList[index] = value;
- }
- }
- }
- }
|