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


C# INode类代码示例

本文整理汇总了C#中INode的典型用法代码示例。如果您正苦于以下问题:C# INode类的具体用法?C# INode怎么用?C# INode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


INode类属于命名空间,在下文中一共展示了INode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrintSolution

        private static void PrintSolution(PathFinder pathFinder, INode result)
        {
            int steps = 0;
            INode node = result;

            if (node != null)
            {
                var stack = new Stack<INode>();

                do
                {
                    stack.Push(node);
                } while ((node = node.Parent) != null);

                Debug.WriteLine("8-Puzzle Solved in {0} Cycles", pathFinder.Cycles);
                Debug.WriteLine("-------------------------------------------");

                foreach (EightPuzzleNode solutionNode in stack)
                {
                    string tiles = solutionNode.Tiles
                        .Aggregate("", (current, i) => current + i.ToString());

                    Debug.WriteLine("{0:00} - {1} -  F: {2:00.0}  G: {3:00.0}  H: {4:00.0}",
                                    steps++,
                                    tiles,
                                    solutionNode.F, solutionNode.G, solutionNode.H);
                }
            }
            else
            {
                Debug.WriteLine("No solution");
            }
        }
开发者ID:CoryBartholomew,项目名称:EightPuzzleProblem,代码行数:33,代码来源:EightPuzzleTests.cs

示例2: SearcherResult

 public SearcherResult(DateTime startTimeStamp, INode resultNode, string path, SearchOptions searchOptions)
 {
     StartTimestamp = startTimeStamp;
     ResultNode = resultNode;
     Path = path;
     SearchOptions = searchOptions;
 }
开发者ID:johncapehart,项目名称:PsISEProjectExplorer,代码行数:7,代码来源:SearcherResult.cs

示例3: AStarNode

 public AStarNode(Location location, INode parent,
     decimal costFromStart, decimal costToGoal)
     : base(location, parent)
 {
     CostFromStart = costFromStart;
     CostToGoal = costToGoal;
 }
开发者ID:nabinnepal,项目名称:aStarSearch,代码行数:7,代码来源:AStarNode.cs

示例4: Transition

 public Transition(string identifier, bool isDefault, INode source, INode destination)
 {
     IsDefault = isDefault;
     Source = source;
     Destination = destination;
     Identifier = identifier;
 }
开发者ID:dkschlos,项目名称:PVM.NET,代码行数:7,代码来源:Transition.cs

示例5: QuickRemove

 public QuickRemove(ToolStripMenuItem menu, IGraph g, INode objNode, String file)
 {
     this._menu = menu;
     this._g = g;
     this._objNode = objNode;
     this._file = file;
 }
开发者ID:almostEric,项目名称:DotNetRDF-4.0,代码行数:7,代码来源:QuickConnect.cs

示例6: SetPropertyValueOperation

 internal SetPropertyValueOperation(INode node, string name, object oldvalue, object newvalue)
 {
     this.node = node;
     this.name = name;
     this.oldvalue = oldvalue;
     this.newvalue = newvalue;
 }
开发者ID:ajlopez,项目名称:AjCoRe,代码行数:7,代码来源:SetPropertyValueOperation.cs

示例7: Run

		public void Run(INode typeDeclaration)
		{
			typeDeclaration.AcceptVisitor(this, null);
			foreach (VariableDeclaration decl in fields) {
				decl.Name = prefix + decl.Name;
			}
		}
开发者ID:ThomasZitzler,项目名称:ILSpy,代码行数:7,代码来源:PrefixFieldsVisitor.cs

示例8: GetUriStringForNode

 public static string GetUriStringForNode(INode node)
 {
     if (node.IsEmpty()) return string.Empty;
     return string.Format("{0}://{1}:{2}", GetProtocolStringForTransportType(node.TransportType),
         GetHostStringForAddress(node.Host),
         node.Port);
 }
开发者ID:helios-io,项目名称:helios,代码行数:7,代码来源:NodeUri.cs

