PageRenderTime 27ms CodeModel.GetById 21ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/DotNetSlave.BusinessLogic/Compilation/QueryStringExpressionBuilder.cs

#
C# | 68 lines | 31 code | 10 blank | 27 comment | 0 complexity | 6ca37485c091b9e803b5f25051a5b6ca MD5 | raw file
 1// --------------------------------------------------------------------------------------------------------------------
 2// <summary>
 3//   Query String Expression Builder
 4// </summary>
 5// --------------------------------------------------------------------------------------------------------------------
 6
 7namespace BlogEngine.Core.Compilation
 8{
 9    using System.Web;
10    using System.Web.Compilation;
11
12    /// <summary>
13    /// Query String Expression Builder
14    /// </summary>
15    [ExpressionPrefix("QueryString")]
16    [ExpressionEditor("BlogEngine.Core.Compilation.Design.QueryStringExpressionEditor, BlogEngine.Core")]
17    public class QueryStringExpressionBuilder : BaseServerObjectExpressionBuilder
18    {
19        #region Properties
20
21        /// <summary>
22        ///     Gets the name of the source object.
23        /// </summary>
24        /// <value>The name of the source object.</value>
25        public override string SourceObjectName
26        {
27            get
28            {
29                return "QueryString";
30            }
31        }
32
33        #endregion
34
35        #region Public Methods
36
37        /// <summary>
38        /// Creates a new instance of this expression builder.
39        /// </summary>
40        /// <returns>
41        /// A new instance of this expression builder.
42        /// </returns>
43        public static QueryStringExpressionBuilder Instance()
44        {
45            return new QueryStringExpressionBuilder();
46        }
47
48        #endregion
49
50        #region Methods
51
52        /// <summary>
53        /// Gets the value.
54        /// </summary>
55        /// <param name="key">
56        /// The key of the value to retrieve.
57        /// </param>
58        /// <returns>
59        /// The value.
60        /// </returns>
61        protected override object GetValue(string key)
62        {
63            return HttpContext.Current.Request.QueryString[key];
64        }
65
66        #endregion
67    }
68}