Пример #1
0
        /// <summary>
        /// Traverses the specified ref item.
        /// </summary>
        /// <param name="refItem">The ref item.</param>
        private void Traverse(ReferenceItem refItem)
        {
            if (_visitor.Accept(refItem))
            {
                try
                {
                    IHasReferences container = refItem.Element as IHasReferences;
                    if (container == null)
                    {
                        return;
                    }

                    List <Guid>      ports   = refItem.Ports;
                    ReferenceContext context = new ReferenceContext(_configuration, _scope, ports, refItem.IsExternal);
                    foreach (ReferenceItem reference in container.GetReferences(context))
                    {
                        Traverse(reference);
                    }
                }
                finally
                {
                    _visitor.ExitElement(refItem);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Gets the references.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public override IEnumerable <DSLFactory.Candle.SystemModel.Dependencies.ReferenceItem> GetReferences(DSLFactory.Candle.SystemModel.Dependencies.ReferenceContext context)
        {
            IList <DataLayerReferencesExternalComponent> list = DataLayerReferencesExternalComponent.GetLinksToReferencedExternalComponents(this);

            foreach (DataLayerReferencesExternalComponent link in list)
            {
                if (context.Mode.CheckConfigurationMode(link.ConfigurationMode) && context.CheckScope(link.Scope))
                {
                    CandleModel model = link.ReferencedExternalComponent.ReferencedModel;
                    if (model != null && model.DataLayer != null)
                    {
                        List <Guid> ports = new List <Guid>();
                        ports.Add(model.DataLayer.Id);
                        yield return(new DSLFactory.Candle.SystemModel.Dependencies.ReferenceItem(this, model.DataLayer, context.Scope, ports, true));
                    }
                }
            }

            foreach (DSLFactory.Candle.SystemModel.Dependencies.ReferenceItem ri in base.GetReferences(context))
            {
                yield return(ri);
            }
        }