本文整理汇总了C#中Signal.BehavesAsBeingDriven方法的典型用法代码示例。如果您正苦于以下问题:C# Signal.BehavesAsBeingDriven方法的具体用法?C# Signal.BehavesAsBeingDriven怎么用?C# Signal.BehavesAsBeingDriven使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal.BehavesAsBeingDriven方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoTraverse
protected override void DoTraverse(Signal rootSignal, IScanVisitor visitor, bool ignoreHold)
{
if(rootSignal.BehavesAsBeingDriven(ignoreHold))
{
List<Guid> ports = new List<Guid>();
TraversePort(ports, rootSignal.DrivenByPort, rootSignal, ignoreHold, visitor);
}
}
示例2: TraverseSignal
private bool TraverseSignal(List<Guid> signals, List<Guid> ports, List<Guid> buses, Signal signal, Port target, bool ignoreHold, IScanVisitor visitor)
{
if(signal == null)
return true;
bool again = true;
if(!signals.Contains(signal.InstanceId))
{
again = false;
signals.Add(signal.InstanceId);
}
if(visitor.EnterSignal(signal, target, again, target == null))
{
// LEAF SIGNAL?
if(!signal.BehavesAsBeingDriven(ignoreHold))
{
if(!visitor.VisitLeaf(signal, again))
return false; // finished
}
else // HANDLE PORT
{
TraversePort(signals, ports, buses, signal.DrivenByPort, signal, ignoreHold, visitor);
}
}
return visitor.LeaveSignal(signal, target, again, target == null);
}
示例3: TraverseSignal
private bool TraverseSignal(Stack<Guid> signals, Signal signal, Port target, bool ignoreHold, IScanVisitor visitor)
{
if(signal == null)
return true;
if(visitor.EnterSignal(signal, target, false, target == null))
{
signals.Push(signal.InstanceId);
// HANDLE PORT
if(signal.BehavesAsBeingDriven(ignoreHold))
{
Port port = signal.DrivenByPort;
if(visitor.EnterPort(port, signal, false, false))
{
// LEAF PORT?
if(port.InputSignalCount == 0 && port.BusCount == 0)
if(!visitor.VisitLeaf(port, false))
return false; // finished
// HANDLE BUSES
foreach(Bus b in port.Buses)
if(!visitor.VisitLeaf(b, false))
return false; // finished
// HANDLE INPUT SIGNALS
foreach(Signal s in port.InputSignals)
{
if(signals.Contains(s.InstanceId))
{
if(!visitor.VisitCycle(port, signal, s))
return false; //finished
}
else if(!TraverseSignal(signals, s, port, ignoreHold, visitor))
return false; // finished
}
}
if(!visitor.LeavePort(port, signal, false, false))
return false; // finished
}
else if(!visitor.VisitLeaf(signal, false))
return false; // finished
signals.Pop();
}
return visitor.LeaveSignal(signal, target, false, target == null);
}
示例4: TraverseSignal
private bool TraverseSignal(List<Guid> signals, Signal signal, Port target, bool ignoreHold, IScanVisitor visitor)
{
if(signal == null || signals.Contains(signal.InstanceId))
return true;
signals.Add(signal.InstanceId);
if(visitor.EnterSignal(signal, target, false, target == null))
{
if(signal.BehavesAsBeingDriven(ignoreHold))
{
Port port = signal.DrivenByPort;
foreach(Signal input in port.InputSignals)
if(!TraverseSignal(signals, input, port, ignoreHold, visitor))
return false; // finished
}
}
return visitor.LeaveSignal(signal, target, false, target == null);
}