ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupLinesDesigner.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
            _ribbonLines = (KryptonRibbonGroupLines)component;
            _ribbonLines.DesignTimeAddButton += new EventHandler(OnAddButton);
            _ribbonLines.DesignTimeAddColorButton += new EventHandler(OnAddColorButton);
            _ribbonLines.DesignTimeAddCheckBox += new EventHandler(OnAddCheckBox);
            _ribbonLines.DesignTimeAddRadioButton += new EventHandler(OnAddRadioButton);
            _ribbonLines.DesignTimeAddLabel += new EventHandler(OnAddLabel);
            _ribbonLines.DesignTimeAddCustomControl += new EventHandler(OnAddCustomControl);
            _ribbonLines.DesignTimeAddCluster += new EventHandler(OnAddCluster);
            _ribbonLines.DesignTimeAddTextBox += new EventHandler(OnAddTextBox);
            _ribbonLines.DesignTimeAddMaskedTextBox += new EventHandler(OnAddMaskedTextBox);
            _ribbonLines.DesignTimeAddRichTextBox += new EventHandler(OnAddRichTextBox);
            _ribbonLines.DesignTimeAddComboBox += new EventHandler(OnAddComboBox);
            _ribbonLines.DesignTimeAddNumericUpDown += new EventHandler(OnAddNumericUpDown);
            _ribbonLines.DesignTimeAddDomainUpDown += new EventHandler(OnAddDomainUpDown);
            _ribbonLines.DesignTimeAddDateTimePicker += new EventHandler(OnAddDateTimePicker);
            _ribbonLines.DesignTimeAddTrackBar += new EventHandler(OnAddTrackBar);
            _ribbonLines.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.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);
            _changeService.ComponentChanged += new ComponentChangedEventHandler(OnComponentChanged);
        }