Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //
            // Create Dependancies
            //

            // User Controls / Presenters
            var ucInventorySearchBar = new UCInventorySearchBar();

            ucInventorySearchBar.Tag = new InventorySearchBarPresenter(ucInventorySearchBar);

            var ucInventorySearchResults = new UCInventorySearchResults();

            ucInventorySearchResults.Tag = new InventorySearchResultsPresenter(ucInventorySearchResults);

            var ucInventoryProductEditor = new UCInventoryProductEditor();

            ucInventoryProductEditor.presenter = new InventoryProductEditorPresenter(ucInventoryProductEditor);

            var inventoryView = new UCInventoryView(ucInventorySearchBar, ucInventorySearchResults, ucInventoryProductEditor);

            inventoryView.Tag = new InventoryPresenter(inventoryView);

            // Main Form
            var mainForm = new MainForm(inventoryView);

            mainForm.Tag = new MainFormPresenter(mainForm);

            // Start Application
            Application.Run(mainForm);
        }
Beispiel #2
0
        public InventorySearchResultsPresenter(UCInventorySearchResults isr)
        {
            ucInventorySearchResults = isr;
            inventorySearchResults   = new InventorySearchResults();
            ConnectionString         = ConfigurationManager.ConnectionStrings["ProductManager.Properties.Settings.BTDataConnectionString"].ConnectionString;

            // Query DB using search string, populate inventorySearchResults.InventoryItems
            EventAggregator.Instance.Subscribe <InventoryProductSearch>(OnSearchTextChanged);
        }