Exemplo n.º 1
0
        /// <summary>
        /// Gets identifier of implementing method for given abstract method.
        /// </summary>
        /// <param name="method">The abstract method identifier.</param>
        /// <param name="dynamicInfo">The dynamic information.</param>
        /// <param name="alternativeImplementer">The alternative implementer which can define requested method.</param>
        /// <returns>Identifier of implementing method.</returns>
        public override MethodID GetImplementation(MethodID method, TypeDescriptor dynamicInfo, out TypeDescriptor alternativeImplementer)
        {
            alternativeImplementer = null;

            requireBuilded();
            return(_methods.GetImplementation(method, dynamicInfo));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets identifier of implementing method for given abstract method.
        /// </summary>
        /// <param name="method">The abstract method identifier.</param>
        /// <param name="dynamicInfo">The dynamic information.</param>
        /// <param name="alternativeImplementer">The alternative implementer which can define requested method.</param>
        /// <returns>Identifier of implementing method.</returns>
        public override MethodID GetImplementation(MethodID method, TypeDescriptor dynamicInfo, out TypeDescriptor alternativeImplementer)
        {
            //we may have explicit definition
            alternativeImplementer = null;
            var explicitImplementation = _runtimeMethods.GetImplementation(method, dynamicInfo);

            if (explicitImplementation != null)
            {
                return(explicitImplementation);
            }

            //or there is implicit .NET definition
            var signature      = PathInfo.GetSignature(dynamicInfo);
            var isNativeObject = _directSignatures.Contains(signature);

            if (!isNativeObject)
            {
                //implicit definition is there only for native objects
                return(null);
            }

            //we can use native implementation
            return(method); //note that using dynamic flag is a hack
        }