コード例 #1
0
        private Method FindMatchingMethodInClass(Method activatedMethod)
        {
            ISourceTreeResolver resolver = new SourceTreeResolver();
            Method matchingMethod = null;
            foreach (IElement node in _targetClass.Nodes)
            {
                if (node is Method)
                {
                    if (node.Name != activatedMethod.Name)
                        continue;

                    if (SignatureHelper.SignaturesMatch(resolver, activatedMethod, node as Method))
                    {
                        matchingMethod = node as Method;
                    }
                }
            }
            return matchingMethod;
        }
コード例 #2
0
        } // IsElementOfType(DeclaredTypeElement, type)

        /// <summary>
        /// Is element of type
        /// </summary>
        public bool IsElementOfType(ITypeReferenceExpression declaredTypeExpression, string type)
        {
            try
            {
                if (declaredTypeExpression == null)
                {
                    return(false);
                }
                if (_NewSourceTreeResolver == null)
                {
                    _NewSourceTreeResolver = new SourceTreeResolver();
                }
                ITypeElement DeclaredTypeElement = _NewSourceTreeResolver.ResolveExpression(declaredTypeExpression) as ITypeElement;
                return(IsElementOfType(DeclaredTypeElement, type));
            } // try
            catch (Exception ex)
            {
                Trace.WriteLine("Exception in IsElementOfType Function: " + ex.Message);
            }
            return(false);
        } // IsElementOfType(declaredTypeExpression, type)
コード例 #3
0
        private Method FindMatchingMethodInClass(Method activatedMethod)
        {
            ISourceTreeResolver resolver = new SourceTreeResolver();
            Method matchingMethod        = null;

            foreach (IElement node in _targetClass.Nodes)
            {
                if (node is Method)
                {
                    if (node.Name != activatedMethod.Name)
                    {
                        continue;
                    }

                    if (SignatureHelper.SignaturesMatch(resolver, activatedMethod, node as Method))
                    {
                        matchingMethod = node as Method;
                    }
                }
            }
            return(matchingMethod);
        }
コード例 #4
0
        } // IsElementOfType(DeclaredTypeElement, type)

        /// <summary>
        /// Is element of type
        /// </summary>
        public bool IsElementOfType(ITypeReferenceExpression declaredTypeExpression, string type)
        {
            try
            {
                if (declaredTypeExpression == null)
                    return false;
                if (_NewSourceTreeResolver == null)
                    _NewSourceTreeResolver = new SourceTreeResolver();
                ITypeElement DeclaredTypeElement = _NewSourceTreeResolver.ResolveExpression(declaredTypeExpression) as ITypeElement;
                return IsElementOfType(DeclaredTypeElement, type);
            } // try
            catch (Exception ex)
            {
                Trace.WriteLine("Exception in IsElementOfType Function: " + ex.Message);
            }
            return false;
        } // IsElementOfType(declaredTypeExpression, type)