1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
.Views
.Brail
.TestSite
.Controllers
17 using System
.Collections
;
18 using System
.Reflection
;
20 using Castle
.DynamicProxy
;
21 using Castle
.MonoRail
.Framework
;
25 public class HomeController
: Controller
29 this.PropertyBag
.Add("CustomerName", "hammett");
30 string[] textArray1
= new string[] { "1", "2", "3" }
;
31 this.PropertyBag
.Add("List", textArray1
);
34 public void ComplexNestedExpressions()
36 PropertyBag
["title"] = "first";
37 PropertyBag
["pageIndex"] = 5;
40 public void ComplexNestedExpressions2()
42 PropertyBag
["title"] = "first";
43 PropertyBag
["pageIndex"] = 5;
48 this.PropertyBag
.Add("CustomerName", "hammett");
49 string[] textArray1
= new string[] { "1", "2", "3" }
;
50 this.PropertyBag
.Add("List", textArray1
);
57 public void HelloFromCommon()
65 public void WithNothingAfterTheLastSeperator()
70 public void WithDynamicProxyObject()
72 ProxyGenerator generator
= new ProxyGenerator();
73 object o
= generator
.CreateClassProxy(typeof(SimpleProxy
),new StandardInterceptor());
76 o
.GetType().GetProperty("Text");
77 throw new InvalidOperationException("Should have gotten AmbiguousMatchException here");
82 PropertyBag
["src"] = o
;
85 public class SimpleProxy
87 public virtual string Text
89 get { return "BarBaz"; }
94 public void NullableProperties()
96 Foo
[] fooArray1
= new Foo
[] { new Foo("Bar"), new Foo(null), new Foo("Baz") }
;
97 this.PropertyBag
.Add("List", fooArray1
);
100 public void Nullables()
102 this.PropertyBag
.Add("doesExists", "foo");
105 public void PreProcessor()
107 this.PropertyBag
.Add("Title", "Ayende");
110 public void RedirectAction()
112 this.Redirect("home", "index");
115 public void RedirectForOtherArea()
117 this.Redirect("subrea", "home", "index");
120 public void ShowEmptyList()
122 this.PropertyBag
.Add("dic", new Hash());
123 this.RenderView("ShowList");
126 public void ShowList()
128 Hashtable values
= new Hashtable();
129 values
.Add("Ayende", "Rahien");
130 values
.Add("Foo", "Bar");
131 this.PropertyBag
.Add("dic", values
);
134 public void Welcome()
136 this.RenderView("heyhello");
139 public void Repeater()
144 public void NamespacesInConfig()
149 public void SubView()
154 public void Javascript()
159 public void Javascript2()
164 public void UsingQuotes()
169 public void DuckOverloadToString()
171 PropertyBag
["birthday"] = new DateTime(1981, 12, 20);
174 public void NullPropagation()