예제 #1
0
        private static T parse <T, K>(K value, string description, Func <T, bool> predicate) where T : Enumerador <Tkey, Tvalue>, new()
        {
            var matchingItem = Enumerador <Tkey, Tvalue> .GetAll <T>().FirstOrDefault(predicate);

            if (matchingItem == null)
            {
                var message = string.Format("'{0}' is not a valid {1} in {2}", value, description, typeof(T));
                throw new ApplicationException(message);
            }

            return(matchingItem);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            Enumerador <Tkey, Tvalue> otherValue = obj as Enumerador <Tkey, Tvalue>;

            if (otherValue == null)
            {
                return(false);
            }

            var typeMatches  = GetType().Equals(obj.GetType());
            var valueMatches = _value.Equals(otherValue.Value);

            return(typeMatches && valueMatches);
        }
예제 #3
0
 public static IEnumerable <Restricciones> Lista()
 {
     return(Enumerador.GetAll <Restricciones>());
 }
예제 #4
0
 public static IEnumerable <TiposBaseXsd> Lista()
 {
     return(Enumerador.GetAll <TiposBaseXsd>());
 }