Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public static IEnumerable <Restricciones> Lista()
 {
     return(Enumerador.GetAll <Restricciones>());
 }
Esempio n. 4
0
 public static IEnumerable <TiposBaseXsd> Lista()
 {
     return(Enumerador.GetAll <TiposBaseXsd>());
 }