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;
}