private void InitProperties(IRailsEngineContext myContext, Controller myController)
{
properties = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
//properties.Add("dsl", new DslWrapper(this));
properties.Add("Controller", myController);
properties.Add("request", myContext.Request);
properties.Add("response", myContext.Response);
properties.Add("session", myContext.Session);
if (myController.Resources != null)
{
foreach (object key in myController.Resources.Keys)
{
properties.Add(key, new ResourceToDuck(myController.Resources[key]));
}
}
foreach (string key in myController.Params.AllKeys)
{
if (key == null)
continue;
properties[key] = myContext.Params[key];
}
foreach (DictionaryEntry entry in myContext.Flash)
{
properties[entry.Key] = entry.Value;
}
foreach (DictionaryEntry entry in myController.PropertyBag)
{
properties[entry.Key] = entry.Value;
}
foreach (DictionaryEntry entry in myController.Helpers)
{
properties[entry.Key] = entry.Value;
}
properties["siteRoot"] = myContext.ApplicationPath;
}