当前位置: 首页>>代码示例>>C#>>正文


C# IVisitor.Visit方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:sr3dna,项目名称:big5sync,代码行数:19,代码来源:SyncUIHelper.cs

示例2: foreach

 void IAlgorithms.Accept(IVisitor visitor)
 {
     foreach (IAlgorithm a in this._lstAlgorithm)
     {
         visitor.Visit(a);
     }
 }
开发者ID:truonghinh,项目名称:TnX,代码行数:7,代码来源:Algorithms.cs

示例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;
                    }
                }
            }
        }
开发者ID:yonglehou,项目名称:LightWorkFlow,代码行数:25,代码来源:Runner.cs

示例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);
                    }
                }
            }

        }
开发者ID:kanpinar,项目名称:unity3.1th,代码行数:27,代码来源:Runner.cs

示例5: Accept

 public override void Accept(IVisitor visitor)
 {
     if (visitor != null)
     {
         visitor.Visit(this);
     }
 }
开发者ID:nuxleus,项目名称:ajaxmin,代码行数:7,代码来源:voidop.cs

示例6: Visit

 public void Visit(IVisitor visitor)
 {
     foreach (var employee in this.employees)
     {
         visitor.Visit(employee);
     }
 }
开发者ID:jibedoubleve,项目名称:gof-patterns,代码行数:7,代码来源:Employees.cs

示例7: Accept

 public void Accept(IVisitor visitor)
 {
     visitor.Visit(this);
     foreach (var floor in Floors)
     {
         floor.Accept(visitor);
     }
 }
开发者ID:fathurxzz,项目名称:aleqx,代码行数:8,代码来源:Visitor.cs

示例8: Accept

 public void Accept(IVisitor visitor)
 {
     foreach (var part in this._parts)
     {
         part.Accept(visitor);
     }
     visitor.Visit(this);
 }
开发者ID:ristica,项目名称:c-sharp-design-patterns,代码行数:8,代码来源:Computer.cs

示例9: Accept

 public void Accept(IVisitor visitor)
 {
     visitor.Visit(this);
     foreach (var room in Rooms)
     {
       room.Accept(visitor);
     }
 }
开发者ID:olko,项目名称:MySpace,代码行数:8,代码来源:Floor.cs

示例10: TraverseObject

		protected virtual void TraverseObject(object @object, IVisitor visitor)
		{
			if (!visitor.Visit(@object))
			{
				return;
			}
			IReflectClass claxx = _reflector.ForObject(@object);
			TraverseAllFields(@object, claxx);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:GenericTraverser.cs

示例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);
            }
        }
开发者ID:Lydiasaurus,项目名称:Personal,代码行数:10,代码来源:CompanyComposite.cs

示例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);
                }

            }
        }
开发者ID:sr3dna,项目名称:big5sync,代码行数:38,代码来源:CompareObjectHelper.cs

示例13: Visit

 public override void Visit(IVisitor visitor)
 {
     visitor.Visit(this);
       LeftExpression.Visit(visitor);
       RightExpression.Visit(visitor);
 }
开发者ID:realartists,项目名称:npredicate,代码行数:6,代码来源:ComparisonPredicate.cs

示例14: AcceptVisit

 public void AcceptVisit(IVisitor visitor)
 {
     visitor.Visit<ITriangleShape>(this);
 }
开发者ID:sandygk,项目名称:System.Physics,代码行数:4,代码来源:BaseTriangleShape.cs

示例15: Visit

 public void Visit(IVisitor visitor)
 {
     visitor.Visit(this);
 }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:4,代码来源:FreeBlockExpression.cs


注:本文中的IVisitor.Visit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。