Exemplo n.º 1
0
        /// <include file='doc\DesignSite.uex' path='docs/doc[@for="DesignSite.IExtenderListService.GetExtenderProviders"]/*' />
        /// <devdoc>
        ///     Retrieves a list of extender provides for the component.
        ///
        /// </devdoc>
        IExtenderProvider[] IExtenderListService.GetExtenderProviders()
        {
            //ArrayList list = null;

            // This component cannot be extended if it is privately inherited.
            //
            if (!TypeDescriptor.GetAttributes(component).Contains(InheritanceAttribute.InheritedReadOnly))
            {
                return(host.GetExtenderProviders());

                // for performance reasons, we don't want to do this because it gets called all the time.
                // we'll do the check for can extend in the TypeDescriptor when the set of exteders
                // changes.
                //
                // the net effect of this is clients need to call typedescriptor.refresh if they want
                // to change the status of an extender on a particular component.
                //

                /*IExtenderProvider[] providers = host.GetExtenderProviders();
                 * for (int i = 0; i < providers.Length; i++) {
                 *  IExtenderProvider provider = providers[i];
                 *
                 *  if (provider.CanExtend(component)) {
                 *      if (list == null) {
                 *          list = new ArrayList();
                 *      }
                 *      list.Add(provider);
                 *  }
                 * } */
            }

            /*if(list == null) {
             *  return null;
             * }
             * return(IExtenderProvider[]) list.ToArray(typeof(IExtenderProvider));*/
            return(null);
        }