internal InternalAccessibleObject(AccessibleObject accessibleImplemention)
 {
     publicIAccessible                     = accessibleImplemention;
     publicIEnumVariant                    = accessibleImplemention;
     publicIOleWindow                      = accessibleImplemention;
     publicIReflect                        = accessibleImplemention;
     publicIServiceProvider                = accessibleImplemention;
     publicIAccessibleEx                   = accessibleImplemention;
     publicIRawElementProviderSimple       = accessibleImplemention;
     publicIRawElementProviderFragment     = accessibleImplemention;
     publicIRawElementProviderFragmentRoot = accessibleImplemention;
     publicIInvokeProvider                 = accessibleImplemention;
     publicIValueProvider                  = accessibleImplemention;
     publicIRangeValueProvider             = accessibleImplemention;
     publicIExpandCollapseProvider         = accessibleImplemention;
     publicIToggleProvider                 = accessibleImplemention;
     publicITableProvider                  = accessibleImplemention;
     publicITableItemProvider              = accessibleImplemention;
     publicIGridProvider                   = accessibleImplemention;
     publicIGridItemProvider               = accessibleImplemention;
     publicILegacyIAccessibleProvider      = accessibleImplemention;
     publicISelectionProvider              = accessibleImplemention;
     publicISelectionItemProvider          = accessibleImplemention;
     publicIRawElementProviderHwndOverride = accessibleImplemention;
 }
示例#2
0
        private bool HandleVistaFileOk(IFileDialog dialog)
        {
            UnsafeNativeMethods.IOleWindow oleWindow = (UnsafeNativeMethods.IOleWindow)dialog;
            oleWindow.GetWindow(out this._hwndFileDialog);
            int value       = this._dialogOptions.Value;
            int filterIndex = this._filterIndex;

            string[] fileNames = this._fileNames;
            bool     flag      = false;

            try
            {
                uint fileTypeIndex = dialog.GetFileTypeIndex();
                this._filterIndex = (int)fileTypeIndex;
                this._fileNames   = this.ProcessVistaFiles(dialog);
                if (this.ProcessFileNames())
                {
                    CancelEventArgs cancelEventArgs = new CancelEventArgs();
                    this.OnFileOk(cancelEventArgs);
                    flag = !cancelEventArgs.Cancel;
                }
            }
            finally
            {
                if (!flag)
                {
                    this._fileNames           = fileNames;
                    this._dialogOptions.Value = value;
                    this._filterIndex         = filterIndex;
                }
                else if ((this.Options & 4) != 0)
                {
                    this._dialogOptions.Value = (this._dialogOptions.Value & -2);
                }
            }
            return(flag);
        }
示例#3
0
 internal InternalAccessibleObject(AccessibleObject accessibleImplemention)
 {
     // Get all the casts done here to catch any issues early
     publicIAccessible = (IAccessible) accessibleImplemention;
     publicIEnumVariant = (UnsafeNativeMethods.IEnumVariant) accessibleImplemention;
     publicIOleWindow = (UnsafeNativeMethods.IOleWindow) accessibleImplemention;
     publicIReflect = (IReflect) accessibleImplemention;
     // Note: Deliberately not holding onto AccessibleObject to enforce all access through the interfaces
 }
示例#4
0
        protected void UseStdAccessibleObjects(IntPtr handle, int objid)
        {
            // Get a standard accessible Object
            Guid IID_IAccessible = new Guid(NativeMethods.uuid_IAccessible);
            object acc = null;
            int result = UnsafeNativeMethods.CreateStdAccessibleObject(
                                                          new HandleRef(this, handle),
                                                          objid,
                                                          ref IID_IAccessible,
                                                          ref acc);

            // Get the IEnumVariant interface
            Guid IID_IEnumVariant = new Guid(NativeMethods.uuid_IEnumVariant);
            object en = null;
            result = UnsafeNativeMethods.CreateStdAccessibleObject(
                                                      new HandleRef(this, handle),
                                                      objid,
                                                      ref IID_IEnumVariant,
                                                      ref en);

            Debug.Assert(acc != null, "SystemIAccessible is null");
            Debug.Assert(en != null, "SystemIEnumVariant is null");

            if (acc != null || en != null) {
                systemIAccessible = (IAccessible)acc;
                systemIEnumVariant = (UnsafeNativeMethods.IEnumVariant)en;
                systemIOleWindow = acc as UnsafeNativeMethods.IOleWindow;
            }
        }