コード例 #1
0
        internal static void AccSelector_Set(IAccessible accObj, string controlValue)
        {
            int num;

            RefreshAccessibleChildren(accObj, out num);
            for (int i = 0; i < num; i++)
            {
                try
                {
                    if (controlValue.Length.Equals(0))
                    {
                        if (TestAccState(accObj, i + 1, OleAccStateSystem.STATE_SYSTEM_SELECTED))
                        {
                            accObj.accSelect(0x10, i + 1);
                        }
                    }
                    else if (GetName(accObj, i + 1).Equals(controlValue))
                    {
                        if (TestAccState(accObj, i + 1, OleAccStateSystem.STATE_SYSTEM_MULTISELECTABLE))
                        {
                            int flagsSelect = TestAccState(accObj, i + 1, OleAccStateSystem.STATE_SYSTEM_SELECTED) ? 0x10 : 8;
                            accObj.accSelect(flagsSelect, i + 1);
                        }
                        else
                        {
                            int num4 = TestAccState(accObj, i + 1, OleAccStateSystem.STATE_SYSTEM_SELECTED) ? 0x10 : 8;
                            try
                            {
                                accObj.accSelect(num4, i + 1);
                            }
                            catch (ArgumentException)
                            {
                                if (num4 == 8)
                                {
                                    accObj.accSelect(2, i + 1);
                                }
                            }
                        }
                        break;
                    }
                }
                catch (Exception exception)
                {
                    if (!IsOleAccException(exception) || !IsOleAccExceptionMaskable(exception))
                    {
                        throw;
                    }
                }
            }
        }
コード例 #2
0
        // Methods
        internal static void AccSelector_Execute(IAccessible accObj)
        {
            int num;

            RefreshAccessibleChildren(accObj, out num);
            int num2 = -1;

            for (int i = 0; i < num; i++)
            {
                if (!TestAccState(accObj, i + 1, OleAccStateSystem.STATE_SYSTEM_SELECTED))
                {
                    num2 = i;
                    break;
                }
            }
            if (num2 >= 0)
            {
                try
                {
                    accObj.accSelect(8, num2 + 1);
                }
                catch (Exception exception)
                {
                    if (!IsOleAccException(exception) || !IsOleAccExceptionMaskable(exception))
                    {
                        throw;
                    }
                }
            }
        }
コード例 #3
0
        /* ChoosePrinter(String name)
         * choose the printer by name.
         * return true if we found the printer, else return false.
         */
        public static bool ChoosePrinter(String name)
        {
            if (_paccPrintList != null && name != null)
            {
                int    childrenCount = _paccPrintList.accChildCount;
                object childID;

                for (int i = 1; i <= childrenCount; i++)
                {
                    childID = i;
                    string curPrinterName = _paccPrintList.get_accName(childID);

                    //name is the same, found it.
                    if (String.Compare(name.Trim(), curPrinterName.Trim(), true) == 0)
                    {
                        //select this printer.
                        _paccPrintList.accSelect(2, childID);

                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #4
0
 public override void Select(AccessibleSelection flags)
 {
     try
     {
         _systemIAccessible.accSelect((int)flags, GetChildId());
     }
     catch (ArgumentException)
     {
         // In Everett, the ListBox accessible children did not have any selection capability.
         // In Whidbey, they delegate the selection capability to OLEACC.
         // However, OLEACC does not deal w/ several Selection flags: ExtendSelection, AddSelection, RemoveSelection.
         // OLEACC instead throws an ArgumentException.
         // Since Whidbey API's should not throw an exception in places where Everett API's did not, we catch
         // the ArgumentException and fail silently.
     }
 }
コード例 #5
0
 void IAccessibleInternal.accSelect(int flagsSelect, object childID)
 => publicIAccessible.accSelect(flagsSelect, childID);
コード例 #6
0
 public override void Select(AccessibleSelection flags)
 {
     acc.accSelect((int)flags, this.id);
 }
コード例 #7
0
ファイル: Accessible.cs プロジェクト: victor0225/NeuralAction
 public void Select(int flag)
 {
     IAccessible.accSelect(flag, ChildId);
 }
コード例 #8
0
 void UnsafeNativeMethods.IAccessibleInternal.accSelect(int flagsSelect, object childID)
 {
     IntSecurity.UnmanagedCode.Assert();
     publicIAccessible.accSelect(flagsSelect, childID);
 }