/// <summary>
        /// Constructs a string out of a list of labels and one extra label.
        /// </summary>
        /// <param name="labels"></param>
        /// <param name="extra"></param>
        /// <returns></returns>
        public static string CreateString(this IList <RoutingLabel> labels, RoutingLabel extra)
        {
            StringBuilder builder = new StringBuilder(labels.CreateString());

            builder.Append(extra.Label);
            return(builder.ToString());
        }
Exemple #2
0
 /// <summary>
 /// Constructs a string out of a list of labels and one extra label.
 /// </summary>
 /// <param name="labels"></param>
 /// <param name="extra"></param>
 /// <returns></returns>
 public static string CreateString(this IList<RoutingLabel> labels, RoutingLabel extra)
 {
     StringBuilder builder = new StringBuilder(labels.CreateString());
     builder.Append(extra.Label);
     return builder.ToString();
 }
Exemple #3
0
 /// <summary>
 /// Returns true if the given object equals this object in content.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 protected bool Equals(RoutingLabel other)
 {
     return Label == other.Label && string.Equals(Description, other.Description);
 }
 /// <summary>
 /// Returns true if the given sequence is allowed.
 /// </summary>
 /// <param name="sequence"></param>
 /// <param name="latest"></param>
 /// <returns></returns>
 public bool ForwardSequenceAllowed(IList<RoutingLabel> sequence, RoutingLabel latest)
 {
     return Regex.IsMatch(sequence.CreateString(latest), "^L*R*L*$");
 }
 /// <summary>
 /// Returns true if the given object equals this object in content.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 protected bool Equals(RoutingLabel other)
 {
     return(Label == other.Label && string.Equals(Description, other.Description));
 }