Pop() public method

public Pop ( MetaMetadataField mmField ) : void
mmField MetaMetadataField
return void
コード例 #1
0
        private bool InheritFromSuperField(MetaMetadataRepository repository, InheritanceHandler inheritanceHandler)
        {
            bool inhertedIsInheriting = false;
            MetaMetadataCompositeField inheritedField = (MetaMetadataCompositeField)SuperField;

            if (inheritedField != null)
            {
                inheritedField.Repository = repository;
                if (inheritedField.InheritInProcess)
                {
                    inhertedIsInheriting = true;

                    // if inheriting from the root mmd, we need to clone and keep the environment right now.
                    InheritanceHandler inheritanceHandlerToUse = inheritanceHandler.clone();
                    inheritanceHandler.Pop(this);

                    //inheritedField.InheritFinished += (sender, e) => InheritFrom(repository, inheritedField);
                    this.AddInheritanceFinishHandler(inheritedField, InheritFieldFinished, inheritanceHandlerToUse);
                }
                else
                {
                    inheritedField.InheritMetaMetadata(inheritanceHandler);
                    InheritFromCompositeField(inheritedField, repository, inheritanceHandler);
                }
            }
            return(inhertedIsInheriting);
        }
コード例 #2
0
        protected override bool InheritMetaMetadataHelper(InheritanceHandler inheritanceHandler)
        {
            inheritanceHandler.Push(this);

            bool inhertedIsInheriting = false;
            // init
            MetaMetadataRepository repository = Repository;

            // determine the structure we should inherit from
            MetaMetadata inheritedMmd = FindOrGenerateInheritedMetaMetadata(repository, inheritanceHandler);

            if (inheritedMmd != null)
            {
                if (inheritedMmd.InheritInProcess)
                {
                    inhertedIsInheriting = true;

                    // if inheriting from the root mmd, we need to clone and keep the environment right now.
                    InheritanceHandler inheritanceHandlerToUse = inheritanceHandler.clone();
                    inheritanceHandler.Pop(this);

                    //inheritedMmd.InheritFinished += (sender, e) => InheritFromTopLevelMetaMetadata(inheritedMmd, repository);
                    this.AddInheritanceFinishHandler(inheritedMmd, InheritMetaMetadataFinished, inheritanceHandlerToUse);
                }
                else
                {
                    inheritedMmd.InheritMetaMetadata(null); //edit
                    InheritFromTopLevelMetaMetadata(inheritedMmd, repository, inheritanceHandler);
                }
            }
            if (!inhertedIsInheriting)
            {
                inhertedIsInheriting = InheritFromSuperField(repository, inheritanceHandler);
            }

            // for the root meta-metadata, this may happend
            if (inheritedMmd == null && SuperField == null)
            {
                InheritFrom(repository, null, inheritanceHandler);
            }

            return(!inhertedIsInheriting);
        }
コード例 #3
0
        private bool InheritFromSuperField(MetaMetadataRepository repository, InheritanceHandler inheritanceHandler)
        {
            bool inhertedIsInheriting = false;
            MetaMetadataCompositeField inheritedField = (MetaMetadataCompositeField)SuperField;
            if (inheritedField != null)
            {
                inheritedField.Repository = repository;
                if (inheritedField.InheritInProcess)
                {
                    inhertedIsInheriting = true;

                    // if inheriting from the root mmd, we need to clone and keep the environment right now.
                    InheritanceHandler inheritanceHandlerToUse = inheritanceHandler.clone();
                    inheritanceHandler.Pop(this);

                    //inheritedField.InheritFinished += (sender, e) => InheritFrom(repository, inheritedField);
                    this.AddInheritanceFinishHandler(inheritedField, InheritFieldFinished, inheritanceHandlerToUse);
                }
                else
                {
                    inheritedField.InheritMetaMetadata(inheritanceHandler);
                    InheritFromCompositeField(inheritedField, repository, inheritanceHandler);
                }
            }
            return inhertedIsInheriting;
        }
コード例 #4
0
        protected override bool InheritMetaMetadataHelper(InheritanceHandler inheritanceHandler)
        {
            inheritanceHandler.Push(this);

            bool inhertedIsInheriting = false;
            // init
            MetaMetadataRepository repository = Repository;

            // determine the structure we should inherit from
            MetaMetadata inheritedMmd = FindOrGenerateInheritedMetaMetadata(repository, inheritanceHandler);
            if (inheritedMmd != null)
            {
                if (inheritedMmd.InheritInProcess)
                {
                    inhertedIsInheriting = true;

                    // if inheriting from the root mmd, we need to clone and keep the environment right now.
                    InheritanceHandler inheritanceHandlerToUse = inheritanceHandler.clone();
                    inheritanceHandler.Pop(this);

                    //inheritedMmd.InheritFinished += (sender, e) => InheritFromTopLevelMetaMetadata(inheritedMmd, repository);
                    this.AddInheritanceFinishHandler(inheritedMmd, InheritMetaMetadataFinished, inheritanceHandlerToUse);
                }
                else
                {
                    inheritedMmd.InheritMetaMetadata(null); //edit
                    InheritFromTopLevelMetaMetadata(inheritedMmd, repository, inheritanceHandler);
                }
            }
            if (!inhertedIsInheriting)
            {
                inhertedIsInheriting = InheritFromSuperField(repository, inheritanceHandler);
            }

            // for the root meta-metadata, this may happend
            if (inheritedMmd == null && SuperField == null)
                InheritFrom(repository, null, inheritanceHandler);

            return !inhertedIsInheriting;
        }