コード例 #1
0
        private static bool Matches(IJunctionState junctionState, AddressType addressType, int addressNr)
        {
            var @switchState = junctionState as ISwitchState;

            if (@switchState != null)
            {
                var addr = @switchState.Address;
                return((addr.Type == addressType) && (addr.ValueAsInt == addressNr));
            }
            return(false);
        }
コード例 #2
0
 /// <summary>
 /// Gets advanced info for the given junction
 /// </summary>
 internal bool TryGetJunction(IJunctionState junctionState, bool requestControl, out Switch @switch)
 {
     if (!switchManager.TryGetJunction(junctionState, out @switch))
     {
         return(false);
     }
     if (requestControl && [email protected])
     {
         @switch.RequestControl();
     }
     return(true);
 }
コード例 #3
0
 /// <summary>
 /// Gets advanced info for the given junction
 /// </summary>
 internal bool TryGetJunction(IJunctionState junctionState, out Switch @switch)
 {
     return(junctionIds.TryGetValue(junctionState, out @switch));
 }
コード例 #4
0
 /// <summary>
 /// Does this route contains the given junction
 /// </summary>
 public bool Contains(IJunctionState junctionState)
 {
     return(crossingJunctions.Any(x => x.Contains(junctionState)));
 }
コード例 #5
0
 /// <summary>
 /// Does this route contains the given junction
 /// </summary>
 public override bool Contains(IJunctionState junctionState)
 {
     return(junction == junctionState);
 }
コード例 #6
0
 /// <summary>
 /// Does this route contains the given junction
 /// </summary>
 public abstract bool Contains(IJunctionState junctionState);
コード例 #7
0
 /// <summary>
 /// Add a junction to the list of junctions controlled by this command station.
 /// </summary>
 internal void AddJunction(IJunctionState junction)
 {
     junctions.Add(junction);
     AddInitializationObject(junction as IInitializeAtPowerOn);
 }