Esempio n. 1
0
 /// <summary>
 /// Make generic specialization of method.
 /// </summary>
 /// <param name="methodPath">The method path with generic arguments.</param>
 /// <param name="methodDefinition">The method signature with generic parameters.</param>
 /// <returns>Generic specialization of method.</returns>
 public MethodItem Make(PathInfo methodPath, TypeMethodInfo methodDefinition)
 {
     return(new MethodItem(this, methodDefinition.MakeGenericMethod(methodPath)));
 }
        /// <summary>
        /// Gets the implementation of virtual method.
        /// </summary>
        /// <param name="method">The method which implementation is searched.</param>
        /// <param name="methodSearchPath">Path of searched method with generic arguments.</param>
        /// <param name="implementingTypePath">Path of implementing type.</param>
        /// <returns>Implementing method identifier if found, <c>null</c> otherwise.</returns>
        public MethodID GetGenericImplementation(MethodID method, PathInfo methodSearchPath, PathInfo implementingTypePath)
        {
            var implementationEntry = Tuple.Create(implementingTypePath.Signature, methodSearchPath.Signature);

            MethodItem implementation;

            if (!_genericImplementations.TryGetValue(implementationEntry, out implementation))
            {
                //implementation not found
                return(null);
            }

            var implementingMethod     = Naming.ChangeDeclaringType(implementingTypePath.Name, method, false);
            var implementingMethodPath = Naming.GetMethodPath(implementingMethod);
            var genericImplementation  = implementation.Make(implementingMethodPath);

            return(genericImplementation.Info.MethodID);
        }
        /// <summary>
        /// Method that is used for searching method info according to path - method info is instantiated
        /// according to generic.
        /// </summary>
        /// <param name="path">Path of searched methods.</param>
        /// <returns>Found methods.</returns>
        public IEnumerable <TypeMethodInfo> AccordingPath(PathInfo path)
        {
            var overloads = from overload in accordingPath(path) select overload.Info;

            return(overloads);
        }
Esempio n. 4
0
 /// <summary>
 /// Gets inheritance chain for type described by given path.
 /// </summary>
 /// <param name="typePath">The type path.</param>
 /// <returns>InheritanceChain.</returns>
 public abstract InheritanceChain GetInheritanceChain(PathInfo typePath);
Esempio n. 5
0
 /// <summary>
 /// Gets identifier of implementing method for given abstract method.
 /// </summary>
 /// <param name="methodID">The abstract method identifier.</param>
 /// <param name="methodSearchPath">The method search path.</param>
 /// <param name="implementingTypePath">The implementing type path.</param>
 /// <param name="alternativeImplementer">The alternative implementer which can define requested method.</param>
 /// <returns>Identifier of implementing method.</returns>
 public abstract MethodID GetGenericImplementation(MethodID methodID, PathInfo methodSearchPath, PathInfo implementingTypePath, out PathInfo alternativeImplementer);
Esempio n. 6
0
 /// <summary>
 /// Gets the generic method generator for given method identifier.
 /// Generic has to be resolved according to given search path.
 /// </summary>
 /// <param name="method">The method.</param>
 /// <param name="searchPath">The search path.</param>
 /// <returns>GeneratorBase.</returns>
 public abstract GeneratorBase GetGenericMethodGenerator(MethodID method, PathInfo searchPath);