Esempio n. 1
0
        // -----------------------------------------------------------------------------------------
        /// <summary>
        /// Registers the supplied model class Definitor in the shared collection.
        /// </summary>
        protected void RegisterDefinitor(MModelClassDefinitor Definitor)
        {
            if (DeclaredClassDefinitors_.Contains(Definitor))
            {
                throw new UsageAnomaly("Model classes can be defined only once.", Definitor);
            }

            DeclaredClassDefinitors_.Add(Definitor);
        }
Esempio n. 2
0
        // -----------------------------------------------------------------------------------------
        /// <summary>
        /// Indicates whether this model class definitor is the supplied one, or one of its logic descendants.
        /// </summary>
        public bool IsCompatibleClassDefinition(MModelClassDefinitor Sample)
        {
            if (Sample == null)
            {
                return(false);
            }

            if (this == Sample)
            {
                return(true);
            }

            return(IsCompatibleClassDefinition(Sample.AncestorDefinitor));
        }
 /// <summary>
 /// Register the owner declarator of this member/definitor and assemble any related behaviors (such as setter interception).
 /// </summary>
 internal abstract void AssignDeclarator(MModelClassDefinitor DeclaringDefinitor);
Esempio n. 4
0
 internal CollectionsExtractor(MModelClassDefinitor Source)
 {
     this.Source = Source;
 }
Esempio n. 5
0
 internal PropertiesExtractor(MModelClassDefinitor Source)
 {
     this.Source = Source;
 }
Esempio n. 6
0
        // -----------------------------------------------------------------------------------------
        /// <summary>
        /// Constructor.
        /// </summary>
        public MModelClassDefinitor(string TechName, string Name, string Summary, Type DeclaringType, MModelClassDefinitor AncestorDefinitor = null)
            : base(TechName, Name, Summary, DeclaringType)
        {
            if ((AncestorDefinitor == null && !DeclaringType.BaseType.IsOneOf(typeof(object), typeof(DynamicObject))) ||
                (AncestorDefinitor != null && AncestorDefinitor.DeclaringType != DeclaringType.BaseType))
            {
                throw new UsageAnomaly("The declaring type of the supplied Ancestor Definitor differs from that of the actual ancestor.",
                                       new DataWagon("Ancestor Definitor", AncestorDefinitor).Add("Current class type", DeclaringType));
            }

            this.AncestorDefinitor = AncestorDefinitor;
        }