Ejemplo n.º 1
0
        internal void SetParent(ConceptRoot conceptRoot)
        {
            ParentConceptRoot = conceptRoot;
            for (var i = 0; i < Requirements?.Length;)
            {
                // removes requirements pointing to non-existing exchangerequirements
                var success = Requirements[i].SetParent(this);
                if (!success)
                {
                    Requirements = Requirements.RemoveAt(i);
                }
                else
                {
                    i++;
                }
            }


            if (ParentConceptRoot?.ParentModelView?.ParentMvdXml == null)
            {
                return;
            }

            // sets the connection to clear caching event
            _mvdEngine = ParentConceptRoot.ParentModelView.ParentMvdXml.Engine;
            if (_mvdEngine != null)
            {
                _mvdEngine.RequestClearCache += Engine_RequestClearCache;
            }

            // try to set the concept template reference.
            if (string.IsNullOrEmpty(Template?.@ref))
            {
                return;
            }
            ConceptTemplate = ParentConceptRoot.ParentModelView.ParentMvdXml.GetConceptTemplate(Template.@ref);
        }