private void InheritFieldFinished(MetaMetadataNestedField sender, EventArgs e)
        {
            MetaMetadataCompositeField inheritedField = (MetaMetadataCompositeField) _waitingToInheritFrom.Pop();
            //InheritFromCompositeField(inheritedField, Repository);

            if (_waitingToInheritFrom.Count == 0)
                FinishInheritance();
        }
        private void InheritMetaMetadataFinished(MetaMetadataNestedField sender, EventArgs e)
        {
            MetaMetadata inheritedMmd = (MetaMetadata) _waitingToInheritFrom.Pop();
            InheritanceHandler inheritanceHandler = _waitingToInheritFromInheritanceHandler.Pop();

            InheritFromTopLevelMetaMetadata(inheritedMmd, Repository, inheritanceHandler);

            InheritFromSuperField(Repository, inheritanceHandler);

            if (_waitingToInheritFrom.Count == 0)
                FinishInheritance();
        }
        public void AddInheritanceFinishHandler(MetaMetadataNestedField inheritingField, InheritFinishedEventHandler eventHandler, InheritanceHandler inheritanceHandler)
        {
            if (_waitingToInheritFrom == null)
                _waitingToInheritFrom = new Stack<MetaMetadataNestedField>();

            _waitingToInheritFrom.Push(inheritingField);

            //adding the InheritanceHandler for this inheritingField
            if (_waitingToInheritFromInheritanceHandler == null)
                _waitingToInheritFromInheritanceHandler = new Stack<InheritanceHandler>();

            _waitingToInheritFromInheritanceHandler.Push(inheritanceHandler);

            inheritingField.InheritFinished += eventHandler;
        }