Пример #1
0
        protected override bool TryGetItemByIndex(int index, out EnvDTE.CodeElement element)
        {
            var parameters = GetParameters();

            if (index < parameters.Length)
            {
                element = (EnvDTE.CodeElement)ExternalCodeParameter.Create(this.State, _projectId, parameters[index], this.ParentElement);
                return(true);
            }

            element = null;
            return(false);
        }
Пример #2
0
        protected override bool TryGetItemByName(string name, out EnvDTE.CodeElement element)
        {
            var parameters = GetParameters();
            var index      = parameters.IndexOf(p => p.Name == name);

            if (index >= 0 && index < parameters.Length)
            {
                element = (EnvDTE.CodeElement)ExternalCodeParameter.Create(this.State, _projectId, parameters[index], this.ParentElement);
                return(true);
            }

            element = null;
            return(false);
        }