473,757 Members | 9,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access ModuleControlle r from View Presenter?

Hi,

I have a solution, that includs a project.
The project have some folder, (like folder1, folder2, folder3,...).
Inside folder there is a view and view presenter.
Directly under project, there is modulcontroller that controls load win
forms etc.

In the moduleControole r I show a form like this:
string key = "_abc";

AForm view = this.WorkItem.I tems.Get<AForml >(key);

if (view == null)

{

view = WorkItem.SmartP arts.AddNew<AFo rm>();

}

view.ShowDialog ();

What I want is calling a function in the modulecontrolle r from a view
presenter. Say this is a function call GetCustomerID(s tring a);

Thank u.
peter
Oct 8 '06 #1
1 2249

Użytkownik "peter shaw" <pe*******@clin icalcomputers.c om.aunapisał w
wiadomo¶ci news:uo******** ********@TK2MSF TNGP05.phx.gbl. ..
Hi,

I have a solution, that includs a project.
The project have some folder, (like folder1, folder2, folder3,...).
Inside folder there is a view and view presenter.
Directly under project, there is modulcontroller that controls load win
forms etc.

In the moduleControole r I show a form like this:
string key = "_abc";

AForm view = this.WorkItem.I tems.Get<AForml >(key);

if (view == null)

{

view = WorkItem.SmartP arts.AddNew<AFo rm>();

}

view.ShowDialog ();

What I want is calling a function in the modulecontrolle r from a view
presenter. Say this is a function call GetCustomerID(s tring a);

Thank u.
peter
I thik you have do something like that. In your view class add this code
[CreateNew]

public ClassPresenter Presenter

{

get { return _presenter; }

set

{

_presenter = value;

_presenter.View = this;

}

}

and then if you want to call some methods from your WorkItem class from view
class then you can do that like this Presenter.WorkI tem. (you hev access to
all public methods in workItem class)

I think you use a UIApplicationBl ock am I right?

Forrest
Oct 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2766
by: Droolboy | last post by:
I'm trying to build a fairly small (max. 10 different pages) site using php, and it's becoming obvious that I need some kind of model view separation. Having done a few searches, I've come across the concept of 'template engines', but that seems like overkill for my needs. I'm thinking I'll just stick with php as my template language; a little embedded code in the view pages, for loops or whatever, should be ok.. I've come up with the...
0
1998
by: Brian Loesgen | last post by:
The next San Diego .Net User Group meeting is Tuesday, November 25, 2003 at the Scripps Ranch Library. Scripps Ranch Library 10301 Scripps Lake Drive San Diego, CA 92131-1026 Please join us at 6:00 pm for pizza and networking. The meeting starts at 6:30 pm.
6
4618
by: Robert W. | last post by:
I'm building my first major C# program and am try to use best practices everywhere. So I've implemented the "Document/View Model" whereby: - There's a Windows Form, which we'll call "formView" - There's a Class, which we'll call "classDocument" Thus, when an instance of each the form and the class are instantiated, they each will hold the same data, albeit be independent of each other. To keep the two in perfect sync with each other,...
10
4520
by: Sean Chambers | last post by:
Hello, I am attempting to utilize the MVP pattern in a new app I am building. I am using TDD, along with mock views attached to the View interface to attempt to unit test the UI. The problem I am having is when using the InitView() of the presenter, normally I would be retrieving data from NHibernate when InitView is called. Therein lies the problem, I can't seem to figure out how to properly
12
7502
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use it to reset info in a combo box. Below is some sample code for my view interface and the presenter: public interface IDevToolView
6
14153
by: Dhananjay | last post by:
hello everyone i have got a problem i want to design business layer, data access layer , presentation layer for asp.net using C#.net , can anyone help me to solve this problem. i want some resources to complete this. i am trying very hard. Do you have any idea about website or any links where i can find some examples based on this concept.can you plz provide me , its urgent i want this solution with an example, if u have plz provide me. ...
1
8651
by: Dan | last post by:
Hi Am interested in learning more about Model View Presenter (MVP) design. Specifically to create an application using vs2005 with winforms that use webservices to process business logic. I want a stateless system ( wireless required), so I can then development a front end for the pda client, then webclient. From what I've read so far it should be easier to replace the gui for a pda\webclient with MVP design with minimal rewrite of...
12
1308
by: Joshmoshoshkosh | last post by:
I am creating a database for my company that holds different seminars, often done by different people. those are my 2 variables, but also, each seminar is rated with a sheet, that rates the seminar in various ways (1 to 5) as well as the presenter. how can i relate all of this data in Access, how many tables should i be using, and how can i set it up so i can take averages of the presenter's ratings, as well as take avearges of the specific...
3
3644
by: Gav | last post by:
I have just started to rewrite my application using the Presenter First Design Pattern to make sure my business logic is not in the Gui itself. I've got the general idea but I'm a bit unsure as to how I should be launching a dialogue window from my main application window. What i have done is this in a nutshell. My main application window comprises of a Model, Presenter and a View. The Popup window also has a Model, Presenter and View....
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.