Esempio n. 1
0
 /// <summary>
 /// Gets a segment based on key.
 /// </summary>
 /// <param name="key">Segment key</param>
 /// <returns>Segment by key</returns>
 protected override Segment GetSegment(ref int key)
 {
     if (!Segments.ContainsKey(key))
     {
         return(null);
     }
     return(Segments[key]);
 }
Esempio n. 2
0
 /// <summary>
 /// Gets a segment based on key.
 /// </summary>
 /// <param name="key">Segment key</param>
 /// <returns>Segment by key</returns>
 protected override Segment GetSegment(ref int key)
 {
    lock (CollectionsLock)
    {
       if (!Segments.ContainsKey(key))
       {
          return null;
       }
       return Segments[key];
    }
 }
Esempio n. 3
0
        internal ClientSegment GetSegment(int key)
        {
            lock (CollectionsLock)
            {
                if (Segments.ContainsKey(key))
                {
                    return(Segments[key]);
                }

                return(null);
            }
        }
        public bool AddTestSegment(TestSegment segment)
        {
            bool added = false;

            if (!Segments.ContainsKey(segment.ID) ||
                !segmentsList.Contains(segment))
            {
                //add the segment to both the dictionary and the list
                segments[segment.ID] = segment;
                segmentsList.Add(segment);
                added = true;
            }
            return(added);
        }
Esempio n. 5
0
 public byte[] this[string segmentType]
 {
     get
     {
         if (Segments.ContainsKey(segmentType) == false)
         {
             throw ExceptionFactory.New <IndexOutOfRangeException>("Unable to find segment key '{0}'", segmentType);
         }
         return(Segments[segmentType]);
     }
     set
     {
         Segments[segmentType] = value;
     }
 }
 public bool HasSegment(string Id)
 {
     return(Segments.ContainsKey(Id));
 }