/// <summary>
            ///  Constructs the new instance of GridViewListBoxAccessibleObject.
            /// </summary>
            /// <param name="owningGridViewListBox">The owning GridViewListBox.</param>
            public GridViewListBoxAccessibleObject(GridViewListBox owningGridViewListBox) : base(owningGridViewListBox)
            {
                if (owningGridViewListBox.OwningPropertyGridView is null)
                {
                    throw new ArgumentNullException(nameof(owningGridViewListBox.OwningPropertyGridView));
                }

                _owningPropertyGridView = owningGridViewListBox.OwningPropertyGridView;
            }
예제 #2
0
        public void GridViewListBoxAccessibleObject_Ctor_Default()
        {
            using PropertyGrid propertyGrid = new PropertyGrid();
            PropertyGridView propertyGridView = propertyGrid.TestAccessor().GridView;

            using GridViewListBox gridViewListBox = new GridViewListBox(propertyGridView);

            Type type = gridViewListBox.AccessibilityObject.GetType();
            ControlAccessibleObject accessibleObject = (ControlAccessibleObject)Activator.CreateInstance(type, gridViewListBox);

            Assert.Equal(gridViewListBox, accessibleObject.Owner);
            Assert.False(propertyGrid.IsHandleCreated);
            Assert.False(gridViewListBox.IsHandleCreated);
        }
예제 #3
0
        public void GridViewListBoxAccessibleObject_Role_IsExpected_ByDefault(bool createControl, AccessibleRole expectedRole)
        {
            using PropertyGrid propertyGrid = new PropertyGrid();
            PropertyGridView propertyGridView = propertyGrid.TestAccessor().GridView;

            using GridViewListBox gridViewListBox = new GridViewListBox(propertyGridView);
            // AccessibleRole is not set = Default

            if (createControl)
            {
                gridViewListBox.CreateControl();
            }

            AccessibleRole actual = gridViewListBox.AccessibilityObject.Role;

            Assert.Equal(expectedRole, actual);
            Assert.False(propertyGrid.IsHandleCreated);
            Assert.Equal(createControl, gridViewListBox.IsHandleCreated);
        }
 public GridViewListBoxItemAccessibleObject(GridViewListBox owningGridViewListBox, ItemArray.Entry owningItem)
     : base(owningGridViewListBox, owningItem, (ListBoxAccessibleObject)owningGridViewListBox.AccessibilityObject)
 {
     _owningGridViewListBox = owningGridViewListBox;
     _owningItem            = owningItem;
 }
예제 #5
0
        protected override void Dispose(bool disposing) {
            if (disposing) {
                Debug.WriteLineIf(CompModSwitches.DebugGridView.TraceVerbose,  "PropertyGridView:Dispose");
                if (scrollBar != null) scrollBar.Dispose();
                if (listBox != null) listBox.Dispose();
                if (dropDownHolder != null) dropDownHolder.Dispose();
                scrollBar = null;
                listBox = null;
                dropDownHolder = null;

                ownerGrid = null;
                topLevelGridEntries = null;
                allGridEntries = null;
                serviceProvider = null;
                
                topHelpService = null;

                if (helpService != null && helpService is IDisposable)
                    ((IDisposable)helpService).Dispose();

                helpService = null;

                if (edit != null) {
                    edit.Dispose();
                    edit = null;
                }

                if (fontBold != null) {
                    fontBold.Dispose();
                    fontBold = null;

                }

                if (btnDropDown != null) {
                    btnDropDown.Dispose();
                    btnDropDown = null;
                }

                if (btnDialog != null) {
                    btnDialog.Dispose();
                    btnDialog = null;
                }

                if (toolTip != null) {
                    toolTip.Dispose();
                    toolTip = null;
                }
            }

            base.Dispose(disposing);
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.scrollBar != null)
         {
             this.scrollBar.Dispose();
         }
         if (this.listBox != null)
         {
             this.listBox.Dispose();
         }
         if (this.dropDownHolder != null)
         {
             this.dropDownHolder.Dispose();
         }
         this.scrollBar = null;
         this.listBox = null;
         this.dropDownHolder = null;
         this.ownerGrid = null;
         this.topLevelGridEntries = null;
         this.allGridEntries = null;
         this.serviceProvider = null;
         this.topHelpService = null;
         if ((this.helpService != null) && (this.helpService is IDisposable))
         {
             ((IDisposable) this.helpService).Dispose();
         }
         this.helpService = null;
         if (this.edit != null)
         {
             this.edit.Dispose();
             this.edit = null;
         }
         if (this.fontBold != null)
         {
             this.fontBold.Dispose();
             this.fontBold = null;
         }
         if (this.btnDropDown != null)
         {
             this.btnDropDown.Dispose();
             this.btnDropDown = null;
         }
         if (this.btnDialog != null)
         {
             this.btnDialog.Dispose();
             this.btnDialog = null;
         }
         if (this.toolTip != null)
         {
             this.toolTip.Dispose();
             this.toolTip = null;
         }
     }
     base.Dispose(disposing);
 }