Example #1
0
 public T this[string key]
 {
     get
     {
         return(this.KeyToType[SchemaElementLookUpTable <T> .KeyFromName(key)]);
     }
 }
Example #2
0
        public T LookUpEquivalentKey(string key)
        {
            key = SchemaElementLookUpTable <T> .KeyFromName(key);

            T obj;

            if (this.KeyToType.TryGetValue(key, out obj))
            {
                return(obj);
            }
            return(default(T));
        }
Example #3
0
        public AddErrorKind TryAdd(T type)
        {
            if (string.IsNullOrEmpty(type.Identity))
            {
                return(AddErrorKind.MissingNameError);
            }
            string key = SchemaElementLookUpTable <T> .KeyFromElement(type);

            T obj;

            if (this.KeyToType.TryGetValue(key, out obj))
            {
                return(AddErrorKind.DuplicateNameError);
            }
            this.KeyToType.Add(key, type);
            this._keysInDefOrder.Add(key);
            return(AddErrorKind.Succeeded);
        }
Example #4
0
 public FilteredSchemaElementLookUpTable(SchemaElementLookUpTable <S> lookUpTable)
 {
     _lookUpTable = lookUpTable;
 }
Example #5
0
 public bool ContainsKey(string key)
 {
     return(this.KeyToType.ContainsKey(SchemaElementLookUpTable <T> .KeyFromName(key)));
 }
Example #6
0
 private static string KeyFromElement(T type)
 {
     return(SchemaElementLookUpTable <T> .KeyFromName(type.Identity));
 }