Beispiel #1
0
 private DevExpress.Web.MenuItem FindMenuGroupControl(ChoiceActionItem item)
 {
     if (item != null && ActionItemToMenuGroupMap.ContainsKey(item))
     {
         return(ActionItemToMenuGroupMap[item]);
     }
     return(null);
 }
 private MenuItem FindMenuGroupControl(ChoiceActionItem item)
 {
     if (item != null && _actionItemToMenuGroupMap.ContainsKey(item))
     {
         return(_actionItemToMenuGroupMap[item]);
     }
     return(null);
 }
Beispiel #3
0
        public void LightDictionary_Generic_ContainsValue_DefaultValuePresent(int count)
        {
            LightDictionary <TKey, TValue> dictionary = (LightDictionary <TKey, TValue>)GenericIDictionaryFactory(count);
            int  seed       = 4315;
            TKey notPresent = CreateTKey(seed++);

            while (dictionary.ContainsKey(notPresent))
            {
                notPresent = CreateTKey(seed++);
            }
            dictionary.Add(notPresent, default(TValue));
            Assert.True(dictionary.ContainsValue(default(TValue)));
        }
        public void LightDictionary_Generic_RemoveKey_DefaultKeyNotContainedInDictionary(int count)
        {
            LightDictionary <TKey, TValue> dictionary = (LightDictionary <TKey, TValue>)GenericIDictionaryFactory(count);

            if (DefaultValueAllowed)
            {
                TKey missingKey = default(TKey);
                while (dictionary.ContainsKey(missingKey))
                {
                    dictionary.Remove(missingKey);
                }
                Assert.False(dictionary.Remove(missingKey));
            }
        }
Beispiel #5
0
        public void IEnumerable_NonGeneric_Enumerator_Current_ReturnsSameObjectsOnDifferentEnumerators(int count)
        {
            // Ensures that the elements returned from enumeration are exactly the same collection of
            // elements returned from a previous enumeration
            IEnumerable enumerable = NonGenericIEnumerableFactory(count);
            LightDictionary <object, int> firstValues  = new LightDictionary <object, int>(count);
            LightDictionary <object, int> secondValues = new LightDictionary <object, int>(count);

            foreach (object item in enumerable)
            {
                firstValues[item] = firstValues.ContainsKey(item) ? firstValues[item]++ : 1;
            }
            foreach (object item in enumerable)
            {
                secondValues[item] = secondValues.ContainsKey(item) ? secondValues[item]++ : 1;
            }
            Assert.Equal(firstValues.Count, secondValues.Count);
            foreach (object key in firstValues.Keys)
            {
                Assert.Equal(firstValues[key], secondValues[key]);
            }
        }