ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupSeparator.ViewDrawRibbonGroupSeparator C# (CSharp) Méthode

ViewDrawRibbonGroupSeparator() public méthode

Initialize a new instance of the ViewDrawRibbonGroupSeparator class.
public ViewDrawRibbonGroupSeparator ( KryptonRibbon ribbon, KryptonRibbonGroupSeparator ribbonSeparator, NeedPaintHandler needPaint ) : System
ribbon KryptonRibbon Reference to owning ribbon control.
ribbonSeparator KryptonRibbonGroupSeparator Reference to group separator definition.
needPaint NeedPaintHandler Delegate for notifying paint requests.
Résultat System
        public ViewDrawRibbonGroupSeparator(KryptonRibbon ribbon,
                                            KryptonRibbonGroupSeparator ribbonSeparator,
                                            NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonSeparator != null);
            Debug.Assert(needPaint != null);

            _ribbon = ribbon;
            _ribbonSeparator = ribbonSeparator;
            _needPaint = needPaint;

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonSeparator;

            if (_ribbon.InDesignMode)
            {
                // At design time we need to know when the user right clicks the label
                ContextClickController controller = new ContextClickController();
                controller.ContextClick += new MouseEventHandler(OnContextClick);
                MouseController = controller;
            }

            // Define back reference to view for the separator definition
            _ribbonSeparator.SeparatorView = this;

            // Hook into changes in the ribbon separator definition
            _ribbonSeparator.PropertyChanged += new PropertyChangedEventHandler(OnSeparatorPropertyChanged);

            // Default the preferred size
            _lastShape = PaletteRibbonShape.Office2007;
            _preferredSize = _preferredSize2007;
        }