Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Samples / MonoRail / DiggPaginationSample / DiggExample / Controllers / HomeController.cs
bloba4e91730aab5448eae31dfec46a590c64256717f
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 DiggExample.Controllers
17 using System.Collections.Generic;
19 using Castle.MonoRail.Framework;
20 using Castle.MonoRail.Framework.Helpers;
22 using DiggExample.Model;
23 using NHibernate.Expression;
25 [Layout("default"), Rescue("generalerror")]
26 public class HomeController : SmartDispatcherController
28 public void Index()
32 public void IndexSelect1()
34 CreatePageWith10();
37 public void IndexSelect2()
39 CreatePageWith10();
42 public void IndexSelect3()
44 CreatePageWith10();
47 public void IndexSelect4()
49 CreatePageWith10();
52 public void Index1()
54 CreatePageWith10();
57 public void Index2()
59 CreatePageWith10();
62 public void Index3()
64 CreateRangedPage();
67 public void Index4()
69 CreateRangedPage();
72 public void Index5()
74 CreateRangedPage();
77 public void Index6()
79 CreatePageWith10();
81 public void Index7()
83 CreatePageWith10();
86 public void Index8(bool desc)
88 PropertyBag["items"] = PaginationHelper.CreatePagination<MyEntity>(
89 this,
90 MyEntity.FindAll(new Order("Index", (!desc))),
93 PropertyBag["desc"] = desc;
96 public void Index9()
98 CreatePageWith10();
101 private void CreatePageWith10()
103 PropertyBag["items"] = PaginationHelper.CreatePagination<MyEntity>(
104 this,
105 MyEntity.FindAll(new Order("Index", true)),
110 private void CreateRangedPage()
112 List<MyEntity> el = new List<MyEntity>(MyEntity.FindAll(new Order("Index", true)));
114 PropertyBag["items"] = PaginationHelper.CreatePagination<MyEntity>(
115 this,
116 el.GetRange(0, 5),