コード例 #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));
        }
コード例 #2
0
        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())));
        }
コード例 #3
0
 private static string GetShortName(NakedObjectSpecification spec)
 {
     return(spec.getFullName().Split('.').Last());
 }
コード例 #4
0
 private static string GetShortName(NakedObjectSpecification spec) {
     return spec.getFullName().Split('.').Last();
 }