Click here to Skip to main content
15,895,011 members
Articles / Desktop Programming / Windows Forms

Creating an outlook like side bar using the smart client software factory

Rate me:
Please Sign up or sign in to vote.
4.61/5 (14 votes)
26 Sep 200611 min read 146.7K   6.2K   111  
This is basically a tutorial to use the smart client software factory to create an outlook like side bar using Matias Woloski's outlookbar workspace
//----------------------------------------------------------------------------------------
// patterns & practices - Smart Client Software Factory - Guidance Package
//
// This file was generated by the "Add View" recipe.
//
// A presenter calls methods of a view to update the information that the view displays. 
// The view exposes its methods through an interface definition, and the presenter contains
// a reference to the view interface. This allows you to test the presenter with different 
// implementations of a view (for example, a mock view).
//
// For more information see:
// ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.scsf.2006jun/SCSF/html/03-030-Model%20View%20Presenter%20%20MVP%20.htm
//
// Latest version of this Guidance Package: http://go.microsoft.com/fwlink/?LinkId=62182
//----------------------------------------------------------------------------------------

using System;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeUI;
using Matias.Infrastructure.Interface;
using Microsoft.Practices.CompositeUI.EventBroker;
using Matias.Infrastructure.Interface.Constants;

namespace Matias.ContactsModule
{
    public class ContactViewLeftPresenter : Presenter<IContactViewLeft>
    {
        /// <summary>
        /// This method is a placeholder that will be called by the view when it's been loaded <see cref="System.Winforms.Control.OnLoad"/>
        /// </summary>
        public override void OnViewReady()
        {
            base.OnViewReady();
        }

        /// <summary>
        /// Close the view
        /// </summary>
        public void OnCloseView()
        {
            base.CloseView();
        }

        [EventPublication(EventTopicNames.ChangeColor,PublicationScope.Global)]
        public event EventHandler<EventArgs> ChangeColor;
        public void ChangeViewColor()
        {
            Random random = new Random();

            int r = random.Next(256);
            int g = random.Next(256);
            int b = random.Next(256);

            System.Drawing.Color color = System.Drawing.Color.FromArgb(r, g, b);

            if (ChangeColor != null)
            {
                ChangeColor(this, new EventArgs<System.Drawing.Color>(color));
            }
        }
    }
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions