本文整理汇总了C#中INode类的典型用法代码示例。如果您正苦于以下问题:C# INode类的具体用法?C# INode怎么用?C# INode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INode类属于命名空间,在下文中一共展示了INode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetTriplesWithSubjectPredicate
public IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred)
{
Document lookup = new Document();
lookup["graph.subject"] = this._formatter.Format(subj);
lookup["graph.predicate"] = this._formatter.Format(pred);
return new MongoDBGraphCentricEnumerable(this._manager, lookup, t => t.Subject.Equals(subj) && t.Predicate.Equals(pred));
}
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:7,代码来源:MongoDBGraphCentricIndexManager.cs
示例17: ImportSymbolSelectionDlg
public ImportSymbolSelectionDlg(INode[] nodes)
{
this.Build ();
SetResponseSensitive(ResponseType.Ok, true);
SetResponseSensitive(ResponseType.Cancel, true);
buttonOk.GrabFocus();
Modal = true;
WindowPosition = Gtk.WindowPosition.CenterOnParent;
// Init name column
var nameCol = new TreeViewColumn();
var textRenderer = new CellRendererText();
nameCol.PackStart(textRenderer, true);
nameCol.AddAttribute(textRenderer, "text", 0);
list.AppendColumn(nameCol);
// Init list model
var nodeStore = new ListStore(typeof(string),typeof(INode));
list.Model = nodeStore;
// Fill list
foreach (var n in nodes)
if(n!=null)
nodeStore.AppendValues(n.ToString(), n);
// Select first result
TreeIter iter;
if(nodeStore.GetIterFirst(out iter))
list.Selection.SelectIter(iter);
}
开发者ID:robik,项目名称:Mono-D,代码行数:32,代码来源:ImportSymbolSelectionDlg.cs
示例18: AddNode
public override INode AddNode(INode currentParent, IConverter converter)
{
//If the current parent is neither the root nor a group
if(!(currentParent is IMotherNode))
throw new ArgumentException("Trying to insert an 'AS' node, but the current node's type '" + currentParent.GetType() + "' is illegal. " + CheckString);
GroupNode group;
//If the current parent is the root
if (currentParent is RootNode)
{
group = (currentParent as IMotherNode).Children.Last() as GroupNode;
if (group == null)
throw new ArgumentException("Trying to insert an 'AS' node, but no Group found at root nor in its children. " + CheckString);
}
// The current parent is the group
else if (currentParent is GroupNode)
group = currentParent as GroupNode;
// The group is the last child of the current parent
else if ((currentParent as IMotherNode).Children.Last() is GroupNode)
group = (currentParent as IMotherNode).Children.Last() as GroupNode;
else
throw new ArgumentException("Trying to insert an 'AS' node, but the current node is neither a group nor contains a group as children. " + CheckString);
if (converter != null && converter.Function != null && converter.Function.Arguments != null && converter.Function.Arguments.Any())
group.Name = converter.Function.Arguments[0].ToString();
return currentParent;
}
开发者ID:Timothep,项目名称:SimpleExpressions,代码行数:29,代码来源:AsBuilder.cs
示例19: Add
internal static void Add(Identifier identifier, INode node)
{
if (_symbols.ContainsKey(identifier.Name))
_symbols[identifier.Name] = node;
else
_symbols.Add(identifier.Name, node);
}
开发者ID:paulroho,项目名称:Parser,代码行数:7,代码来源:Symbols.cs
示例20: SetUpNode
////数字节点只能是叶子。
//public GeneralNode(double number_p)
//{
// number = number_p;
// left = right = null;
// isNumber = true;
// symbol = Esymbol.Nothing;
// priority = Epriority.Nothing;
//}
//操作符节点初始化
public void SetUpNode(params object[] paras)//Esymbol symbol_p, INode left_p, INode right_p)
{
if (paras != null && paras.Length == 4)
{
if (paras[0] != null)
{
number = (double)paras[0];
isNumber = true;
}
else
{
isNumber = false;
}
left = (INode)paras[1];
right = (INode)paras[2];
if (paras[3] != null)
{
symbol = (Esymbol)paras[3];
}
else
{
symbol = Esymbol.Nothing;
}
priority = this.SymbolInPriority(symbol);
}
else
throw new Exception("Node初始化参数数量对!");
}
开发者ID:amwtke,项目名称:myconputer,代码行数:41,代码来源:GeneralNode.cs
注:本文中的INode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论