本文整理汇总了C#中this.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# this.Accept方法的具体用法?C# this.Accept怎么用?C# this.Accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类this
的用法示例。
在下文中一共展示了this.Accept方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Accept
internal static void Accept(this ControlPropertyBag propertyBag, ControlPropertyFiller[] fillers)
{
foreach (var filler in fillers)
{
propertyBag.Accept(filler);
}
}
示例2: InterceptMethodCalls
/// <summary>
/// Modifies the current <paramref name="target"/> to support third-party method call interception for all method calls made inside the target.
/// </summary>
/// <param name="target">The target object.</param>
/// <param name="methodCallFilter">The <see cref="IMethodCallFilter"/> instance that determines the method calls that will be intercepted.</param>
/// <param name="hostMethodFilter">The <see cref="IMethodFilter"/> instance that determines the host method calls that will be modified</param>
public static void InterceptMethodCalls(this IReflectionVisitable target, IMethodCallFilter methodCallFilter,
IMethodFilter hostMethodFilter)
{
var rewriter = new InterceptMethodCalls(methodCallFilter);
target.Accept(new ImplementModifiableType(GetDefaultTypeFilter()));
target.WeaveWith(rewriter, hostMethodFilter.ShouldWeave);
}
示例3: FindProjects
/// <summary>
/// Finds all projects in the solution matching the given predicate.
/// </summary>
/// <param name="solution">The solution to traverse.</param>
/// <param name="predicate">Predicate used to match projects.</param>
/// <returns>All project nodes matching the given predicate that were found.</returns>
public static IEnumerable<IProjectNode> FindProjects (this ISolutionNode solution, Func<IProjectNode, bool> predicate)
{
var visitor = new FilteringProjectsVisitor(predicate);
solution.Accept (visitor);
return visitor.Projects;
}
示例4: FindProject
/// <summary>
/// Finds the first project in the solution matching the given predicate.
/// </summary>
/// <param name="solution">The solution to traverse.</param>
/// <param name="predicate">Predicate used to match projects.</param>
/// <returns>The first project matching the given predicate, or <see langword="null"/>.</returns>
public static IProjectNode FindProject (this ISolutionNode solution, Func<IProjectNode, bool> predicate)
{
var visitor = new FilteringProjectsVisitor(predicate, true);
solution.Accept (visitor);
return visitor.Projects.FirstOrDefault ();
}
示例5: GetGraph
public static RulesEngineGraph GetGraph(this OdoyuleRulesEngine rulesEngine)
{
var inspector = new GraphRulesEngineVisitor();
rulesEngine.Accept(inspector);
return inspector.Graph;
}
示例6: InterceptMethodBody
public static void InterceptMethodBody(this IReflectionStructureVisitable target,
Func<MethodReference, bool> methodFilter, Func<TypeReference, bool> typeFilter)
{
target.Accept(new ImplementModifiableType(typeFilter));
var interceptMethodBody = new InterceptMethodBody(methodFilter);
target.WeaveWith(interceptMethodBody, methodFilter);
}
示例7: ShowVisualizer
public static void ShowVisualizer(this RulesEngine engine)
{
var visitor = new GraphRulesEngineVisitor();
engine.Accept(visitor);
RulesEngineGraph graph = visitor.Graph;
RulesEngineDebugVisualizer.Show(graph);
}
示例8: GetTcpListener
/// <summary>
/// Return a concrete implementation of a TCP listener
/// </summary>
/// <param name="port"></param>
/// <param name="protocol"></param>
/// <returns></returns>
public static ICommServer GetTcpListener(
this Socket port,
IProtocol protocol)
{
var client = port.Accept();
Debug.Print("open");
return new TcpServer(
client,
protocol);
}
示例9: ToListenerObservable
public static IObservable<Socket> ToListenerObservable(this Socket socket, int backlog, Selector selector)
{
return Observable.Create<Socket>(observer =>
{
socket.Listen(backlog);
selector.AddCallback(SelectMode.SelectRead, socket, _ =>
{
var accepted = socket.Accept();
accepted.Blocking = false;
observer.OnNext(accepted);
});
return Disposable.Create(() => selector.RemoveCallback(SelectMode.SelectRead, socket));
});
}
示例10: GenerateExpressionSyntax
public static ExpressionSyntax GenerateExpressionSyntax(
this ITypeSymbol typeSymbol)
{
return typeSymbol.Accept(ExpressionSyntaxGeneratorVisitor.Instance).WithAdditionalAnnotations(Simplifier.Annotation);
}
示例11: AsiToString
public static String AsiToString(this IAsi asi)
=> asi.Accept(Program.DefaultPrinter).Trim('"');
示例12: GetInnermostAtomicStatement
/// <summary>
/// Extracts the first innermost atomic statement inside a given statement.
/// </summary>
/// <param name="stmt"></param>
/// <returns></returns>
public static Statement GetInnermostAtomicStatement(this Statement stmt)
{
InnermostAtomicStatementExtractor ase = new InnermostAtomicStatementExtractor();
stmt.Accept(ase);
return ase.Result;
}
示例13: Accept
/// <summary>
/// Allows a <see cref="ITypeWeaver"/> instance to traverse any <see cref="IReflectionStructureVisitable"/>
/// instance.
/// </summary>
/// <param name="visitable">The visitable object.</param>
/// <param name="typeWeaver">The type weaver.</param>
public static void Accept(this IReflectionStructureVisitable visitable, ITypeWeaver typeWeaver)
{
var visitor = new TypeWeaverVisitor(typeWeaver);
visitable.Accept(visitor);
}
示例14: ToLogString
public static string ToLogString(this QueryNode node)
{
return node.Accept(new QueryNodeToStringVisitor());
}
示例15: Modifies
/// <summary>
/// Returns <c>true</c> if the given statement modifies the given variable.
/// </summary>
/// <remarks>
/// The current implementation is not capable of detecting modifications of variables which are referenced as "out" arguments of some method.
/// </remarks>
/// <param name="stmt">statement</param>
/// <param name="variable">variable</param>
public static bool Modifies(this Statement stmt, IStorable variable)
{
VariableModificationDetector vmd = new VariableModificationDetector(variable);
stmt.Accept(vmd);
return vmd.Result;
}