Getting Data Using Interface with Winforms
I've been given the role of rebuilding the primary application from the ground up, with OneClick install in mind. (The current version, does not support OneClick )
One of the main elements or the current system is that a number of data objects (Current user etc) is passed through each class or object as a user navigates the application.
Now that I get the chance to build from the ground up, I've moved these object to placed a single place, which the main form. Then I have created a number of different interface to access the the objects when needed.
The reason I have gone with the approach of adding the objects to the main form, is simple because its always accessible.
Below is an example on how I access the object, using an interface class and methods
privateInterfaceProject.IUersInterfaceMainScreenGet interfaceObject ;
public static voidcreateInterfaceObject()
interfaceObject = (InterfaceProject.IUersInterfaceMainScreenGet)System.Windows.Forms.Application.OpenForms["FormName"];
public staticDataObjectsProject.LoggedInUserDataObject UserDetails()
Created: 03/08/2016 Total Comment: 0