Click here to Skip to main content
13,152,321 members (41,869 online)
Click here to Skip to main content

Stats

46K views
198 downloads
33 bookmarked
Posted 30 Oct 2008

UI Object Connector Implementation of Mediator Pattern

, 7 Mar 2014
UI Object Connector Implementation of Mediator Pattern
UIObjectConnector
Bin
SampleClass.dll
SampleClass.pdb
UIObjectConnector.dll
UIObjectConnector.pdb
SampleClass
bin
Debug
SampleClass.dll
Properties
UIObjectConnector
bin
Debug
SampleClass.dll
UIObjectConnector.dll
Properties
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using UIObjectConnector;
using SampleClass;
public partial class _Default : System.Web.UI.Page 
{
    private clsMediator objMediator;
    private clsSampleClass objSample= new clsSampleClass();
    protected void Page_Load(object sender, EventArgs e)
    {
            objMediator = new clsMediator();
            objMediator.Add(TextBox1, "Property1");
            objMediator.Add(TextBox2, "Property2");
            if (Page.IsPostBack == false)
            {
                objMediator.setValuesToUI(objSample);
            }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        objMediator.setValuesToObject(objSample);
        Label1.Text = objSample.Property1;
        Label4.Text = objSample.Property2;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        objMediator.ClearTextBox();
    }
   
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170924.2 | Last Updated 7 Mar 2014
Article Copyright 2008 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid