Exemple #1
0
        public static void ImplementsTypeMatcherProtocol(Type type)
        {
            Debug.Assert(type != null);

            Guard.ImplementsInterface(typeof(ITypeMatcher), type);
            Guard.CanCreateInstance(type);
        }
Exemple #2
0
        public static void ImplementsTypeMatcherProtocol(Type type)
        {
            Debug.Assert(type != null);

            if (typeof(ITypeMatcher).IsAssignableFrom(type) == false)
            {
                throw new ArgumentException(
                          string.Format(
                              CultureInfo.CurrentCulture,
                              Resources.TypeNotImplementInterface,
                              type.GetFormattedName(),
                              typeof(ITypeMatcher).GetFormattedName()));
            }

            Guard.CanCreateInstance(type);
        }