System.ComponentModel.MemberDescriptor.MemberDescriptor C# (CSharp) Method

MemberDescriptor() protected method

Initializes a new instance of the class with the name in the specified and the attributes in both the old and the array.

protected MemberDescriptor ( MemberDescriptor oldMemberDescriptor, Attribute newAttributes ) : System.Collections
oldMemberDescriptor MemberDescriptor
newAttributes Attribute
return System.Collections
        protected MemberDescriptor(MemberDescriptor oldMemberDescriptor, Attribute[] newAttributes)
        {
            _name = oldMemberDescriptor.Name;
            _displayName = oldMemberDescriptor.DisplayName;
            _nameHash = _name.GetHashCode();

            ArrayList newArray = new ArrayList();

            if (oldMemberDescriptor.Attributes.Count != 0)
            {
                foreach (object o in oldMemberDescriptor.Attributes)
                {
                    newArray.Add(o);
                }
            }

            if (newAttributes != null)
            {
                foreach (object o in newAttributes)
                {
                    newArray.Add(o);
                }
            }

            _attributes = new Attribute[newArray.Count];
            newArray.CopyTo(_attributes, 0);
            _attributesFiltered = false;

            _originalAttributes = _attributes;
        }

Same methods

MemberDescriptor::MemberDescriptor ( MemberDescriptor descr ) : System.Collections
MemberDescriptor::MemberDescriptor ( string name ) : System.Collections
MemberDescriptor::MemberDescriptor ( string name, Attribute attributes ) : System.Collections