ComponentFactory.Krypton.Toolkit.KryptonMaskedTextBoxDesigner.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)
        {
            // Let base class do standard stuff
            base.Initialize(component);

            // The resizing handles around the control need to change depending on the
            // value of the AutoSize and AutoSizeMode properties. When in AutoSize you
            // do not get the resizing handles, otherwise you do.
            AutoResizeHandles = true;

            // Cast to correct type
            _maskedTextBox = component as KryptonMaskedTextBox;

            if (_maskedTextBox != null)
            {
                // Hook into masked textbox events
                _maskedTextBox.GetViewManager().MouseUpProcessed += new MouseEventHandler(OnMaskedTextBoxMouseUp);
                _maskedTextBox.GetViewManager().DoubleClickProcessed += new PointHandler(OnMaskedTextBoxDoubleClick);
            }

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

            // We need to know when we are being removed
            _changeService.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);
        }