コード例 #1
0
        internal override void ConstructResolvedTraits(ResolvedTraitSetBuilder rtsb, ResolveOptions resOpt)
        {
            // // get from datatype
            if (this.DataType != null)
            {
                rtsb.TakeReference(this.DataType.FetchResolvedTraits(resOpt));
            }
            // // get from purpose
            if (this.Purpose != null)
            {
                rtsb.MergeTraits(this.Purpose.FetchResolvedTraits(resOpt));
            }

            this.AddResolvedTraitsApplied(rtsb, resOpt);

            // special case for attributes, replace a default "this.attribute" with this attribute on traits that elevate attribute
            if (rtsb.ResolvedTraitSet?.HasElevated == true)
            {
                CdmAttributeReference replacement = new CdmAttributeReference(this.Ctx, this.Name, true)
                {
                    Ctx = this.Ctx,
                    ExplicitReference = this,
                    InDocument        = this.InDocument,
                    Owner             = this,
                };
                rtsb.ReplaceTraitParameterValue(resOpt, "does.elevateAttribute", "attribute", "this.attribute", replacement);
            }
            //rtsb.CleanUp();
        }
コード例 #2
0
        internal override void ConstructResolvedTraits(ResolvedTraitSetBuilder rtsb, ResolveOptions resOpt)
        {
            CdmObjectDefinition objDef = this.FetchObjectDefinition <CdmObjectDefinition>(resOpt);

            if (objDef != null)
            {
                ResolvedTraitSet rtsInh = (objDef as CdmObjectDefinitionBase).FetchResolvedTraits(resOpt);
                if (rtsInh != null)
                {
                    rtsInh = rtsInh.DeepCopy();
                }
                rtsb.TakeReference(rtsInh);
            }
            else
            {
                string defName = this.FetchObjectDefinitionName();
                Logger.Warning(defName, this.Ctx, $"unable to resolve an object from the reference '{defName}'");
            }

            if (this.AppliedTraits != null)
            {
                foreach (CdmTraitReference at in this.AppliedTraits)
                {
                    rtsb.MergeTraits(at.FetchResolvedTraits(resOpt));
                }
            }
        }
コード例 #3
0
        internal override void ConstructResolvedTraits(ResolvedTraitSetBuilder rtsb, ResolveOptions resOpt)
        {
            // // get from purpose 
            if (this.Purpose != null)
                rtsb.TakeReference(this.Purpose.FetchResolvedTraits(resOpt));

            this.AddResolvedTraitsApplied(rtsb, resOpt);
            //rtsb.CleanUp();
        }