mvp

How to bind a collection of objects to a DataGridView in Winforms

我的梦境 提交于 2019-12-01 23:32:46
问题 If i have two objects, namely Fruit' and Color` and their definitions are as follows: public class Fruit { public int FruitId { get; set; } public string Name { get; set; } public Color Color { get; set; } } public class Color { public int ColorId { get; set; } public string Name { get; set; } } How do I bind a collection of Fruit (e.g. List<Fruit>) to a DataGridView? where the resulting output would be something similar to the following: +-----+--------+----------+ | Id | Name | Color | +---

How to bind a collection of objects to a DataGridView in Winforms

扶醉桌前 提交于 2019-12-01 21:16:31
If i have two objects, namely Fruit' and Color` and their definitions are as follows: public class Fruit { public int FruitId { get; set; } public string Name { get; set; } public Color Color { get; set; } } public class Color { public int ColorId { get; set; } public string Name { get; set; } } How do I bind a collection of Fruit (e.g. List<Fruit>) to a DataGridView? where the resulting output would be something similar to the following: +-----+--------+----------+ | Id | Name | Color | +-----+--------+----------+ | 10 | Apple | Red | | 20 | Orange | Orange | | 30 | Grapes | Violet | +-----+-

Injecting Generics in Dagger

非 Y 不嫁゛ 提交于 2019-12-01 17:19:10
Is it possible in Dagger to do something like the following: public abstract class Presenter<T extends BaseView> { @Inject T mView; public void showLoadingIndicator() { mView.showLoading(); } } (example module) public class MyModule { private MyView mView; //extends BaseView public MyModule(MyView view) { mView = view; } @Provides public BaseView provideView() { return mView; } } And then create an object graph with the module above and inject the view into the presenter? My attempts have not worked (usually get "unknown class 'T'" sort of errors). I'm not sure if my configuration is wrong or

Injecting Generics in Dagger

℡╲_俬逩灬. 提交于 2019-12-01 17:00:32
问题 Is it possible in Dagger to do something like the following: public abstract class Presenter<T extends BaseView> { @Inject T mView; public void showLoadingIndicator() { mView.showLoading(); } } (example module) public class MyModule { private MyView mView; //extends BaseView public MyModule(MyView view) { mView = view; } @Provides public BaseView provideView() { return mView; } } And then create an object graph with the module above and inject the view into the presenter? My attempts have not

3D object viewer in web browsers

我怕爱的太早我们不能终老 提交于 2019-12-01 14:18:27
I am looking for a 3D object viewer for my website. Requirements: Files: .stl, .wrl, *.3ds *.vrml, *.obj, *.ply, *.skp display: models in color and non color Unit of Measure: Meters, Centimeter, Millimeters, Inch Volume: 3D object viewer has to calculate the orginal size of the model Rotation&zoom: user can rotate/zoom with mouse and rotate/zoom by clicking buttons Browser: IE& Firefox Please take a look at this 3d viewer . Has anybody a idea where I can buy that? Thanks Regards i found some, not sure if that what you want though, anyway take a look http://www.cortona3d.com/Products/Cortona-3D

Using Autofac with ASP.NET and the MVP pattern

早过忘川 提交于 2019-12-01 13:17:19
I'm trying to integrate Autofac into an exsisting ASP.NET web application. The pages follow the MVP pattern. Each page implements a View and delegate functionality to a Presenter. The View is injected into the Presenter thru the constructor. I was able to register the Presenter and View and the page loads fine but when a postback happens the user controls on the view are null. It seems that Autofac creates a new instance of the Page to give to the presenter instead of giving it the instance real Page instance. Is there a way to have Page instances registered with Autofac? Has anyone use

Defining view models for MVC / MVP

橙三吉。 提交于 2019-12-01 12:53:27
问题 Short question - how do you define your view models? Here are some of the options: Pass the actual model into the view. Create a view model with a reference to the model (like Model.Product) Create a view model with the properties needed from the model, and set those from the model. Probably a lot more. All with their own advantages and disadvantages. What is your experience - good and bad? And do you use the same model for GET/POST? Thanks for your input! 回答1: Basically - it's all about

GWT MVP with Activities and Places - “global” references?

坚强是说给别人听的谎言 提交于 2019-12-01 12:52:07
问题 I'm slightly confused with the GWT MVP Development with Activities and Places example. It's the first time I approach such a design pattern. I managed to implement it in my project, and to my surprise it actually works. History works, events fire fine, etc. Since I am following the example exactly, my presenters are disposable Activities that are created each time the user navigates, and the views are kept in a ClientFactory. Everything is separated and clean. Now I can't wrap my head around

3D object viewer in web browsers

二次信任 提交于 2019-12-01 11:20:12
问题 I am looking for a 3D object viewer for my website. Requirements: Files: .stl, .wrl, *.3ds *.vrml, *.obj, *.ply, *.skp display: models in color and non color Unit of Measure: Meters, Centimeter, Millimeters, Inch Volume: 3D object viewer has to calculate the orginal size of the model Rotation&zoom: user can rotate/zoom with mouse and rotate/zoom by clicking buttons Browser: IE& Firefox Please take a look at this 3d viewer. Has anybody a idea where I can buy that? Thanks Regards 回答1: i found

Best Practice for BackGroundWorker in WinForms using an MVP architecture

只愿长相守 提交于 2019-12-01 09:38:16
问题 I am working on a winforms project. I am implementing an MVP architecture. I have some processing intensive jobs running at the presenter (Reading from file system and performing bulk inserts to a DB). I would like to perform these operations in a background thread without locking up the UI and update controls on my view (progress bar, and datagridview). Should I just access the backgroundworker object within my presenter and handle it's events in the presenter by having the view event