ManagedUiaCustomizationCore.CustomPatternSchemaBase.GetMemberByIndex C# (CSharp) Method

GetMemberByIndex() public method

public GetMemberByIndex ( uint index ) : ISchemaMember
index uint
return ISchemaMember
        public ISchemaMember GetMemberByIndex(uint index)
        {
            if (!_registered)
                throw new InvalidOperationException("Pattern schema should be registered first");

            ISchemaMember result;
            if (_members.TryGetValue(index, out result))
                return result;
            return null;
        }

Usage Example

        public void Dispatch(object pTarget, uint index, UIAutomationParameter[] pParams, uint cParams)
        {
            ISchemaMember dispatchingMember = _schema.GetMemberByIndex(index);

            if (dispatchingMember == null)
            {
                throw new NotSupportedException("Dispatching of this method is not supported");
            }

            dispatchingMember.DispatchCallToProvider(pTarget, new UiaParameterListHelper(pParams));
        }