ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupDomainUpDownDesigner.Initialize C# (CSharp) Method

Initialize() public method

Initializes the designer with the specified component.
public Initialize ( IComponent component ) : void
component IComponent The IComponent to associate the designer with.
return void
        public override void Initialize(IComponent component)
        {
            Debug.Assert(component != null);

            // Validate the parameter reference
            if (component == null) throw new ArgumentNullException("component");

            // Let base class do standard stuff
            base.Initialize(component);

            // Cast to correct type
            _ribbonDomainUpDown = (KryptonRibbonGroupDomainUpDown)component;
            _ribbonDomainUpDown.DomainUpDownDesigner = this;

            // Update designer properties with actual starting values
            Visible = _ribbonDomainUpDown.Visible;
            Enabled = _ribbonDomainUpDown.Enabled;

            // Update visible/enabled to always be showing/enabled at design time
            _ribbonDomainUpDown.Visible = true;
            _ribbonDomainUpDown.Enabled = true;

            // Tell the embedded domain up-down control it is in design mode
            _ribbonDomainUpDown.DomainUpDown.InRibbonDesignMode = true;

            // Hook into events
            _ribbonDomainUpDown.DesignTimeContextMenu += new MouseEventHandler(OnContextMenu);

            // Get access to the services
            _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
            _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            // We need to know when we are being removed/changed
            _changeService.ComponentChanged += new ComponentChangedEventHandler(OnComponentChanged);
        }