Example #1
0
        public Type GetUnderlyingType()
        {
            var typeName = spec.getFullName();

            // todo this is not efficient use TypeUtils or clone of
            return(AppDomain.CurrentDomain.GetAssemblies().Select(assembly => assembly.GetType(typeName)).FirstOrDefault(type => type != null));
        }
        private Consent IsOfCorrectType(OneToManyAssociation property, PropertyContext context)
        {
            var collectionNakedObject            = (InternalCollectionAdapter)property.get(context.Target);
            NakedObjectSpecification elementSpec = collectionNakedObject.getElementSpecification();

            if (context.ProposedNakedObject.getSpecification().isOfType(elementSpec))
            {
                return(new Allow());
            }
            return(new Veto(string.Format("Not a suitable type; must be a {0}", elementSpec.getFullName())));
        }
 private static string GetShortName(NakedObjectSpecification spec)
 {
     return(spec.getFullName().Split('.').Last());
 }
 private static string GetShortName(NakedObjectSpecification spec) {
     return spec.getFullName().Split('.').Last();
 }