Ecologylab.BigSemantics.MetaMetadataNS.InheritanceHandler.Push C# (CSharp) Метод

Push() публичный Метод

public Push ( MetaMetadataField mmField ) : void
mmField MetaMetadataField
Результат void
        public void Push(MetaMetadataField mmField)
        {
            Debug.WriteLine("pushing " + mmField);
            mmStack.Push(mmField);

            // put mmd scope
            MultiAncestorScope<Object> scope = new MultiAncestorScope<Object>();
            if (scopeStack.Count > 0)
                scope.AddAncestor(scopeStack.Peek());
            scopeStack.Push(scope);

            // put generic type var scope
            MmdGenericTypeVarScope existingMmdGenericTypeVarScope = (MmdGenericTypeVarScope) scope.Get(GENERIC_TYPE_VAR_SCOPE);
            MmdGenericTypeVarScope currentMmdGenericTypeVarScope = mmField.GenericTypeVars;
            if (currentMmdGenericTypeVarScope != null && existingMmdGenericTypeVarScope != null)
            {
                currentMmdGenericTypeVarScope.InheritFrom(existingMmdGenericTypeVarScope, this);
            }
            scope.AddIfValueNotNull(GENERIC_TYPE_VAR_SCOPE, mmField.GenericTypeVars);
        }

Usage Example

        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);
        }
All Usage Examples Of Ecologylab.BigSemantics.MetaMetadataNS.InheritanceHandler::Push