private void OnPropertyValueUIItemInvoke(ITypeDescriptorContext context, PropertyDescriptor descriptor, PropertyValueUIItem invokedItem)
        {
            LocalUIItem      item    = (LocalUIItem)invokedItem;
            IServiceProvider service = null;
            Control          control = item.Binding.Control;

            if (control.Site != null)
            {
                service = (IServiceProvider)control.Site.GetService(typeof(IServiceProvider));
            }
            if (service != null)
            {
                AdvancedBindingPropertyDescriptor.advancedBindingEditor.EditValue(context, service, control.DataBindings);
            }
        }
Exemple #2
0
        private void OnPropertyValueUIItemInvoke(ITypeDescriptorContext context, PropertyDescriptor descriptor, PropertyValueUIItem invokedItem)
        {
            LocalUIItem      localItem = (LocalUIItem)invokedItem;
            IServiceProvider sop       = null;
            Control          control   = localItem.Binding.Control;

            if (control.Site != null)
            {
                sop = ( IServiceProvider )control.Site.GetService(typeof(IServiceProvider));
            }
            if (sop != null)
            {
                AdvancedBindingPropertyDescriptor advancedPropDesc = new AdvancedBindingPropertyDescriptor();
                AdvancedBindingObject             advancedObject   = (AdvancedBindingObject)advancedPropDesc.GetValue(control.DataBindings);
                AdvancedBindingPropertyDescriptor.advancedBindingEditor.EditValue(context, sop, advancedObject);
            }
        }
        private void OnPropertyValueUIItemInvoke(ITypeDescriptorContext context, PropertyDescriptor descriptor, PropertyValueUIItem invokedItem)
        {
            // TODO: design a way for consumers to register own AdvancedBindingEditor
#if DESIGNER_DATABINDING
            LocalUIItem      localItem = (LocalUIItem)invokedItem;
            IServiceProvider sop       = null;
            Control          control   = localItem.Binding.Control;
            if (control.Site != null)
            {
                sop = (IServiceProvider)control.Site.GetService(typeof(IServiceProvider));
            }

            if (sop != null)
            {
                AdvancedBindingPropertyDescriptor.advancedBindingEditor.EditValue(context, sop, control.DataBindings);
            }
#endif
        }