Matlab GUI回调开始和完成(Matlab GUI Callback Start and Completion)
是否有一种通用的方法来确定Matlab GUI回调函数何时开始然后又返回给调度程序?
我希望在回调运行完成时锁定用户交互,并在回调运行时显示忙状态。 在我可以插入此代码的地方是否可以访问调度程序,或者我是否必须将其放入每个回调函数中。
我知道模态等待栏但我想尽可能避免使用它。 (他们不能优雅地被杀死。)
Is there a general purpose way to determine when a Matlab GUI callback function begins and then has returned to the dispatcher?
I want to lock out user interaction while callbacks are running to completion and also show busy status while callbacks are running. Is there a dispatcher accessible where I can insert this code, or do I have to put it into every callback function.
I am aware of the modal waitbar but I want to avoid using that as much as possible. (They can't be killed gracefully.)
原文:https://stackoverflow.com/questions/38797930
最满意答案
我建议为此实现抽象基类控制器类:
public abstract class BaseController : Controller { public ILog Log { get { return LogManager.GetLogger(GetType()); } } }
I would suggest to implement abstract base controller class for this purpose:
public abstract class BaseController : Controller { public ILog Log { get { return LogManager.GetLogger(GetType()); } } }
相关问答
更多-
我建议为此实现抽象基类控制器类: public abstract class BaseController : Controller { public ILog Log { get { return LogManager.GetLogger(GetType()); } } } I would suggest to implement abstract base controller class for this purpose: public abstract cl ...
-
我只是在猜测,但您指定的格式不是用于评论,而是用于内联文档。 您可以修改T4模板以获得您喜欢的编码风格。 I'm only guessing, but the format you specified is not for comments, but for inline documentation. You do have the ability to modify the T4 templates to get the coding style you prefer.
-
我认为这取决于你的网站将会有多大。 为您的控制器提供逻辑名是最重要的部分,让您的源代码易于导航非常重要。 一般而言,如果您不确定,我认为最好从CRUD书中抽出一部分,特别是如果您正在处理支持它的数据模型。 对于某个特定的模块(比如产品),您将有一个负责创建,读取,更新和删除(以及查看索引)的控制器。 如果你的网站比较少CRUDDY(比如Stack Overflow),那么把控制器分成逻辑区域(比如“PostController”,“SearchController”等等)可能会更有用,但它确实取决于你的网站 ...
-
通过viewdata控制器asp.net mvc之间的通信(communication between controllers asp.net mvc by viewdata)[2023-09-22]
您无法使用ViewData将变量从控制器发送到另一个控制器。 可以使用“成功验证”执行,请调用以下方法 return RedirectToAction("ActionName", "ControllerName", new {variable1 = value1, variable2 = value2/*...etc*/}); You cannot use ViewData for send a variable from a controller to another controller. Can b ... -
在ASP.NET MVC中为所有控制器设置控制器路由顺序(Set Order for route of controllers across all of them in ASP.NET MVC)[2023-12-18]
由于自定义用户路由具有所需的灵活性,因此当用户路由过于通用时,最终会出现路由冲突,这将使其与其他站点路由匹配并导致路由冲突。 在基于约定的路由之前检查属性路由,因此商店控制器将捕获所有请求。 如果您希望用户路由位于站点的根目录,则需要在此情况下使用基于约定的路由。 这是因为路由添加到路由表的顺序很重要,因为一般路由将在更专业/目标路由之前匹配。 考虑混合属性路由和基于约定的路由,其中自定义用户路由将使用基于约定的路由,而其他控制器将使用属性路由。 [RoutePrefix("Home")] public c ... -
在ASP.NET MVC中,如何使部分视图可用于所有控制器?(In ASP.NET MVC, How do I make a partial view available to all controllers?)[2023-09-30]
使用MVC2,您现在可以直接在视图中呈现操作。 如果不是从同一个控制器渲染,则需要指定操作所在的控制器。 如果以这种方式包含部分视图,则部分视图可以位于控制器的视图文件夹中(而不是共享)。 请注意,它不会从当前操作获取ViewData - 只有您正在调用的操作设置的ViewData。 <% Html.RenderAction( "GetCategoriesPartial", "Category" ) %> 要么 <%= Html.Action( "GetCategoriesPartial", "Categ ... -
你可以发布你的控制器工厂吗? 我不明白为什么Castle会工作,因为我认为你也会为GetControllerInstance的Type参数传入null,而不管你在该方法中使用的DI框架。 MVC负责将URL中控制器的字符串名称与实际类型进行匹配(除非您也过度使用这些方法)。 所以我猜它不是DI框架,但MVC由于某种原因找不到你的控制器类。 Can you post your controller factory? I don't understand why Castle would work since ...
-
好吧,我不知道发生了什么,但我从今天早上重新克隆了git存储库,它现在工作正常。 我可以添加扩展,或使其无扩展,它仍然有效。 不知何故,有些东西被搞砸了。 不管怎么说,还是要谢谢你。 我现在只需要将今天完成的所有工作移植到新版本。 Well, I don't know what happened, but I re-cloned the git repository from this morning and it now works fine. I can add the extension, or ma ...
-
用于ajax动作的单独控制器在asp.net mvc 3中的结果(separate controller for ajax actionresults in asp.net mvc 3)[2023-06-23]
你为什么要那样做? 对我来说,控制器绑定到某个模型,而不是某种类型的输出格式。 public ActionResult Users() { var users = _repository.Find(); var viewModel = Mapper.Map(users); // automapper or similar return Request.IsAjax() ? Json(viewModel) : View(viewModel); } 要回答您的更新 最好创建一个Cu ... -
包含两个版本的jquery(1.5然后是1.7)是很尴尬的,你必须找到正确的顺序并且只有一个jquery包含。 也许用另一个替换1.5? It is awkward to include two versions of jquery (1.5 and then 1.7), you have to find the right order and have only one jquery include. Maybe replacing the 1.5 by another one ?