/// <summary>
        /// Allows an <see cref="PropertyInfoElement"/> to be visited.
        /// This method is called when the element accepts this visitor
        /// instance.
        /// </summary>
        /// <param name="propertyInfoElement">
        /// The <see cref="PropertyInfoElement"/> being visited.
        /// </param>
        /// <returns>
        /// A <see cref="IReflectionVisitor{T}" /> instance which can be used
        /// to continue the visiting process with potentially updated
        /// observations.
        /// </returns>
        /// <remarks>
        /// <para>
        /// This implementation relays the two <see cref="MethodInfoElement"/> instances
        /// from the getter and setter of the <see cref="PropertyInfoElement"/> parameter,
        /// to <see cref="Visit(MethodInfoElement)"/>,
        /// but since the method is virtual, child classes can override it.
        /// </para>
        /// </remarks>
        public virtual IReflectionVisitor <T> Visit(
            PropertyInfoElement propertyInfoElement)
        {
            if (propertyInfoElement == null)
            {
                throw new ArgumentNullException("propertyInfoElement");
            }

            var getMethodInfoElement = propertyInfoElement.GetGetMethodInfoElement();
            var setMethodInfoElement = propertyInfoElement.GetSetMethodInfoElement();

            IReflectionVisitor <T> visitor = this;

            if (getMethodInfoElement != null)
            {
                visitor = visitor.Visit(getMethodInfoElement);
            }

            if (setMethodInfoElement != null)
            {
                visitor = visitor.Visit(setMethodInfoElement);
            }

            return(visitor);
        }
Example #2
0
        public void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitModuleDefinition(this);

            this.Types.Accept(visitor);
            this.TypeReferences.Accept(visitor);
        }
Example #3
0
 internal VisitorEqualityComparer(
     IReflectionVisitor <IEnumerable <T> > visitor,
     IEqualityComparer <T> comparer)
 {
     this.visitor  = visitor;
     this.comparer = comparer;
 }
 internal ReflectionVisitorElementComparer(
     IReflectionVisitor <IEnumerable <T> > visitor,
     IEqualityComparer <T> comparer = null)
 {
     this.visitor  = visitor;
     this.comparer = comparer ?? EqualityComparer <T> .Default;
 }
Example #5
0
 /// <summary>
 /// Accepts the provided <see cref="IReflectionVisitor{T}"/>, by calling the
 /// appropriate strongly-typed <see cref="IReflectionVisitor{T}.Visit(PropertyInfoElement)"/>
 /// method on the visitor.
 /// </summary>
 /// <typeparam name="T">The type of observation or result which the
 /// <see cref="IReflectionVisitor{T}"/> instance produces when visiting nodes.</typeparam>
 /// <param name="visitor">The <see cref="IReflectionVisitor{T}"/> instance.</param>
 /// <returns>A (potentially) new <see cref="IReflectionVisitor{T}"/> instance which can be
 /// used to continue the visiting process with potentially updated observations.</returns>
 public IReflectionVisitor <T> Accept <T>(IReflectionVisitor <T> visitor)
 {
     if (visitor == null)
     {
         throw new ArgumentNullException("visitor");
     }
     return(visitor.Visit(this));
 }
		public override void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitFieldDefinition (this);

			if (this.MarshalInfo != null)
				this.MarshalInfo.Accept (visitor);

            visitor.VisitCustomAttributeCollection(this.CustomAttributes);
		}
Example #7
0
 /// <summary>
 /// Accepts the <see cref="IReflectionVisitor{T}"/> visitor on each of the
 /// <paramref name="elements"/> in the sequence.
 /// </summary>
 /// <typeparam name="T">
 /// The type of observation or result which the <see cref="IReflectionVisitor{T}"/>
 /// instance produces when visiting nodes.
 /// </typeparam>
 /// <param name="elements">
 /// The sequence of <see cref="IReflectionElement"/> instances upon which
 /// the <see cref="IReflectionElement.Accept{T}"/> method will be called.
 /// </param>
 /// <param name="visitor">The <see cref="IReflectionVisitor{T}"/> instance.</param>
 /// <returns>
 /// A (potentially) new <see cref="IReflectionVisitor{T}"/> instance which can be
 /// used to continue the visiting process with potentially updated observations.
 /// </returns>
 public static IReflectionVisitor <T> Accept <T>(
     this IEnumerable <IReflectionElement> elements,
     IReflectionVisitor <T> visitor)
 {
     if (elements == null)
     {
         throw new ArgumentNullException("elements");
     }
     return(new CompositeReflectionElement(elements.ToArray()).Accept(visitor));
 }
