NArrange.Core.CodeElements.TypeElement.AddInterface C# (CSharp) Method

AddInterface() public method

Adds an interface implementation to the type definition.
public AddInterface ( InterfaceReference interfaceReference ) : void
interfaceReference InterfaceReference The interface reference.
return void
        public void AddInterface(InterfaceReference interfaceReference)
        {
            if (interfaceReference != null)
            {
                BaseInterfaces.Add(interfaceReference);
            }
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Clones an attributed element.
        /// </summary>
        /// <returns>Cloned attribute element state.</returns>
        protected override AttributedElement DoAttributedClone()
        {
            TypeElement clone = new TypeElement();

            //
            // Copy state
            //
            clone._typeModifiers = _typeModifiers;
            clone._type          = _type;
            foreach (InterfaceReference interfaceReference in Interfaces)
            {
                InterfaceReference referenceClone = interfaceReference.Clone() as InterfaceReference;
                clone.AddInterface(referenceClone);
            }
            foreach (TypeParameter typeParam in TypeParameters)
            {
                TypeParameter typeParamClone = typeParam.Clone() as TypeParameter;
                clone.TypeParametersBase.Add(typeParamClone);
            }

            return(clone);
        }
All Usage Examples Of NArrange.Core.CodeElements.TypeElement::AddInterface