本文整理汇总了C#中IVisitor.Visit方法的典型用法代码示例。如果您正苦于以下问题:C# IVisitor.Visit方法的具体用法?C# IVisitor.Visit怎么用?C# IVisitor.Visit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVisitor
的用法示例。
在下文中一共展示了IVisitor.Visit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TraverseFolderHelper
/// <summary>
/// Helper Method to traverse a rootcompareobject and all foldercompareobjects and filecompareobjects under it
/// </summary>
/// <param name="root">RootCompareObject from the previous visitor in order to start the traversal</param>
/// <param name="visitor">A particular visit to visit the RCOs. In this case, it will be the PreviewVisitor</param>
public static void TraverseFolderHelper(RootCompareObject root, IVisitor visitor)
{
visitor.Visit(root);
Dictionary<string, BaseCompareObject>.ValueCollection values = root.Contents.Values;
FolderCompareObject fco;
foreach (BaseCompareObject o in values)
{
if ((fco = o as FolderCompareObject) != null)
TraverseFolderHelper(fco, root.Paths.Length, visitor);
else
visitor.Visit(o as FileCompareObject, root.Paths.Length);
}
}
示例2: foreach
void IAlgorithms.Accept(IVisitor visitor)
{
foreach (IAlgorithm a in this._lstAlgorithm)
{
visitor.Visit(a);
}
}
示例3: 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;
}
}
}
}
示例4: 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);
}
}
}
}
示例5: Accept
public override void Accept(IVisitor visitor)
{
if (visitor != null)
{
visitor.Visit(this);
}
}
示例6: Visit
public void Visit(IVisitor visitor)
{
foreach (var employee in this.employees)
{
visitor.Visit(employee);
}
}
示例7: Accept
public void Accept(IVisitor visitor)
{
visitor.Visit(this);
foreach (var floor in Floors)
{
floor.Accept(visitor);
}
}
示例8: Accept
public void Accept(IVisitor visitor)
{
foreach (var part in this._parts)
{
part.Accept(visitor);
}
visitor.Visit(this);
}
示例9: Accept
public void Accept(IVisitor visitor)
{
visitor.Visit(this);
foreach (var room in Rooms)
{
room.Accept(visitor);
}
}
示例10: TraverseObject
protected virtual void TraverseObject(object @object, IVisitor visitor)
{
if (!visitor.Visit(@object))
{
return;
}
IReflectClass claxx = _reflector.ForObject(@object);
TraverseAllFields(@object, claxx);
}
示例11: Accept
public override void Accept(IVisitor visitor)
{
visitor.Visit(this);
AbstractIterator iter = CreateIterator();
for (iter.First(); !iter.IsDone(); iter.MoveNext())
{
iter.GetCurrent().Accept(visitor);
}
}
示例12: LevelOrderTraverseFolder
private static void LevelOrderTraverseFolder(RootCompareObject root, int numOfPaths, IVisitor visitor, Progress syncProgress)
{
Queue<BaseCompareObject> levelQueue = new Queue<BaseCompareObject>();
RootCompareObject rt;
FolderCompareObject folder = null;
levelQueue.Enqueue(root);
while (levelQueue.Count > 0)
{
if (syncProgress != null && syncProgress.State == SyncState.Cancelled)
return;
BaseCompareObject currObj = levelQueue.Dequeue();
if ((rt = currObj as RootCompareObject) != null)
visitor.Visit(rt);
else if ((folder = currObj as FolderCompareObject) != null)
visitor.Visit(folder, numOfPaths);
else
visitor.Visit(currObj as FileCompareObject, numOfPaths);
Dictionary<string, BaseCompareObject>.ValueCollection values;
if (rt != null)
{
values = rt.Contents.Values;
foreach (BaseCompareObject o in values)
levelQueue.Enqueue(o);
}
else if (folder != null)
{
values = folder.Contents.Values;
foreach (BaseCompareObject o in values)
levelQueue.Enqueue(o);
}
}
}
示例13: Visit
public override void Visit(IVisitor visitor)
{
visitor.Visit(this);
LeftExpression.Visit(visitor);
RightExpression.Visit(visitor);
}
示例14: AcceptVisit
public void AcceptVisit(IVisitor visitor)
{
visitor.Visit<ITriangleShape>(this);
}
示例15: Visit
public void Visit(IVisitor visitor)
{
visitor.Visit(this);
}