ArgumentNotInterface() публичный статический Метод

public static ArgumentNotInterface ( Type argValue, String argName ) : void
argValue System.Type
argName String
Результат void
Пример #1
0
        /// <summary>
        /// Wraps an interface. The target argument must be an
        /// object capable of responding to the interface messages, or
        /// your interceptors must be capable of respoding to them.
        /// </summary>
        /// <param name="classType">Concrete class with a available constructor (public or protected) to be wrapped</param>
        /// <returns>A proxy</returns>
        public virtual object WrapClass(Type classType, params object[] constructorArgs)
        {
            AssertUtil.ArgumentNotNull(classType, "classType");
            AssertUtil.ArgumentNotInterface(classType, "classType");

            AspectDefinition[] aspects = AspectMatcher.Match(classType, Configuration.Aspects);

            if (aspects.Length == 0)
            {
                return(Activator.CreateInstance(classType, constructorArgs));
            }

            AspectDefinition aspectdef = Union(aspects);

            return(ProxyFactory.CreateClassProxy(classType, aspectdef, constructorArgs));
        }