/// <summary>
 ///   Adds the passed <see cref="IBusinessObjectBoundControl"/> to the list of controls bound to this <see cref="BusinessObjectDataSource"/>.
 /// </summary>
 /// <param name="control">
 ///   The <see cref="IBusinessObjectBoundControl"/> to be registered with this <see cref="BusinessObjectDataSource"/>.
 /// </param>
 public void Register(IBusinessObjectBoundControl control)
 {
     ArgumentUtility.CheckNotNull("control", control);
     if (!_boundControls.Contains(control))
     {
         _boundControls.Add(control);
     }
 }
        protected override EditorControlBase CreateEditorControl(ITypeDescriptorContext context, IServiceProvider provider, IWindowsFormsEditorService editorService)
        {
            ArgumentUtility.CheckNotNull("context", context);
            ArgumentUtility.CheckNotNull("provider", provider);
            ArgumentUtility.CheckNotNull("editorService", editorService);

            IBusinessObjectBoundControl control = context.Instance as IBusinessObjectBoundControl;

            if (control == null)
            {
                throw new InvalidOperationException("Cannot use PropertyPickerEditor for objects other than IBusinessObjectBoundControl.");
            }

            return(new PropertyPickerControl(control, provider, editorService));
        }
示例#3
0
        public PropertyPickerControl(IBusinessObjectBoundControl control, IServiceProvider provider, IWindowsFormsEditorService editorService)
            : base(provider, editorService)
        {
            ArgumentUtility.CheckNotNull("control", control);

            if (control.DataSource == null)
            {
                throw new InvalidOperationException("Cannot use PropertyPickerControl for controls without DataSource.");
            }

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _control = control;

            FillList();
        }
 /// <summary>
 ///   Removes the passed <see cref="IBusinessObjectBoundControl"/> from the list of controls bound to this <see cref="BusinessObjectDataSource"/>.
 /// </summary>
 /// <param name="control">
 ///   The <see cref="IBusinessObjectBoundControl"/> to be unregistered from this <see cref="BusinessObjectDataSource"/>.
 /// </param>
 public void Unregister(IBusinessObjectBoundControl control)
 {
     ArgumentUtility.CheckNotNull("control", control);
     _boundControls.Remove(control);
 }
示例#5
0
 /// <summary>
 ///   Removes the passed <see cref="IBusinessObjectBoundControl"/> from the list of controls bound to this <see cref="BusinessObjectReferenceDataSourceControl"/>.
 /// </summary>
 /// <param name="control">
 ///   The <see cref="IBusinessObjectBoundControl"/> to be unregistered from this <see cref="BusinessObjectReferenceDataSourceControl"/>.
 /// </param>
 public void Unregister(IBusinessObjectBoundControl control)
 {
     _internalDataSource.Unregister(control);
 }
示例#6
0
 /// <summary>
 ///   Removes the passed <see cref="IBusinessObjectBoundControl"/> from the list of controls bound to this <see cref="BusinessObjectDataSourceControl"/>.
 /// </summary>
 /// <param name="control">
 ///   The <see cref="IBusinessObjectBoundControl"/> to be unregistered from this <see cref="BusinessObjectDataSourceControl"/>.
 /// </param>
 /// <remarks>
 ///   Executes the <see cref="IBusinessObjectDataSource.Unregister"/> method of the encapsulated <see cref="IBusinessObjectDataSource"/>.
 /// </remarks>
 public virtual void Unregister(IBusinessObjectBoundControl control)
 {
     InnerDataSource.Unregister(control);
 }