Inheritance: IUIAutomationPatternHandler
        public AttributeDrivenPatternSchema(Type patternProviderInterface, Type patternClientInterface)
        {
            if (!patternProviderInterface.IsInterface)
                throw new ArgumentException("Provided pattern provider type should be an interface", "patternProviderInterface");
            if (!patternClientInterface.IsInterface)
                throw new ArgumentException("Provided pattern client type should be an interface", "patternClientInterface");
            _patternProviderInterface = patternProviderInterface;
            _patternClientInterface = patternClientInterface;

            var patternClientName = _patternClientInterface.Name;
            if (!patternClientName.EndsWith("Pattern") || !patternClientName.StartsWith("I"))
                throw new ArgumentException("Pattern client interface named incorrectly, should be IXxxPattern", "patternClientInterface");
            var baseName = patternClientName.Substring(1, patternClientName.Length - "I".Length - "Pattern".Length);
            if (_patternProviderInterface.Name != string.Format("I{0}Provider", baseName))
                throw new ArgumentException(string.Format("Pattern provider interface named incorrectly, should be I{0}Provider", baseName));
            _patternName = string.Format("{0}Pattern", baseName);

            var patternGuidAttr = _patternProviderInterface.GetAttribute<PatternGuidAttribute>();
            if (patternGuidAttr == null) throw new ArgumentException("Provided type should be marked with PatternGuid attribute");
            _patternGuid = patternGuidAttr.Value;

            _methods = patternProviderInterface.GetMethodsMarkedWith<PatternMethodAttribute>().Select(GetMethodHelper).ToArray();
            _properties = patternProviderInterface.GetPropertiesMarkedWith<PatternPropertyAttribute>().Select(GetPropertyHelper).ToArray();
            ValidateClientInterface();
            _handler = new AttributeDrivenPatternHandler(this);
        }
        public AttributeDrivenPatternSchema(Type patternProviderInterface, Type patternClientInterface)
        {
            if (!patternProviderInterface.IsInterface)
            {
                throw new ArgumentException("Provided pattern provider type should be an interface", "patternProviderInterface");
            }
            if (!patternClientInterface.IsInterface)
            {
                throw new ArgumentException("Provided pattern client type should be an interface", "patternClientInterface");
            }
            _patternProviderInterface = patternProviderInterface;
            _patternClientInterface   = patternClientInterface;

            var patternClientName = _patternClientInterface.Name;

            if (!patternClientName.EndsWith("Pattern") || !patternClientName.StartsWith("I"))
            {
                throw new ArgumentException("Pattern client interface named incorrectly, should be IXxxPattern", "patternClientInterface");
            }
            var baseName = patternClientName.Substring(1, patternClientName.Length - "I".Length - "Pattern".Length);

            if (_patternProviderInterface.Name != string.Format("I{0}Provider", baseName))
            {
                throw new ArgumentException(string.Format("Pattern provider interface named incorrectly, should be I{0}Provider", baseName));
            }
            _patternName = string.Format("{0}Pattern", baseName);

            var patternGuidAttr = _patternProviderInterface.GetAttribute <PatternGuidAttribute>();

            if (patternGuidAttr == null)
            {
                throw new ArgumentException("Provided type should be marked with PatternGuid attribute");
            }
            _patternGuid = patternGuidAttr.Value;

            _methods    = patternProviderInterface.GetMethodsMarkedWith <PatternMethodAttribute>().Select(GetMethodHelper).ToArray();
            _properties = patternProviderInterface.GetPropertiesMarkedWith <PatternPropertyAttribute>().Select(GetPropertyHelper).ToArray();
            ValidateClientInterface();
            _handler = new AttributeDrivenPatternHandler(this);
        }