Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

ButtonBar Control using .NET

, 3 Dec 2009
Themed ButtonBar control supporting custom draw with full Designer support
using System.ComponentModel;

namespace ButtonBarsControl.Design.Generics
{
    /// <summary>
    /// Represents a method which can handle generic cancel event
    /// </summary>
    /// <typeparam name="T">Object type to be associated with the event</typeparam>
    /// <param name="sender">Event source</param>
    /// <param name="tArgs">Object containing event data</param>
    public delegate void GenericCancelEventHandler<T>(object sender, GenericCancelEventArgs<T> tArgs);

    /// <summary>
    /// Class holding information related to generic cancel event.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class GenericCancelEventArgs<T> : CancelEventArgs
    {
        /// <summary>
        /// Initailizes new instance with parameters.
        /// </summary>
        /// <param name="value"></param>
        public GenericCancelEventArgs(T value) : base(false)
        {
            Value = value;
        }

        /// <summary>
        /// Initializes new instance with parameter
        /// </summary>
        /// <param name="value">Object associated with event</param>
        /// <param name="cancel">Indicate wether event needs to be cancelled.</param>
        public GenericCancelEventArgs(T value, bool cancel) : base(cancel)
        {
            Value = value;
        }

        /// <summary>
        /// Gets associated object with event.
        /// </summary>
        public T Value { get; set; }
    }
}

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)

About the Author

Manish Ranjan Kumar
Software Developer (Senior)
India India
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 3 Dec 2009
Article Copyright 2009 by Manish Ranjan Kumar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid