コード例 #1
0
        public ClassDefinition(
            string id,
            Type classType,
            bool isAbstract,
            ClassDefinition baseClass,
            Type storageGroupType,
            IPersistentMixinFinder persistentMixinFinder,
            IDomainObjectCreator instanceCreator)
        {
            ArgumentUtility.CheckNotNullOrEmpty("id", id);
            ArgumentUtility.CheckNotNull("classType", classType);
            ArgumentUtility.CheckNotNull("persistentMixinFinder", persistentMixinFinder);

            _id = id;
            _storageGroupType = storageGroupType;

            _classType             = classType;
            _persistentMixinFinder = persistentMixinFinder;
            _isAbstract            = isAbstract;

            _propertyAccessorDataCache         = new PropertyAccessorDataCache(this);
            _cachedRelationEndPointDefinitions = new DoubleCheckedLockingContainer <RelationEndPointDefinitionCollection> (
                () => RelationEndPointDefinitionCollection.CreateForAllRelationEndPoints(this, true));
            _cachedPropertyDefinitions =
                new DoubleCheckedLockingContainer <PropertyDefinitionCollection> (
                    () => new PropertyDefinitionCollection(PropertyDefinitionCollection.CreateForAllProperties(this, true), true));

            _baseClass       = baseClass;
            _instanceCreator = instanceCreator;
            _handleCreator   = new Lazy <Func <ObjectID, IDomainObjectHandle <DomainObject> > > (BuildHandleCreator, LazyThreadSafetyMode.PublicationOnly);
        }
コード例 #2
0
        public IRelationEndPointDefinition ResolveRelationEndPoint(IPropertyInformation propertyInformation)
        {
            ArgumentUtility.CheckNotNull("propertyInformation", propertyInformation);

            var propertyAccessorData = PropertyAccessorDataCache.ResolvePropertyAccessorData(propertyInformation);

            return(propertyAccessorData == null ? null : propertyAccessorData.RelationEndPointDefinition);
        }