本文整理汇总了C#中IVisitor类的典型用法代码示例。如果您正苦于以下问题:C# IVisitor类的具体用法?C# IVisitor怎么用?C# IVisitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVisitor类属于命名空间,在下文中一共展示了IVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: foreach
void IAlgorithms.Accept(IVisitor visitor)
{
foreach (IAlgorithm a in this._lstAlgorithm)
{
visitor.Visit(a);
}
}
示例2: AcceptVisit
public override void AcceptVisit(IVisitor visitor)
{
visitor.StartVisit<ISimpleFixture>(this);
MaterialFactory.AcceptVisit(visitor);
ShapeFactory.AcceptVisit(visitor);
visitor.EndVisit<ISimpleFixture>(this);
}
示例3: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
if (Condition != null)
Condition.Visit(visitor);
if (Code != null)
Code.Visit(visitor);
}
示例4: Accept
public void Accept(IVisitor visitor)
{
foreach (var account in this.accounts)
{
account.Accept(visitor);
}
}
示例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;
}
}
}
}
示例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);
}
}
}
}
示例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]) );
}
}
示例8: Visit
public void Visit(IVisitor visitor)
{
foreach (var employee in this.employees)
{
visitor.Visit(employee);
}
}
示例9: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
foreach (var n in Content)
{
n.Visit(visitor);
}
}
示例10: Accept
public void Accept(IVisitor visitor)
{
visitor.VisitScene(this);
foreach (IVisitable childScene in this.ChildGraphs)
childScene.Accept(visitor);
}
示例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);
}
示例12: Accept
public override void Accept(IVisitor visitor)
{
if (visitor != null)
{
visitor.Visit(this);
}
}
示例13: Accept
public void Accept(IVisitor visitor)
{
foreach (IEntity entity in Entities)
{
entity.Accept(visitor);
}
}
示例14: OnVisitChildNodes
public override void OnVisitChildNodes(IVisitor visitor)
{
foreach (var e in Expressions)
{
e.Visit(visitor);
}
}
示例15: Accept
public void Accept(IVisitor visitor)
{
AdditionVisitor addVisitor = visitor as AdditionVisitor;
if (addVisitor != null)
addVisitor.args[Strings.result] = addVisitor.add();
}