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


C# Signal.BehavesAsBeingDriven方法代码示例

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

示例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);
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:27,代码来源:AllStrategy.cs

示例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);
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:48,代码来源:AllPathsStrategy.cs

示例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);
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:17,代码来源:AllSignalsStrategy.cs


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