我有几个在构造函数中使用Handler mainThreadHandler = new Handler(Looper.getMainLooper());
Runnable doToast = new Runnable() {
@Override
public void run() {
Toast.makeText(menuActivity, "HELLO", Toast.LENGTH_SHORT).show();
}
});
mainThreadHandler.post(doToast); // Queue the first execution of the code in the Runnable's run() method.
mainThreadHandler.post(doToast); // Queue the second execution of the code in the Runnable's run() method.
的类。我想在Autofac中注册通用集合IList<IHero>
,以便每当Autofac需要解析采用List<IHero>
的服务时,它都会返回IList<IHero
的新实例。下面的代码可以编译,但是在运行时会收到大量错误消息。
List<IHero>
我当前的解决方法如下:
builder.RegisterType<List<IHero>>().As<IList<IHero>>();
var printer = scope.Reseolve<IPrinter>(new TypedParameter(typeof(IList<IHero>), new List<IHero>();