ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Accept

Provides a generic visitor Method Extension for more information, please have a look at my blog post : http://www.dotnetguru2.org/nicolaspenin/index.php?title=generic_visitor_implementation_thanks_to_0&more=1&c=1&tb=1&pb=1

Source

public static void Accept<T, V>(this T visitable,
  V visitor, VisitorContext context)
  where V : IVisitor<T>
{
    visitor.Visit(visitable, context);
}

Example

object o;
o.Accept(visitor,context);

Author: Nicolas Penin

Submitted on: 26 mrt. 2009

Language: C#

Type: System.Object

Views: 5133