Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NuGenThumbnail"/> class.
        /// </summary>
        /// <param name="serviceProvider"><para>Requires:</para>
        ///     <para><see cref="INuGenButtonStateService"/></para>
        ///		<para><see cref="INuGenControlImageManager"/></para>
        ///     <para><see cref="INuGenControlStateService"/></para>
        ///		<para><see cref="INuGenThumbnailLayoutManager"/></para>
        ///		<para><see cref="INuGenThumbnailRenderer"/></para>
        /// </param>
        /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception>
        public NuGenThumbnail(INuGenServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
            this.SetStyle(ControlStyles.UserPaint, true);

            _cwRotateButtonSize  = this.LayoutManager.GetCWRotateButtonSize();
            _ccwRotateButtonSize = this.LayoutManager.GetCCWRotateButtonSize();

            _cwRotateButton        = new CWRotateButton(serviceProvider);
            _cwRotateButton.Bounds = this.GetCWRotateButtonBounds();
            _cwRotateButton.Click += _cwRotateButton_Click;
            _cwRotateButton.Parent = this;

            _ccwRotateButton        = new CCWRotateButton(serviceProvider);
            _ccwRotateButton.Bounds = this.GetCCWRotateButtonBounds();
            _ccwRotateButton.Click += _ccwRotateButton_Click;
            _ccwRotateButton.Parent = this;
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenThumbnail"/> class.
		/// </summary>
		/// <param name="serviceProvider"><para>Requires:</para>
		/// 	<para><see cref="INuGenButtonStateService"/></para>
		///		<para><see cref="INuGenControlImageManager"/></para>
		/// 	<para><see cref="INuGenControlStateService"/></para>
		///		<para><see cref="INuGenThumbnailLayoutManager"/></para>
		///		<para><see cref="INuGenThumbnailRenderer"/></para>
		/// </param>
		/// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception>
		public NuGenThumbnail(INuGenServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.Opaque, true);
			this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.SetStyle(ControlStyles.Selectable, true);
			this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
			this.SetStyle(ControlStyles.UserPaint, true);

			_cwRotateButtonSize = this.LayoutManager.GetCWRotateButtonSize();
			_ccwRotateButtonSize = this.LayoutManager.GetCCWRotateButtonSize();

			_cwRotateButton = new CWRotateButton(serviceProvider);
			_cwRotateButton.Bounds = this.GetCWRotateButtonBounds();
			_cwRotateButton.Click += _cwRotateButton_Click;
			_cwRotateButton.Parent = this;

			_ccwRotateButton = new CCWRotateButton(serviceProvider);
			_ccwRotateButton.Bounds = this.GetCCWRotateButtonBounds();
			_ccwRotateButton.Click += _ccwRotateButton_Click;
			_ccwRotateButton.Parent = this;
		}