本文整理汇总了C#中NodeBase类的典型用法代码示例。如果您正苦于以下问题:C# NodeBase类的具体用法?C# NodeBase怎么用?C# NodeBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeBase类属于命名空间,在下文中一共展示了NodeBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InitNodePopup
public static void InitNodePopup(NodeBase node, NodeGraph graph)
{
currentNodePopupWindow = (NodeGraphPopupWindow)EditorWindow.GetWindow<NodeGraphPopupWindow>();
currentNodePopupWindow.node = node;
currentNodePopupWindow.graph = graph;
currentNodePopupWindow.title = "Create a new GraphNode";
}
开发者ID:jaronimoe,项目名称:cellVIEW_animated,代码行数:7,代码来源:NodeGraphPopupWindow.cs
示例2: getLastRuleNode
private RuleNode getLastRuleNode(NodeBase current)
{
if (!current.HasChild)
{
if (current is RuleNode)
{
return current as RuleNode;
}
else
{
return null;
}
}
else
{
if (current.ChildNode is GroupNode)
{
return getLastRuleNode(((GroupNode)current.ChildNode).GroupRoot);
}
else
{
return getLastRuleNode(current.ChildNode);
}
}
}
开发者ID:rbell,项目名称:SpecExpress,代码行数:25,代码来源:RuleTree.cs
示例3: Expand
public override IEnumerable<NodeBase> Expand(Context ctx, NodeBase expression, Label nextStatement)
{
foreach (var rule in KeyRule.Expand(ctx, Expr.GetMember(expression, "Key"), nextStatement))
yield return rule;
foreach (var rule in ValueRule.Expand(ctx, Expr.GetMember(expression, "Value"), nextStatement))
yield return rule;
}
开发者ID:menozz,项目名称:lens,代码行数:8,代码来源:MatchKeyValueRule.cs
示例4: Connected
public virtual bool Connected(int i, NodeBase target)
{
return
joints.Count != 0 &&
i > 0 &&
i < joints.Count &&
joints[i].TargetId == target.Id;
}
开发者ID:oleksandrzelentsov,项目名称:coursework2,代码行数:8,代码来源:NodeChildBase.cs
示例5: New2
public static New New2(BlockBase parent, string type, NodeBase length)
{
var ret = new New();
ret.Parent = parent;
ret.type = TypeReference.New(Types.GetType(parent, type), true);
ret.Length = length;
return ret;
}
开发者ID:7shi,项目名称:LLPML,代码行数:8,代码来源:New.cs
示例6: NodeJointPoint
public NodeJointPoint(Rect actionRect, Vector2 offset, NodeDrawableBase parent, NodeBase target = null)
{
ActionRect = actionRect;
Offset = offset;
Target = target != null ? target.FirstJoint : null;
TargetId = target != null ? target.Id : NodeDrawableBase.NothingId;
ParentId = parent.Id;
//Debug.Log("in " + parent + ", ID=" + parent.ElementName);
}
开发者ID:oleksandrzelentsov,项目名称:coursework2,代码行数:9,代码来源:NodeJointPoint.cs
示例7: NodeUpdatedEvent
public NodeUpdatedEvent(IAcSession acSession, NodeBase source, INodeUpdateIo output)
: base(acSession, source)
{
if (output == null)
{
throw new System.ArgumentNullException("output");
}
this.Output = output;
}
开发者ID:mingkongbin,项目名称:anycmd,代码行数:9,代码来源:NodeUpdatedEvent.cs
示例8: Expand
public override IEnumerable<NodeBase> Expand(Context ctx, NodeBase expression, Label nextStatement)
{
yield return Expr.If(
Expr.NotEqual(Literal as NodeBase, expression),
Expr.Block(
Expr.JumpTo(nextStatement)
)
);
}
开发者ID:menozz,项目名称:lens,代码行数:9,代码来源:MatchLiteralRule.cs
示例9: NodeCursorEventArgs
public NodeCursorEventArgs(NodeBase source, string command, object tag,
int X, int Y, int ClickCount, GameUI.MouseButtons Button, GameUI.MouseClicks ClickType)
: base(source, command, tag)
{
this.x = X;
this.y = Y;
this.clicks = ClickCount;
this.button = Button;
this.clicktype = ClickType;
}
开发者ID:rfrfrf,项目名称:SokoSolve-Sokoban,代码行数:10,代码来源:NodeCursorEventArgs.cs
示例10: FlashNode
public void FlashNode(NodeBase node)
{
if (node == null) return;
this.flashNode = node;
this.flashDuration = 0.0f;
this.timerFlashItem.Enabled = true;
this.folderView.EnsureVisible(this.folderView.FindNode(this.folderModel.GetPath(this.flashNode)));
}
开发者ID:KSLcom,项目名称:duality,代码行数:10,代码来源:ProjectFolderView.cs
示例11: Expand
public override IEnumerable<NodeBase> Expand(Context ctx, NodeBase expression, Label nextStatement)
{
for (var idx = 0; idx < ElementRules.Count; idx++)
{
var fieldName = string.Format("Item{0}", idx + 1);
var rules = ElementRules[idx].Expand(ctx, Expr.GetMember(expression, fieldName), nextStatement);
foreach (var rule in rules)
yield return rule;
}
}
开发者ID:menozz,项目名称:lens,代码行数:11,代码来源:MatchTupleRule.cs
示例12: ConvertToCall
private Call ConvertToCall(NodeBase v)
{
if (v is Call)
return v as Call;
if (v is Variant)
return Call.NewName(parent, (v as Variant).Name);
if (!(v is Member))
return Call.NewV(parent, v, null, null);
var mem = v as Member;
return Call.New(parent, mem.GetName(), mem.GetTarget(), null);
}
开发者ID:7shi,项目名称:LLPML,代码行数:11,代码来源:Parser.Operator.Impl.cs
示例13: ReadIndex
private NodeBase ReadIndex(NodeBase target)
{
var t = Read();
if (t == "]" && target is Variant)
return TypeOf.New(parent, Variant.NewName(parent, (target as Variant).Name + "[]"));
else if (t != null)
Rewind();
var ret = Index.New(parent, target, ReadExpression());
Check("配列", "]");
return ret;
}
开发者ID:7shi,项目名称:LLPML,代码行数:11,代码来源:Parser.Operator.Impl.cs
示例14: Test
public void Test()
{
var tc = new TestClass();
var etc = new List<TestClass>();
var otc = new List<object>();
var nodeBase = new NodeBase(null, null);
nodeBase.Register(otc);
nodeBase.Get<IEnumerable<TestClass>>();
//TODO: this is the case needed by my immediate code
}
开发者ID:mcwatt77,项目名称:vimcontrols,代码行数:11,代码来源:NodeBaseTest.cs
示例15: getEndNode
private NodeBase getEndNode(NodeBase current)
{
if (!current.HasChild)
{
return current;
}
else
{
return getEndNode(current.ChildNode);
}
}
开发者ID:rbell,项目名称:SpecExpress,代码行数:11,代码来源:RuleTree.cs
示例16: CreateNode
private static NodeBase CreateNode(Type nodeType, Type[] typeParameters, NodeBase targetNode,
params object[] arguments)
{
var closedType = nodeType.MakeGenericType(typeParameters);
var constructorArguments = new object[] {targetNode}.Union(arguments).ToArray();
var constructorArgumentTypes = constructorArguments.Select(x => x.GetType()).ToArray();
var constructor = closedType.GetConstructor(constructorArgumentTypes);
if (constructor == null) throw new InvalidOperationException();
return (NodeBase) constructor.Invoke(constructorArguments);
}
开发者ID:ratcow,项目名称:snippets,代码行数:12,代码来源:ExpressionParser.cs
示例17: Expand
public override IEnumerable<NodeBase> Expand(Context ctx, NodeBase expression, Label nextStatement)
{
yield return Expr.If(
Expr.Or(
Expr.Less(expression, RangeStartRule.Literal as NodeBase),
Expr.Greater(expression, RangeEndRule.Literal as NodeBase)
),
Expr.Block(
Expr.JumpTo(nextStatement)
)
);
}
开发者ID:menozz,项目名称:lens,代码行数:12,代码来源:MatchRangeRule.cs
示例18: BuildMoveList
///// <summary>Create a catch node that will be associated with this try node
///// and will handle the given exception. A set of block node are to be bound
///// to the newly created catch node.</summary>
///// <param name="blocks">A collection of one or more blocks whose associated
///// instructions should be added to the new catch block.</param>
///// <param name="caughtException">An optional string that is the name of the class
///// of the caucght exception. A null reference denotes a catch-all block.</param>
///// <returns>The newly created node.</returns>
///// <remarks>The catch block creation order is meaningfull. Moreover once a
///// catch all block has been bound to the current instance no new catch block
///// could be associated with this instance.</remarks>
//internal CatchNode AddCatch(ICollection<BlockNode> blocks, string caughtException = null)
//{
// if (_catchAllAdded) { throw new InvalidOperationException(); }
// if (null == caughtException) { _catchAllAdded = true; }
// CatchNode result = new CatchNode(this);
// GetRoot().MoveLeaves(result, blocks);
// return result;
//}
/// <summary>TODO : Assert this method uselessness and remove.</summary>
/// <param name="root"></param>
/// <param name="wrappedNodes"></param>
private static ICollection<NodeBase<AstNode>> BuildMoveList(NodeBase<AstNode> root,
ICollection<NodeBase<AstNode>> wrappedNodes)
{
if (null == root) { throw new ArgumentNullException(); }
if (null == wrappedNodes) { throw new ArgumentNullException(); }
// The root node must not appear in the wrapped nodes list.
if (wrappedNodes.Contains(root)) { throw new ArgumentException(); }
List<NodeBase<AstNode>> result = new List<NodeBase<AstNode>>();
List<NodeBase<AstNode>> coveredNodes = new List<NodeBase<AstNode>>();
root.Walk(delegate(NodeBase<AstNode> scannedNode, WalkTraversal traversal, object context)
{
// Ignore root node which is not expected to be in the collection.
if (scannedNode == root) { return WalkContinuation.Normal; }
switch (traversal)
{
case WalkTraversal.CurrentNode:
case WalkTraversal.BeforeTransit:
if (object.ReferenceEquals(scannedNode.Parent, root)) {
result.Add(scannedNode);
}
break;
default:
break;
}
try {
// All encountered leaf nodes MUST be in the collection
if (scannedNode.IsLeafNode) {
if (!wrappedNodes.Contains(scannedNode)) {
throw new ApplicationException();
}
return WalkContinuation.Normal;
}
// An intermediate node that belongs to the collection implicitly
// encompass all of is direct and indirect sons. Those don't need
// to be in the collection.
if (wrappedNodes.Contains(scannedNode)) { return WalkContinuation.SkipSons; }
return WalkContinuation.Normal;
}
finally {
if (!coveredNodes.Contains(scannedNode)) {
coveredNodes.Add(scannedNode);
}
}
},
WalkMode.TransitBeforeAndAfter);
if (coveredNodes.Count != wrappedNodes.Count) {
throw new ApplicationException();
}
return result;
}
开发者ID:BlueSkeye,项目名称:ApkRe,代码行数:72,代码来源:TryNode.cs
示例19: AutoDelegate
private NodeBase AutoDelegate(Function f)
{
if (f == null) return null;
var autoArgs = f.GetAutoArgs();
if (autoArgs == null) return f;
var args = new NodeBase[autoArgs.Length];
for (int i = 0; i < args.Length; i++)
args[i] = Var.NewName(parent, autoArgs[i].Name);
var ret = DelgFunc.New(parent, f.CallType, args, f);
ret.Auto = true;
return ret;
}
开发者ID:7shi,项目名称:LLPML,代码行数:14,代码来源:Parser.Sentence.cs
示例20: AddNode
/*
* AddNode
*/
public void AddNode(NodeBase nodeToAdd)
{
if (nodeToAdd == null)
{
throw new ArgumentNullException("nodeToAdd");
}
nodeToAdd.ContainingProgram = this;
/* If we are adding an input node, we need to set its index starting at 1 because of the on/off node. */
Int32 inputCount = 1;
ProgramInput programInput = nodeToAdd as ProgramInput;
if (programInput != null)
{
for (Int32 i = 0; i < _nodes.Count; i++)
{
if (_nodes[i] is ProgramInput)
{
inputCount++;
}
}
programInput.InputIndex = inputCount;
}
/* If we are adding an output node, we need to set its index. */
Int32 outputCount = 0;
ProgramOutput programOutput = nodeToAdd as ProgramOutput;
if (programOutput != null)
{
for (Int32 i = 0; i < _nodes.Count; i++)
{
if (_nodes[i] is ProgramOutput)
{
outputCount++;
}
}
programOutput.OutputIndex = outputCount;
}
_nodes.Add(nodeToAdd);
UpdateParentNode();
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:52,代码来源:Program.cs
注:本文中的NodeBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论