Fixing an issue with output parameters that are of type IntPtr
[castle.git] / MonoRail / Castle.MonoRail.Framework / Descriptors / ViewComponentDescriptor.cs
blob4171db81a2e2bc488b3af4b140547bf7ebd1dc14
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework.Descriptors
17 using Castle.MonoRail.Framework;
19 /// <summary>
20 /// Represents a <see cref="ViewComponent"/> cache configuration.
21 /// </summary>
22 public class ViewComponentDescriptor
24 /// <summary>
25 /// Represents an empty descriptor
26 /// </summary>
27 public static readonly ViewComponentDescriptor Empty = new ViewComponentDescriptor(false, ViewComponentCache.Disabled, null);
29 private readonly bool isCacheable;
30 private readonly ViewComponentCache cacheStrategy;
31 private readonly IViewComponentCacheKeyGenerator cacheKeyGenerator;
33 /// <summary>
34 /// Initializes a new instance of the <see cref="ViewComponentDescriptor"/> class.
35 /// </summary>
36 /// <param name="isCacheable">if set to <c>true</c> [is cacheable].</param>
37 /// <param name="cacheStrategy">The cache strategy.</param>
38 /// <param name="cacheKeyGenerator">The cache key generator.</param>
39 public ViewComponentDescriptor(bool isCacheable, ViewComponentCache cacheStrategy, IViewComponentCacheKeyGenerator cacheKeyGenerator)
41 this.isCacheable = isCacheable;
42 this.cacheStrategy = cacheStrategy;
43 this.cacheKeyGenerator = cacheKeyGenerator;
46 /// <summary>
47 /// Gets a value indicating whether the view component is cacheable.
48 /// </summary>
49 /// <value>
50 /// <c>true</c> if the View Component is cacheable; otherwise, <c>false</c>.
51 /// </value>
52 public bool IsCacheable
54 get { return isCacheable; }
57 /// <summary>
58 /// Gets the cache strategy.
59 /// </summary>
60 /// <value>The cache strategy.</value>
61 public ViewComponentCache CacheStrategy
63 get { return cacheStrategy; }
66 /// <summary>
67 /// Gets the cache key generator.
68 /// </summary>
69 /// <value>The cache key generator.</value>
70 public IViewComponentCacheKeyGenerator CacheKeyGenerator
72 get { return cacheKeyGenerator; }