Exemple #1
0
        internal AttributeCollection GetAttributes(object component)
        {
            ArrayList list = new ArrayList();

            if (component is System.Windows.Forms.NativeMethods.IManagedPerPropertyBrowsing)
            {
                object[] componentAttributes = Com2IManagedPerPropertyBrowsingHandler.GetComponentAttributes((System.Windows.Forms.NativeMethods.IManagedPerPropertyBrowsing)component, -1);
                for (int i = 0; i < componentAttributes.Length; i++)
                {
                    list.Add(componentAttributes[i]);
                }
            }
            if (Com2ComponentEditor.NeedsComponentEditor(component))
            {
                EditorAttribute attribute = new EditorAttribute(typeof(Com2ComponentEditor), typeof(ComponentEditor));
                list.Add(attribute);
            }
            if ((list == null) || (list.Count == 0))
            {
                return(this.staticAttrs);
            }
            Attribute[] array = new Attribute[list.Count];
            list.CopyTo(array, 0);
            return(new AttributeCollection(array));
        }
        /// <summary>
        /// Got attributes?
        /// </summary>
        internal AttributeCollection GetAttributes(object component)
        {
            ArrayList attrs = new ArrayList();

            if (component is NativeMethods.IManagedPerPropertyBrowsing)
            {
                object[] temp = Com2IManagedPerPropertyBrowsingHandler.GetComponentAttributes((NativeMethods.IManagedPerPropertyBrowsing)component, NativeMethods.MEMBERID_NIL);
                for (int i = 0; i < temp.Length; ++i)
                {
                    attrs.Add(temp[i]);
                }
            }

            if (Com2ComponentEditor.NeedsComponentEditor(component))
            {
                EditorAttribute a = new EditorAttribute(typeof(Com2ComponentEditor), typeof(ComponentEditor));
                attrs.Add(a);
            }

            if (attrs == null || attrs.Count == 0)
            {
                return(staticAttrs);
            }
            else
            {
                Attribute[] temp = new Attribute[attrs.Count];
                attrs.CopyTo(temp, 0);
                return(new AttributeCollection(temp));
            }
        }
        internal AttributeCollection GetAttributes(object component)
        {
            ArrayList attrs = new ArrayList();

            if (component is VSSDK.IVSMDPerPropertyBrowsing)
            {
                object[] temp = Com2IManagedPerPropertyBrowsingHandler.GetComponentAttributes((VSSDK.IVSMDPerPropertyBrowsing)component, DispatchID.MEMBERID_NIL);
                for (int i = 0; i < temp.Length; ++i)
                {
                    attrs.Add(temp[i]);
                }
            }

            if (Com2ComponentEditor.NeedsComponentEditor(component))
            {
                EditorAttribute a = new EditorAttribute(typeof(Com2ComponentEditor), typeof(ComponentEditor));
                attrs.Add(a);
            }

            if (attrs is null || attrs.Count == 0)
            {
                return(staticAttrs);
            }