• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Framework.Controller类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Castle.MonoRail.Framework.Controller的典型用法代码示例。如果您正苦于以下问题:C# Controller类的具体用法?C# Controller怎么用?C# Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Controller类属于Castle.MonoRail.Framework命名空间,在下文中一共展示了Controller类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RegisterDynamicActions

 public void RegisterDynamicActions(Controller controller)
 {
     foreach (IPresentationViewHandler handler in presentationTypesToViewHandlers.Values)
     {
         handler.RegisterDynamicActions(controller);
     }
 }
开发者ID:nbadw,项目名称:sjr_atlas,代码行数:7,代码来源:PresentationViewResolver.cs


示例2: GetControllerName

		private string GetControllerName(Controller c)
		{
			string controllerName = c.Name;
			if (!String.IsNullOrEmpty(c.AreaName))
				controllerName = c.AreaName + "/" + controllerName;
			return controllerName;
		}
开发者ID:elementar,项目名称:Suprifattus.Util,代码行数:7,代码来源:SecurityFilter.cs


示例3: AddRelatedAction

		public static IAction AddRelatedAction(string description, Controller c, string action, params string[] queryString)
		{
			IDictionary parameters = null;
			if (queryString != null && queryString.Length > 0)
				parameters = dictHelper.CreateDict(queryString);
			return AddRelatedAction(description, c.AreaName, c.Name, action, parameters);
		}
开发者ID:elementar,项目名称:Suprifattus.Util,代码行数:7,代码来源:ExceptionHelper.cs


示例4: CreateView

		public AspViewBase CreateView(Type type, TextWriter output, IRailsEngineContext context, Controller controller)
		{
			ConstructorInfo constructor = (ConstructorInfo)constructors[type];
			AspViewBase self = (AspViewBase)FormatterServices.GetUninitializedObject(type);
			constructor.Invoke(self, new object[] { this, output, context, controller });
			return self;
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:7,代码来源:AspViewEngine.cs


示例5: Perform

		/// <summary>
		/// Executa o filtro.
		/// </summary>
		public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			if (!Enabled)
				return true;

			UserAgent ua = null;

			var uaString = context.UnderlyingContext.Request.UserAgent;
			if (uaString != null)
			{
				ua = (UserAgent) cache[uaString];
				if (ua == null)
					cache[uaString] = ua = new UserAgent(uaString);
			}

			if (IsValid(ua))
				return true;

			if (!logged)
			{
				Log.Error("Tentativa de acesso através de browser não suportado: {0}", uaString);
				logged = true;
			}

			controller.PropertyBag["invalidGecko"] = true;
			if (!Redirect)
				return true;

			throw new Exception("redir: " + Redirect);

			//RedirectToNotice(controller);
			//return false;
		}
开发者ID:elementar,项目名称:Suprifattus.Util,代码行数:36,代码来源:MozillaOnlyFilter.cs


示例6: Perform

		public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			// Read previous authenticated principal from session 
			// (could be from cookie although with more work)
			
			User user = (User) context.Session["user"];
			
			// Sets the principal as the current user
			context.CurrentUser = user;
			
			// Checks if it is OK
			if (context.CurrentUser == null || !context.CurrentUser.Identity.IsAuthenticated)
			{
				// Not authenticated, redirect to login
				NameValueCollection parameters = new NameValueCollection();
				parameters.Add("ReturnUrl", context.Url);
				controller.Redirect("login", "index", parameters);
				
				// Prevent request from continue
				return false;
			}
			
			// Everything is ok
			return true;
		}
开发者ID:ralescano,项目名称:castle,代码行数:25,代码来源:AuthenticationFilter.cs