示例9: DoMatch

		public override bool DoMatch(INode other, Match match)
		{
			if (other == null || other.IsNull)
				return this.MinCount <= 0;
			else
				return this.MaxCount >= 1 && childNode.DoMatch(other, match);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:7,代码来源:Repeat.cs

示例10: AddNode

        public override INode AddNode(INode currentParent, IConverter converter)
        {
            INode orNode = new OrNode(converter);

            //// First element of a chain
            //if (currentParent is RootNode)
            //    throw new NotImplementedException("Or cannot be the first element");

            // Insert at root
            if (currentParent is RootNode)
            {
                var root = (currentParent as RootNode);
                var firstChild = root.Children.First();
                firstChild.Parent = orNode;
                (orNode as OrNode).Children.Add(firstChild);
                orNode.Parent = root;
                root.Children.Remove(firstChild);
            }
            // Insert before its parent
            else if (currentParent.Parent != null && currentParent.Parent as IMotherNode != null)
            {
                var grandParent = currentParent.Parent as IMotherNode;
                grandParent.Children.Remove(currentParent);
                (orNode as OrNode).Children.Add(currentParent);
                currentParent = currentParent.Parent;
            }

            this.LinkNodeToParent(currentParent, orNode);
            return orNode;
        }
开发者ID:Timothep,项目名称:SimpleExpressions,代码行数:30,代码来源:OrBuilder.cs

示例11: ToText

		public static string ToText(INode node)
		{
			var output = new CSharpOutputVisitor();
			node.AcceptVisitor(output, null);

			return output.Text;
		}
开发者ID:neiz,项目名称:ravendb,代码行数:7,代码来源:QueryParsingUtils.cs

示例12: EndVisit

		protected override void EndVisit(INode node)
		{
			if (node is PropertyGetRegion || node is PropertySetRegion) {
				this.currentContext = VisitorContext.Default;
			}
			base.EndVisit(node);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:7,代码来源:PropertyFieldAssociationVisitor.cs

示例13: InvalidOperationException

        INode INodeCreator.CreateNode(Session session, INode parent, string name, IEnumerable<Property> properties)
        {
            if (parent != null && parent.ChildNodes[name] != null)
                throw new InvalidOperationException("Duplicated Child Node Name");

            return new Node(session, parent, name, properties, this.store);
        }
开发者ID:ajlopez,项目名称:AjCoRe,代码行数:7,代码来源:Workspace.cs

示例14: CreateNode

        IExpressionNode CreateNode(INode node)
        {
            IExpressionNode expressionNode = null;

            if (node is ExpressionStatement)
            {
                var statementNode = (ExpressionStatement)node;
                expressionNode = new StatementExpressionNode
                {
                    Expression = CreateNode(statementNode.Expression)
                };
            }
            else if (node is BinaryOperatorExpression)
            {
                var binaryNode = ((BinaryOperatorExpression)node);
                expressionNode = new BinaryExpressionNode
                {
                    Operator = (BinaryExpressionNode.Operators)binaryNode.Op,
                    Left = CreateNode(binaryNode.Left),
                    Right = CreateNode(binaryNode.Right),
                };
            }
            else if (node is PrimitiveExpression)
            {
                var primitiveNode = (PrimitiveExpression)node;
                var valueType = primitiveNode.Value == null ? typeof(object) : primitiveNode.Value.GetType();
                var value = (IValueNode)Activator.CreateInstance(typeof(ValueNode<>).MakeGenericType(valueType), primitiveNode.Value);
                expressionNode = new ValueExpressionNode
                {
                    Value = value,
                };
            }

            return expressionNode;
        }
开发者ID:Magicolo,项目名称:PseudoFramework,代码行数:35,代码来源:PExpressionDrawer.cs

示例15: OnFocusedNodeChanged

 public void OnFocusedNodeChanged(INode inode)
 {
     if (focusedNodeChanged != null)
     {
         focusedNodeChanged(this, inode);
     }
 }
开发者ID:xKUPERx,项目名称:CloudTask,代码行数:7,代码来源:TreeListCaseAdapter.cs


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