Esempio n. 1
0
        protected virtual Control CreateBoolean(PropertyDescriptor property)
        {
            Control control;

            if (this.DataEntryControl.Site == null)
            {
                RadCheckBox radCheckBox       = new RadCheckBox();
                EditorInitializingEventArgs e = new EditorInitializingEventArgs(property, (Control)radCheckBox, radCheckBox.GetType());
                this.OnEditorInitializing((object)this, e);
                if (e.Cancel)
                {
                    return((Control)null);
                }
                control = e.Editor;
                this.OnEditorInitialized((object)this, new EditorInitializedEventArgs(property, (Control)radCheckBox, radCheckBox.GetType()));
            }
            else
            {
                Control component             = (Control)(this.designerHost.CreateComponent(typeof(RadCheckBox)) as RadCheckBox);
                EditorInitializingEventArgs e = new EditorInitializingEventArgs(property, component, component.GetType());
                this.OnEditorInitializing((object)this, e);
                if (e.Cancel)
                {
                    return((Control)null);
                }
                control = !object.ReferenceEquals((object)e.Editor, (object)component) ? this.designerHost.CreateComponent(e.EditorType) as Control : e.Editor;
                this.OnEditorInitialized((object)this, new EditorInitializedEventArgs(property, control, control.GetType()));
            }
            Binding binding = this.CreateBinding(control, "Checked", property.Name);

            if (binding != null)
            {
                control.DataBindings.Add(binding);
            }
            return(control);
        }