示例7: GetBooPaths

 protected virtual string[] GetBooPaths(Controller controller, string[] myBoos){
     var paths = new List<string>();
     foreach (var s in myBoos){
         paths.Add(controller.Context.Server.MapPath("~/views/report/" + s + ".boo"));
     }
     return paths.ToArray();
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:7,代码来源:BooBasedReportContentPreparator.cs


示例8: BrailBase

		/// <summary>
		/// Initializes a new instance of the <see cref="BrailBase"/> class.
		/// </summary>
		/// <param name="viewEngine">The view engine.</param>
		/// <param name="output">The output.</param>
		/// <param name="context">The context.</param>
		/// <param name="__controller">The controller.</param>
		public BrailBase(BooViewEngine viewEngine, TextWriter output, IRailsEngineContext context, Controller __controller)
		{
			this.viewEngine = viewEngine;
			this.outputStream = output;
			this.context = context;
			this.__controller = __controller;
			InitProperties(context, __controller);
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:15,代码来源:BrailBase.cs


示例9: Perform

		public bool Perform(ExecuteEnum exec, IRailsEngineContext ctx, Controller c)
		{
			if (!controllersToSkip.IsMatch(GetControllerName(c)))
				if (ctx.CurrentUser == null || !ctx.CurrentUser.Identity.IsAuthenticated)
					return TryAutoLogin();

			return true;
		}
开发者ID:elementar,项目名称:Suprifattus.Util,代码行数:8,代码来源:SecurityFilter.cs


示例10: Perform

 public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
 {
     if (context.Request.Headers["mybadheader"] != null)
     {
         context.Response.Write("Denied!");
         return false;
     }
     return true;
 }
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:9,代码来源:FilterBadHeader.cs


示例11: Perform

		public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			if (context.Params["printable"] != null)
			{
				controller.LayoutName = "printabletheme";
			}

			return true;
		}
开发者ID:ralescano,项目名称:castle,代码行数:9,代码来源:PrintableFilter.cs


示例12: BuildContent

 public INode BuildContent(IReportControllerExtension extension, Controller controller){
     var content = Stub.Create();
     SetValue("content", content);
     Extension = extension;
     Extension.CustomContentPreparatorPrepare(this);
     CustomPrepare();
     processBrail(controller);
     return content;
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:9,代码来源:BrailBasedReportContentPrepararor.cs


示例13: GetCurrentLang

 public static string GetCurrentLang(Controller controller)
 {
     string lang = controller.Request.ReadCookie(Constants.LOCALE_COOKIE);
     if ((lang == null) || (lang.Length == 0))
     {
         lang = controller.Request.UserLanguages[0].Substring(0,2);
     }
     return lang;
 }
开发者ID:BackupTheBerlios,项目名称:castleportal-svn,代码行数:9,代码来源:Commons.cs


示例14: Perform

 public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
 {
     User user = (User)context.Session["logonUser"];
     if (user == null)
     {
         return false;
     }
     return true;
 }
开发者ID:biguoting,项目名称:MVCWebApplication,代码行数:9,代码来源:AuthenticationFilter.cs


示例15: Perform

		public virtual bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			if (!PerformAuthentication(context))
			{
				context.Response.Redirect("account", "authentication");
				return false;
			}

			return true;
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:10,代码来源:AuthenticationCheckFilter.cs


示例16: PerformActionProcess

		protected override void PerformActionProcess(Controller controller)
		{
			base.PerformActionProcess(controller);
			
			controller.PropertyBag.Add( "items", 
				PaginationHelper.CreatePagination(controller, PerformFindAll(), 10) );
			
			controller.PropertyBag["properties"] = ObtainListableProperties(Model);

			controller.RenderView(controller.Name, "list" + Model.Type.Name);
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:11,代码来源:ListAction.cs


示例17: Perform

		public override bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			if (context.CurrentUser.Identity.IsAuthenticated)
			{
				return true;
			}

			base.PerformAuthentication(context);

			return true;
		}
开发者ID:ralescano,项目名称:castle,代码行数:11,代码来源:AuthenticationAttemptFilter.cs


示例18: Perform

		public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			if (context.CurrentUser == null || !context.CurrentUser.Identity.IsAuthenticated)
			{
				context.Response.Redirect("admin", "login");

				return false;
			}

			return true;
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:11,代码来源:AuthenticationFilter.cs


示例19: Perform

		public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			_userAddFilter.Perform(exec,context,controller);
			if (Thread.CurrentPrincipal!=null && Thread.CurrentPrincipal.Identity.IsAuthenticated){
				log.Debug("authenticated");
				return true;
			}
			log.Debug("not authenticated");
			controller.Redirect("intro","index");
			return false;
		}
开发者ID:qwinner,项目名称:NetBPM,代码行数:11,代码来源:AuthenticationCheckFilter.cs


示例20: Perform

		public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
		{
			if (exec == ExecuteEnum.BeforeAction)
			{
				context.Response.Write("(before)");
			}
			else if (exec == ExecuteEnum.AfterRendering)
			{
				context.Response.Write("(after)");
			}

			return true; // Continue execution
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:13,代码来源:FilteredController.cs



注:本文中的Castle.MonoRail.Framework.Controller类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Data.ValidationContext类代码示例发布时间:2022-05-24
下一篇:
C# Context.CreationContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap