public static CompositeHandler <T> Create(ISelectionProvider <T> selection, string virtualPropertyName,
                                                  IOptionItem currentItem)
        {
            CompositeHandler <T> handler = new CompositeHandler <T>(selection, virtualPropertyName, currentItem);

            return(handler);
        }
        internal static bool BindItemHelper(IOptionItem item, string virtualPropertyName, IOptionGroup group, ISelectionProvider <T> selectionProvider, string prefix, bool addToOptionHandler)
        {
            bool retval = false;
            IOptionItemFilter <T> filter = item.Lookup <IOptionItemFilter <T> >();
            string finalName             = DefaultOptionBuilderContext <object> .CreatePrefix(prefix, virtualPropertyName);

            OptionItemValidities validities;

            if (filter == null)
            {
                validities = CheckValidity(new DefaultOptionItemFilter <T>(finalName), selectionProvider);
            }
            else
            {
                validities = CheckValidity(new DefaultOptionItemFilter <T>(finalName), selectionProvider)
                             & CheckValidity(filter, selectionProvider);
            }
            if (validities != OptionItemValidities.Invalid)
            {
                CompositeHandler <T> .Create(selectionProvider, finalName, item);

                if (addToOptionHandler)
                {
                    group.Items.Add(item);
                }
                retval = true;
                if (validities != OptionItemValidities.ReadWrite)
                {
                    item.Enabled = false;
                }
            }
            return(retval);
        }