Example #8
0
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitParameterDefinition(this);

            if (this.MarshalInfo != null)
            {
                this.MarshalInfo.Accept(visitor);
            }

            visitor.VisitCustomAttributeCollection(this.CustomAttributes);
        }
        public void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitParameterDefinition(this);

            if (this.MarshalSpec != null)
            {
                this.MarshalSpec.Accept(visitor);
            }

            this.CustomAttributes.Accept(visitor);
        }
Example #10
0
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitFieldDefinition(this);

            if (this.MarshalSpec != null)
            {
                this.MarshalSpec.Accept(visitor);
            }

            this.CustomAttributes.Accept(visitor);
        }
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitMethodDefinition(this);
            visitor.VisitGenericParameterCollection(this.GenericParameters);
            visitor.VisitParameterDefinitionCollection(this.Parameters);

            if (this.PInvokeInfo != null)
                this.PInvokeInfo.Accept(visitor);

            visitor.VisitSecurityDeclarationCollection(this.SecurityDeclarations);
            visitor.VisitOverrideCollection(this.Overrides);
            visitor.VisitCustomAttributeCollection(this.CustomAttributes);
        }
Example #12
0
        /// <summary>
        /// Allows an <see cref="EventInfoElement"/> to be visited. This method
        /// is called when the element accepts this visitor instance.
        /// </summary>
        /// <param name="eventInfoElement">
        /// The <see cref="EventInfoElement"/> being visited.
        /// </param>
        /// <returns>
        /// A <see cref="IReflectionVisitor{T}" /> instance which can be used
        /// to continue the visiting process with potentially updated
        /// observations.
        /// </returns>
        /// <remarks>
        /// <para>
        /// This implementation simply returns
        /// <paramref name="eventInfoElement" /> without doing anything, but
        /// since the method is virtual, child classes can override it.
        /// </para>
        /// </remarks>
        public virtual IReflectionVisitor <T> Visit(
            EventInfoElement eventInfoElement)
        {
            if (eventInfoElement == null)
            {
                throw new ArgumentNullException("eventInfoElement");
            }

            IReflectionVisitor <T> visitor = this;

            visitor = visitor.Visit(eventInfoElement.GetAddMethodInfoElement());
            visitor = visitor.Visit(eventInfoElement.GetRemoveMethodInfoElement());
            return(visitor);
        }
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitTypeDefinition(this);

            visitor.VisitGenericParameterCollection(this.GenericParameters);
            visitor.VisitInterfaceCollection(this.Interfaces);
            visitor.VisitConstructorCollection(this.Constructors);
            visitor.VisitMethodDefinitionCollection(this.StrictMethods);
            visitor.VisitFieldDefinitionCollection(this.Fields);
            visitor.VisitPropertyDefinitionCollection(this.Properties);
            visitor.VisitEventDefinitionCollection(this.Events);
            visitor.VisitNestedTypeCollection(this.NestedTypes);
            visitor.VisitCustomAttributeCollection(this.CustomAttributes);
            visitor.VisitSecurityDeclarationCollection(this.SecurityDeclarations);
        }
Example #14
0
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitTypeDefinition(this);

            visitor.VisitGenericParameterCollection(this.GenericParameters);
            visitor.VisitInterfaceCollection(this.Interfaces);
            visitor.VisitConstructorCollection(this.Constructors);
            visitor.VisitMethodDefinitionCollection(this.StrictMethods);
            visitor.VisitFieldDefinitionCollection(this.Fields);
            visitor.VisitPropertyDefinitionCollection(this.Properties);
            visitor.VisitEventDefinitionCollection(this.Events);
            visitor.VisitNestedTypeCollection(this.NestedTypes);
            visitor.VisitCustomAttributeCollection(this.CustomAttributes);
            visitor.VisitSecurityDeclarationCollection(this.SecurityDeclarations);
        }
Example #15
0
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitMethodDefinition(this);
            visitor.VisitGenericParameterCollection(this.GenericParameters);
            visitor.VisitParameterDefinitionCollection(this.Parameters);

            if (this.PInvokeInfo != null)
            {
                this.PInvokeInfo.Accept(visitor);
            }

            visitor.VisitSecurityDeclarationCollection(this.SecurityDeclarations);
            visitor.VisitOverrideCollection(this.Overrides);
            visitor.VisitCustomAttributeCollection(this.CustomAttributes);
        }
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitTypeDefinition(this);

            this.GenericParameters.Accept(visitor);
            this.Interfaces.Accept(visitor);
            this.Constructors.Accept(visitor);
            this.Methods.Accept(visitor);
            this.Fields.Accept(visitor);
            this.Properties.Accept(visitor);
            this.Events.Accept(visitor);
            this.NestedTypes.Accept(visitor);
            this.CustomAttributes.Accept(visitor);
            this.SecurityDeclarations.Accept(visitor);
        }
