Пример #1
0
        protected override void RegisterPorts()
        {
            PopulateInfos();
            if (_selectedInstanceMembers == null)
            {
                _selectedInstanceMembers = new List <string>();
            }

            var final = new MemberInfo[_selectedInstanceMembers.Count];

            for (var i = 0; i < _selectedInstanceMembers.Count; i++)
            {
                var name = _selectedInstanceMembers[i];
                if (string.IsNullOrEmpty(name))
                {
                    continue;
                }
                MemberInfo info;
                if (!_memberInfos.TryGetValue(name, out info))
                {
                    ParadoxNotion.Services.Logger.LogError(string.Format("Field/Property named '{0}', was not found on type '{1}'", name, typeof(T)), "Extractor", this);
                }
                final[i] = info;
            }

            extractorNode = BaseReflectedExtractorNode.GetExtractorNode(typeof(T), false, final);
            if (extractorNode != null)
            {
                extractorNode.RegisterPorts(this);
            }
        }
        protected override void RegisterPorts()
        {
            CheckData();
            var neededNames = _isStatic? _selectedStaticMembers : _selectedInstanceMembers;
            var list        = new List <MemberInfo>();

            for (var i = 0; i < neededNames.Length; i++)
            {
                var name = neededNames[i];
                if (string.IsNullOrEmpty(name))
                {
                    continue;
                }
                MemberInfo info;
                _memberInfos.TryGetValue(name, out info);
                if (info != null)
                {
                    list.Add(info);
                }
            }
            extractorNode = BaseReflectedExtractorNode.GetExtractorNode(typeof(T), _isStatic, list.ToArray());
            if (extractorNode != null)
            {
                extractorNode.RegisterPorts(this);
            }
        }
        protected override void RegisterPorts()
        {
            PopulateInfos();
            if (_selectedInstanceMembers == null)
            {
                _selectedInstanceMembers = new List <string>();
            }

            if (_selectedInstanceMembers.Count != _instanceMemberNames.Count)
            {
                ReValidateList();
            }

            var final = new List <MemberInfo>();

            for (var i = 0; i < _selectedInstanceMembers.Count; i++)
            {
                var name = _selectedInstanceMembers[i];
                if (string.IsNullOrEmpty(name))
                {
                    continue;
                }
                MemberInfo info;
                if (_memberInfos.TryGetValue(name, out info) && info != null)
                {
                    final.Add(info);
                }
            }
            extractorNode = BaseReflectedExtractorNode.GetExtractorNode(typeof(T), false, final.ToArray());
            if (extractorNode != null)
            {
                extractorNode.RegisterPorts(this);
            }
        }