Click here to Skip to main content
15,893,337 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.
//
// This class is the concrete implementation of a View in the Model-View-Presenter 
// pattern. Communication between the Presenter and this class is acheived through 
// an interface to facilitate separation and testability.
// Note that the Presenter generated by the same recipe, will automatically be created
// by CAB through [CreateNew] and bidirectional references will be added.
//
// 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 System.Windows.Forms;
using Microsoft.Practices.CompositeUI.SmartParts;
using Microsoft.Practices.ObjectBuilder;
using Matias.Infrastructure.Interface;
using CompositeUIExtensions.Winforms;
using Matias.MailModule.Constants;

namespace Matias.MailModule
{
    [SmartPart]
    public partial class MailView : UserControl, IMailView,ISmartPartInfoProvider
    {
        public MailView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Sets the presenter. The dependency injection system will automatically
        /// create a new presenter for you.
        /// </summary>
        [CreateNew]
        public MailViewPresenter Presenter
        {
            set
            {
                _presenter = value;
                _presenter.View = this;
            }
        }

        protected override void OnLoad(EventArgs e)
        {
            _presenter.OnViewReady();
        }

        #region ISmartPartInfoProvider Members

        public ISmartPartInfo GetSmartPartInfo(Type smartPartInfoType)
        {
            //throw new Exception("The method or operation is not implemented.");
            OutlookBarSmartPartInfo MailSmartPartInfo = new OutlookBarSmartPartInfo();
            MailSmartPartInfo.Title = "Mail";
            MailSmartPartInfo.Icon = Properties.Resources.Mail;
            MailSmartPartInfo.EventTopicName = EventTopicNames.LoadMailModule;
            return MailSmartPartInfo;
        }

        #endregion
    }
}

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