Example #17
0
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitTypeDefinition (this);

            this.GenericParameters.Accept (visitor);
            this.Interfaces.Accept (visitor);
            this.Constructors.Accept (visitor);
            this.Methods.Accept (visitor);
            this.Fields.Accept (visitor);
            this.Properties.Accept (visitor);
            this.Events.Accept (visitor);
            this.NestedTypes.Accept (visitor);
            this.CustomAttributes.Accept (visitor);
            this.SecurityDeclarations.Accept (visitor);
        }
Example #18
0
        public void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitEventDefinition (this);

            this.CustomAttributes.Accept (visitor);
        }
		public void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitModuleDefinition (this);
            visitor.VisitTypeDefinitionCollection(this.Types);
            //visitor.VisitTypeReferenceCollection(this.TypeReferences);
		}
        public void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitPropertyDefinition(this);

            this.CustomAttributes.Accept(visitor);
        }
Example #21
0
		public void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitExternTypeCollection (this);
		}
Example #22
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitOverrideCollection(this);
 }
		public override void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitMethodReference (this);
            visitor.VisitGenericParameterCollection(this.GenericParameters);
            visitor.VisitParameterDefinitionCollection(this.Parameters);
		}
Example #24
0
 public abstract void Accept(IReflectionVisitor visitor);
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitEventDefinition(this);

            this.CustomAttributes.Accept(visitor);
        }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitNestedTypeCollection(this);
 }
		public void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitInterfaceCollection (this);
		}
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitCustomAttributeCollection (this);
 }
 public virtual void Accept(IReflectionVisitor visitor)
 {
 }
Example #30
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitMethodDefinitionCollection(this);
 }
Example #31
0
 public void Accept(IReflectionVisitor visitor)
 {
     throw new NotImplementedException();
 }
Example #32
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitPInvokeInfo (this);
 }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitPropertyDefinitionCollection (this);
 }
Example #34
0
 public virtual void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitMarshalSpec (this);
 }
		public void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitGenericParameterCollection (this);
		}
 public override void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitEventDefinition(this);
     visitor.VisitCustomAttributeCollection(this.CustomAttributes);
 }
        public void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitModuleDefinition (this);

            this.Types.Accept (visitor);
            this.TypeReferences.Accept (visitor);
        }
Example #38
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitExternTypeCollection(this);
 }
Example #39
0
 public virtual void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitTypeReference (this);
 }
Example #40
0
 public virtual void Accept(IReflectionVisitor visitor)
 {
 }
Example #41
0
		public abstract void Accept (IReflectionVisitor visitor);
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitInterfaceCollection(this);
 }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitMemberReferenceCollection(this);
 }
Example #44
0
 public ForwardingGenericVisitor(IReflectionVisitor visitor)
 {
     this.visitor = visitor;
 }
Example #45
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitSecurityDeclaration(this);
 }
Example #46
0
 public SemanticElementComparer(
     IReflectionVisitor <IEnumerable> visitor)
 {
     this.visitor = visitor;
 }
		public override void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitTypeReference (this);
		}
		public override void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitPropertyDefinition (this);

			this.CustomAttributes.Accept (visitor);
		}
Example #49
0
		public void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitSecurityDeclaration (this);
		}
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitOverrideCollection (this);
 }
Example #51
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitGenericParameterCollection(this);
 }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitNestedTypeCollection (this);
 }
Example #53
0
        public override void Accept(IReflectionVisitor visitor)
        {
            visitor.VisitParameterDefinition (this);

            if (this.MarshalSpec != null)
                this.MarshalSpec.Accept (visitor);

            this.CustomAttributes.Accept (visitor);
        }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitPropertyDefinitionCollection(this);
 }
Example #55
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitConstructorCollection (this);
 }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitFieldDefinitionCollection (this);
 }
Example #57
0
 /// <summary>
 /// Accepts the <see cref="IReflectionVisitor{T}" /> as per the
 /// Visitor pattern http://en.wikipedia.org/wiki/Visitor_pattern.
 /// </summary>
 /// <typeparam name="T">
 /// The type of observation(s) the visitor might collect.
 /// </typeparam>
 /// <param name="visitor">The visitor to accept.</param>
 /// <returns><paramref name="visitor" /></returns>
 /// <remarks>
 /// <para>
 /// While <strong>NullReflection</strong> partakes in a Visitor
 /// hierarchy, this particular implementation follows the Null Object
 /// pattern, by doing nothing. The way it does nothing is by returning
 /// <paramref name="visitor" />.
 /// </para>
 /// </remarks>
 public IReflectionVisitor <T> Accept <T>(IReflectionVisitor <T> visitor)
 {
     return(visitor);
 }
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitParameterDefinitionCollection (this);
 }
Example #59
0
 public void Accept(IReflectionVisitor visitor)
 {
     visitor.VisitCustomAttributeCollection(this);
 }
		public void Accept (IReflectionVisitor visitor)
		{
			visitor.VisitMemberReferenceCollection (this);
		}