本文整理汇总了C#中Castle.RenderText方法的典型用法代码示例。如果您正苦于以下问题:C# Castle.RenderText方法的具体用法?C# Castle.RenderText怎么用?C# Castle.RenderText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Castle
的用法示例。
在下文中一共展示了Castle.RenderText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Perform
public bool Perform(Castle.MonoRail.Framework.ExecuteEnum when,
Castle.MonoRail.Framework.IRailsEngineContext context,
Castle.MonoRail.Framework.Controller controller)
{
try
{
User user = null;
if (context.Session.Contains(Constants.USER))
{
user = (User) context.Session[Constants.USER];
}
/*
if (context.Session[Constants.CATEGORIES_ACLS] == null)
{
Hashtable aclcat = Category.GetHashesByUser(user);
Hashtable aclmenu = Menu.GetHashByCategoryHash(aclcat);
context.Session[Constants.CATEGORIES_ACLS] = aclcat;
context.Session[Constants.MENUS_ACLS] = aclmenu;
}
*/
// Get config parameters from database
foreach (ConfigModel configModel in ConfigModel.FindAll())
{
if (configModel.Key == Constants.LAYOUT_LOWER)
{
if (controller.Name == Constants.LOGIN_CONTROLLER)
controller.LayoutName = configModel.Val/*.Substring(0,6)*/ + Constants.LOGIN_SUB;
else
controller.LayoutName = configModel.Val;
}
else
controller.PropertyBag[configModel.Key] = configModel.Val;
}
// Get config parameters from site.config
foreach (string key in config.Keys)
{
controller.PropertyBag[key] = config.GetExistentValue(key);
}
// Get config parameters from cookies:
string lang = Commons.GetCurrentLang(controller);
controller.PropertyBag[Constants.LANG] = lang ;
// Get all supported languages:
Language[] all_linguas = Language.FindAll();
controller.PropertyBag[Constants.ALL_LINGUAS] = all_linguas;
controller.PropertyBag[Constants.LAYOUTS_AVAILABLE] =
ConfigCombo.FindAllByKey(Constants.LAYOUT_LOWER);
controller.PropertyBag[Constants.COLORS_AVAILABLE] =
ConfigCombo.FindAllByKey(Constants.COLOR);
controller.PropertyBag[Constants.HEADERS_AVAILABLE] =
ConfigCombo.FindAllByKey(Constants.HEADER);
controller.PropertyBag[Constants.PERMISSION_READ] = Permission.Read;
controller.PropertyBag[Constants.PERMISSION_CREATE] = Permission.Create;
controller.PropertyBag[Constants.PERMISSION_MODIFY] = Permission.Modify;
controller.PropertyBag[Constants.PERMISSION_DELETE] = Permission.Delete;
controller.PropertyBag[Constants.PERMISSION_PUBLISH] = Permission.Publish;
context.Session[Constants.IS_ROOT] =
((user != null) && (user.Name == Constants.SUPER_USER));
context.Session[Constants.IS_ADMIN] =
((user != null) && user.IsInGroup(Constants.ADMIN_GROUP_NAME));
return true;
}
catch (Castle.ActiveRecord.Framework.ActiveRecordException ex)
{
logger.Error(ex.Message + "," + ex.StackTrace);
controller.RenderText(Constants.WEBSITE_UNAVAILABLE);
return false;
}
catch (System.Exception ex)
{
throw ex;
}
}