ToolStripItemImageRenderEventArgs.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ToolStripItemImageRenderEventArgs.cs / 1305376 / ToolStripItemImageRenderEventArgs.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Windows.Forms { 
 
    using System.Drawing;
 
    /// 
    /// 
    public class ToolStripItemImageRenderEventArgs : ToolStripItemRenderEventArgs {
 
        private Image              image             = null;
        private Rectangle          imageRectangle    = Rectangle.Empty; 
        private bool               shiftOnPress      = false; 

        public ToolStripItemImageRenderEventArgs(Graphics g, ToolStripItem item, Rectangle imageRectangle) : base(g, item) { 
            this.image = (item.RightToLeftAutoMirrorImage && (item.RightToLeft == RightToLeft.Yes)) ? item.MirroredImage : item.Image;
            this.imageRectangle = imageRectangle;

        } 
        /// 
        ///  
        /// This class represents all the information to render the winbar 
        /// 
        public ToolStripItemImageRenderEventArgs(Graphics g, ToolStripItem item, Image image, Rectangle imageRectangle) : base(g, item) { 
            this.image = image;
            this.imageRectangle = imageRectangle;
        }
 

        ///  
        ///  
        /// the string to draw
        ///  
        public Image Image  {
            get {
                return image;
            } 
        }
 
 	    ///  
	    /// 
	    /// the rectangle to draw the Image in 
	    /// 
 	    public Rectangle ImageRectangle {
	        get {
                return imageRectangle; 
 	        }
 	    } 
 
        // not public as it currently pertains to button & system renderer.
        internal bool ShiftOnPress { 
            get { return shiftOnPress; }
            set { shiftOnPress = value; }
        }
 

    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Windows.Forms { 
 
    using System.Drawing;
 
    /// 
    /// 
    public class ToolStripItemImageRenderEventArgs : ToolStripItemRenderEventArgs {
 
        private Image              image             = null;
        private Rectangle          imageRectangle    = Rectangle.Empty; 
        private bool               shiftOnPress      = false; 

        public ToolStripItemImageRenderEventArgs(Graphics g, ToolStripItem item, Rectangle imageRectangle) : base(g, item) { 
            this.image = (item.RightToLeftAutoMirrorImage && (item.RightToLeft == RightToLeft.Yes)) ? item.MirroredImage : item.Image;
            this.imageRectangle = imageRectangle;

        } 
        /// 
        ///  
        /// This class represents all the information to render the winbar 
        /// 
        public ToolStripItemImageRenderEventArgs(Graphics g, ToolStripItem item, Image image, Rectangle imageRectangle) : base(g, item) { 
            this.image = image;
            this.imageRectangle = imageRectangle;
        }
 

        ///  
        ///  
        /// the string to draw
        ///  
        public Image Image  {
            get {
                return image;
            } 
        }
 
 	    ///  
	    /// 
	    /// the rectangle to draw the Image in 
	    /// 
 	    public Rectangle ImageRectangle {
	        get {
                return imageRectangle; 
 	        }
 	    } 
 
        // not public as it currently pertains to button & system renderer.
        internal bool ShiftOnPress { 
            get { return shiftOnPress; }
            set { shiftOnPress = value; }
        }
 

    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK