本文整理汇总了C#中IVisitor类的典型用法代码示例。如果您正苦于以下问题:C# IVisitor类的具体用法?C# IVisitor怎么用?C# IVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVisitor类属于命名空间,在下文中一共展示了IVisitor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: foreach
void IAlgorithms.Accept(IVisitor visitor)
{
foreach (IAlgorithm a in this._lstAlgorithm)
{
visitor.Visit(a);
}
}
开发者ID:truonghinh,项目名称:TnX,代码行数:7,代码来源:Algorithms.cs
示例2: AcceptVisit
public override void AcceptVisit(IVisitor visitor)
{
visitor.StartVisit<ISimpleFixture>(this);
MaterialFactory.AcceptVisit(visitor);
ShapeFactory.AcceptVisit(visitor);
visitor.EndVisit<ISimpleFixture>(this);
}
开发者ID:sandygk,项目名称:System.Physics,代码行数:7,代码来源:ISimpleFixture.cs
示例3: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
if (Condition != null)
Condition.Visit(visitor);
if (Code != null)
Code.Visit(visitor);
}
开发者ID:blyry,项目名称:MiniME,代码行数:7,代码来源:StatementTryCatchFinally.cs
示例4: Accept
public void Accept(IVisitor visitor)
{
foreach (var account in this.accounts)
{
account.Accept(visitor);
}
}
开发者ID:VDGone,项目名称:TelerikAcademy-1,代码行数:7,代码来源:Bank.cs
示例5: RunInDepth
private void RunInDepth(WorkFlowContext context, IVisitor visitor)
{
if (string.IsNullOrEmpty(context.SourceState))
{
return;
}
else
{
foreach (var item in this.GetActivities(context).OrderBy(x => x.Operation))
{
context.Operation = item.Operation;
string newstatus = this.GetNextStatus(context);
string laststate = context.SourceState;
string transition = string.Format("{0},{1},{2}", context.SourceState, item.Description, newstatus);
if (NotPresent(transition))
{
visitor.Visit(context.SourceState, new Activity { Operation = item.Operation, Description = item.Description }, newstatus);
context.SourceState = newstatus;
RunInDepth(context, visitor);
context.SourceState = laststate;
}
}
}
}
开发者ID:yonglehou,项目名称:LightWorkFlow,代码行数:25,代码来源:Runner.cs
示例6: RunInWidth
private void RunInWidth(WorkFlowContext context, IVisitor visitor)
{
Queue<string> fila = new Queue<string>();
List<string> mark = new List<string>();
fila.Enqueue(context.SourceState);
mark.Add(context.SourceState);
while (fila.Count != 0)
{
string statusfila = fila.Dequeue();
context.SourceState = statusfila;
foreach (var item in this.GetActivities(context).OrderBy(x => x.Operation))
{
context.Operation = item.Operation;
string newstatus = this.GetNextStatus(context);
visitor.Visit(statusfila, new Activity { Operation = item.Operation, Description = item.Description }, newstatus);
if (!mark.Contains(newstatus))
{
fila.Enqueue(newstatus);
mark.Add(newstatus);
}
}
}
}
开发者ID:yonglehou,项目名称:LightWorkFlow,代码行数:26,代码来源:Runner.cs
示例7: Logger
/**
* Create a new Logger, which has as initial trace a sequence of
* visiting events where the visitor <code>v</code> visits each of
* the <code>nodes</code>
*/
public Logger(IVisitor v, IVisitable[] nodes)
{
for (int i = 0; i < nodes.Length; i++)
{
log( new Event(v, nodes[i]) );
}
}
开发者ID:cwi-swat,项目名称:jjtraveler-csharp,代码行数:12,代码来源:Logger.cs
示例8: Visit
public void Visit(IVisitor visitor)
{
foreach (var employee in this.employees)
{
visitor.Visit(employee);
}
}
开发者ID:jibedoubleve,项目名称:gof-patterns,代码行数:7,代码来源:Employees.cs
示例9: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
foreach (var n in Content)
{
n.Visit(visitor);
}
}
开发者ID:blyry,项目名称:MiniME,代码行数:7,代码来源:StatementBlock.cs
示例10: Accept
public void Accept(IVisitor visitor)
{
visitor.VisitScene(this);
foreach (IVisitable childScene in this.ChildGraphs)
childScene.Accept(visitor);
}
开发者ID:pb-pravin,项目名称:fsharp-learning,代码行数:7,代码来源:VisitorPattern.cs
示例11: Accept
private bool Accept(IVisitor visitor, Stack<int> inStack, Stack<int> resumeStack)
{
if (visitor.VisitEnter(this)) {
int firstChild = 0;
if (resumeStack.Count > 0) {
firstChild = resumeStack.Pop();
if (resumeStack.Count == 0) {
// If this is the node we found last time then start looking at the next one
firstChild++;
}
}
for (int i = firstChild; i < Children.Count(); i++) {
Composite c = Children.ElementAt(i);
if (!c.Accept(visitor, inStack, resumeStack)) {
inStack.Push(i);
break;
}
}
}
return visitor.VisitExit(this);
}
开发者ID:chrisdotwood,项目名称:Test-of-GitHub,代码行数:25,代码来源:Composite.cs
示例12: Accept
public override void Accept(IVisitor visitor)
{
if (visitor != null)
{
visitor.Visit(this);
}
}
开发者ID:nuxleus,项目名称:ajaxmin,代码行数:7,代码来源:voidop.cs
示例13: Accept
public void Accept(IVisitor visitor)
{
foreach (IEntity entity in Entities)
{
entity.Accept(visitor);
}
}
开发者ID:dance2die,项目名称:Learn.Pluralsight.DesignPatternsLibrary,代码行数:7,代码来源:Program.cs
示例14: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
foreach (var e in Expressions)
{
e.Visit(visitor);
}
}
开发者ID:blyry,项目名称:MiniME,代码行数:7,代码来源:ExprNodeComposite.cs
示例15: Accept
public void Accept(IVisitor visitor)
{
AdditionVisitor addVisitor = visitor as AdditionVisitor;
if (addVisitor != null)
addVisitor.args[Strings.result] = addVisitor.add();
}
开发者ID:Andrew-College,项目名称:Com-Tutorial,代码行数:7,代码来源:Maths.cs
示例16: Accept
public void Accept(IVisitor visitor)
{
foreach (var asset in _assets)
{
asset.Accept(visitor);
}
}
开发者ID:KasperSK,项目名称:I4SWD,代码行数:7,代码来源:Class1.cs
示例17: AcceptVisit
public void AcceptVisit(IVisitor visitor)
{
visitor.StartVisit<ISimulator>(this);
ActorsFactory.AcceptVisit(visitor);
ConstraintsFactory.AcceptVisit(visitor);
visitor.EndVisit<ISimulator>(this);
}
开发者ID:sandygk,项目名称:System.Physics,代码行数:7,代码来源:BaseSimulator.cs
示例18: GarbageCollector
public GarbageCollector(List<IMemoryProfile> memoryProfiles, IVisitor visitor)
{
foreach (var item in memoryProfiles)
{
item.Accept(visitor);
}
}
开发者ID:maque,项目名称:DesignPatterns,代码行数:7,代码来源:main.cs
示例19: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
foreach (var kp in Values)
{
kp.Value.Visit(visitor);
}
}
开发者ID:blyry,项目名称:MiniME,代码行数:7,代码来源:ExprNodeObjectLiteral.cs
示例20: Accept
public void Accept(IVisitor visitor)
{
foreach (var employee in this.employees)
{
employee.Accept(visitor);
}
}
开发者ID:deyantodorov,项目名称:TelerikAcademy,代码行数:7,代码来源:Employees.cs
注:本文中的IVisitor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论