235 references to IsDisposed
System.Windows.Forms (56)
System\Windows\Forms\ApplicationContext.cs (1)
95if (!_mainForm.IsDisposed)
System\Windows\Forms\Control.cs (5)
3591if (IsDisposed && _threadCallbackList is not null && _threadCallbackList.Count > 0) 9129if (!IsDisposed) 11428if (!RecreatingHandle && !Disposing && !IsDisposed && GetState(States.TrackingMouseEvent)) 11501if (IsDisposed) 11684&& !IsDisposed
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1130if (Disposing || IsDisposed)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (5)
14610if (!_dataGridViewOper[OperationInDispose] && !IsDisposed) 14939&& !IsDisposed) 15862&& !IsDisposed 16663if (_dataGridViewOper[OperationInDispose] || IsDisposed) 30107_dataGridViewOper[OperationInDispose] || IsDisposed ? null : Events[staticEvent] as T;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
2784if (DataGridView is null || DataGridView.IsDisposed) 2820if (DataGridView is not null && !DataGridView.IsDisposed && !DataGridView.Disposing)
System\Windows\Forms\Controls\Labels\Label.cs (1)
1178if (Disposing || IsDisposed)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
866if (Disposing || IsDisposed)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
1047if (Disposing || IsDisposed)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
4021if (IsDisposed)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
1310if (IsDisposed)
System\Windows\Forms\Controls\TabControl\TabControl.cs (2)
370if (!IsDisposed) 1985!SelectedTab.IsDisposed && SelectedTab.TabAccessibilityObject is not null)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
1396if (!IsDropDown && !IsDisposed && !Properties.TryGetValue(s_propToolStripPanelCell, out toolStripPanelCell)) 3665if (!Disposing && !IsDisposed) 4090if (!Disposing && !IsDisposed)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.RestoreFocusMessageFilter.cs (1)
19if (_ownerToolStrip.Disposing || _ownerToolStrip.IsDisposed || _ownerToolStrip.IsDropDown)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
1732if (TopLevel && (!IsDisposed || !Disposing)) 1754if (toolStrip is not null && !(toolStrip.IsDisposed || toolStrip.Disposing))
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (1)
539if (!IsDisposed)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (2)
2672if (parent.Disposing || parent.IsDisposed) 3008if (Owner is not null && !(Owner.IsDisposed || Owner.Disposing))
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (1)
193!toolStrip.IsDisposed &&
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
521if (activeToolStrip.IsDisposed)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.cs (2)
26if (_dropDown is not null && !_dropDown.IsDisposed) 35if (_dropDown is not null && !_dropDown.IsDisposed)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
43if (IsDisposed || _numPaintsServiced != 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
391&& !_wrappedToolStrip.IsDisposed // ensure we have a live-runtime only toolstrip.
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.ToolStripTextBoxControl.cs (1)
203if (!Disposing && !IsDisposed)
System\Windows\Forms\Controls\TreeView\TreeNode.cs (14)
232if (tv is null || tv.IsDisposed) 265if (tv is null || tv.IsDisposed) 300if (tv is null || !tv.IsHandleCreated || tv.IsDisposed) 328if (HTREEITEMInternal != IntPtr.Zero && _treeView is not null && !_treeView.IsDisposed) 619if (tv.IsDisposed) 693if (tv is null || tv.IsDisposed) 855if (tv is null || tv.IsDisposed) 960if (tv is null || tv.IsDisposed) 1587if (tv is null || tv.IsDisposed) 1656if (tv is null || tv.IsDisposed) 1818if (tv is null || !tv.IsHandleCreated || tv.IsDisposed) 1973if (tv is null || tv.IsDisposed) 2132if (tv.IsDisposed) 2199if (tv.IsDisposed)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1393ObjectDisposedException.ThrowIf(IsDisposed, this);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
476if (Visible && !Disposing && !IsDisposed)
System\Windows\Forms\ToolTip\ToolTip.cs (2)
196if (TopLevelControl is not null && !TopLevelControl.IsDisposed) 1729if (win is Control control && control.IsDisposed)
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (1)
67if (!control.IsDisposed)
System.Windows.Forms.Design (6)
System\ComponentModel\Design\DesignerActionPanel.cs (1)
361if (Disposing || IsDisposed)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
67if (!_parentControl.IsDisposed)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (1)
103=> DesignerFrame is not null && !DesignerFrame.IsDisposed && DesignerFrame.IsHandleCreated;
System\Windows\Forms\Design\DesignerFrame.cs (1)
116if (selSvc?.PrimarySelection is Control { IsDisposed: false } ctrl)
System\Windows\Forms\Design\SelectionUIService.cs (1)
182if (IsDisposed)
System\Windows\Forms\Design\ToolStripAdornerWindowService.cs (1)
224if (_designerFrame is null || _designerFrame.IsDisposed || !_designerFrame.IsHandleCreated)
System.Windows.Forms.Tests (173)
System\Windows\Forms\ApplicationContextTests.cs (9)
177Assert.True(mainForm.IsDisposed); 181Assert.True(mainForm.IsDisposed); 190Assert.True(mainForm.IsDisposed); 194Assert.True(mainForm.IsDisposed); 198Assert.True(mainForm.IsDisposed); 254Assert.True(mainForm.IsDisposed); 258Assert.True(mainForm.IsDisposed); 268Assert.False(mainForm.IsDisposed); 272Assert.False(mainForm.IsDisposed);
System\Windows\Forms\ButtonBaseTests.cs (24)
4569Assert.Equal(callCount > 0, control.IsDisposed); 4583Assert.True(control.IsDisposed); 4594Assert.True(control.IsDisposed); 4621Assert.Equal(callCount > 0, control.IsDisposed); 4635Assert.True(control.IsDisposed); 4646Assert.True(control.IsDisposed); 4676Assert.Equal(callCount > 0, control.IsDisposed); 4690Assert.True(control.IsDisposed); 4701Assert.True(control.IsDisposed); 4724Assert.Equal(callCount > 0, control.IsDisposed); 4738Assert.True(control.IsDisposed); 4749Assert.True(control.IsDisposed); 4776Assert.Equal(callCount > 0, control.IsDisposed); 4790Assert.True(control.IsDisposed); 4801Assert.True(control.IsDisposed); 4831Assert.Equal(callCount > 0, control.IsDisposed); 4845Assert.True(control.IsDisposed); 4856Assert.True(control.IsDisposed); 4880Assert.False(control.IsDisposed); 4891Assert.False(control.IsDisposed); 4921Assert.False(control.IsDisposed); 4932Assert.False(control.IsDisposed); 4965Assert.False(control.IsDisposed); 4976Assert.False(control.IsDisposed);
System\Windows\Forms\ControlTests.Methods.cs (52)
997Assert.Equal(callCount > 0, control.IsDisposed); 1009Assert.True(control.IsDisposed); 1019Assert.True(control.IsDisposed); 1048Assert.Equal(callCount > 0, control.IsDisposed); 1062Assert.True(control.IsDisposed); 1073Assert.True(control.IsDisposed); 1102Assert.Equal(callCount > 0, control.IsDisposed); 1122Assert.True(control.IsDisposed); 1124Assert.True(child1.IsDisposed); 1126Assert.True(child2.IsDisposed); 1143Assert.True(control.IsDisposed); 1145Assert.True(child1.IsDisposed); 1147Assert.True(child2.IsDisposed); 1175Assert.Equal(callCount > 0, control.IsDisposed); 1187Assert.True(control.IsDisposed); 1197Assert.True(control.IsDisposed); 1230Assert.Equal(callCount > 0, control.IsDisposed); 1242Assert.True(control.IsDisposed); 1256Assert.True(control.IsDisposed); 1299Assert.Equal(callCount > 0, control.IsDisposed); 1311Assert.True(control.IsDisposed); 1321Assert.True(control.IsDisposed); 1346Assert.False(control.IsDisposed); 1356Assert.False(control.IsDisposed); 1385Assert.Equal(callCount > 0, control.IsDisposed); 1399Assert.True(control.IsDisposed); 1410Assert.True(control.IsDisposed); 1442Assert.False(control.IsDisposed); 1453Assert.False(control.IsDisposed); 1482Assert.Equal(callCount > 0, control.IsDisposed); 1502Assert.True(control.IsDisposed); 1504Assert.True(child1.IsDisposed); 1506Assert.True(child2.IsDisposed); 1523Assert.True(control.IsDisposed); 1525Assert.True(child1.IsDisposed); 1527Assert.True(child2.IsDisposed); 1570Assert.False(control.IsDisposed); 1572Assert.False(child1.IsDisposed); 1574Assert.False(child2.IsDisposed); 1591Assert.False(control.IsDisposed); 1593Assert.False(child1.IsDisposed); 1595Assert.False(child2.IsDisposed); 1623Assert.Equal(callCount > 0, control.IsDisposed); 1635Assert.True(control.IsDisposed); 1645Assert.True(control.IsDisposed); 1673Assert.False(control.IsDisposed); 1683Assert.False(control.IsDisposed); 1716Assert.Equal(callCount > 0, control.IsDisposed); 1728Assert.True(control.IsDisposed); 1742Assert.True(control.IsDisposed); 1781Assert.False(control.IsDisposed); 1795Assert.False(control.IsDisposed);
System\Windows\Forms\DataGridViewCellTests.cs (8)
356Assert.False(menu.IsDisposed); 3338Assert.False(menu.IsDisposed); 3508Assert.False(menu.IsDisposed); 3513Assert.False(menu.IsDisposed); 3518Assert.True(menu.IsDisposed); 3545Assert.False(menu.IsDisposed); 3550Assert.False(menu.IsDisposed); 3555Assert.True(menu.IsDisposed);
System\Windows\Forms\DataGridViewHeaderCellTests.cs (2)
2040Assert.False(menu.IsDisposed); 2126Assert.False(menu.IsDisposed);
System\Windows\Forms\StatusStripTests.cs (8)
919Assert.Equal(callCount > 0, control.IsDisposed); 932Assert.True(control.IsDisposed); 943Assert.True(control.IsDisposed); 972Assert.Equal(callCount > 0, control.IsDisposed); 985Assert.True(control.IsDisposed); 996Assert.True(control.IsDisposed); 1038Assert.False(control.IsDisposed); 1049Assert.False(control.IsDisposed);
System\Windows\Forms\ToolStripControlHostTests.cs (8)
2585Assert.False(c.IsDisposed); 2597Assert.True(c.IsDisposed); 2605Assert.True(c.IsDisposed); 2627Assert.False(c.IsDisposed); 2639Assert.True(c.IsDisposed); 2647Assert.True(c.IsDisposed); 2671Assert.False(c.IsDisposed); 2679Assert.False(c.IsDisposed);
System\Windows\Forms\ToolStripDropDownTests.cs (27)
3052Assert.Equal(callCount > 0, control.IsDisposed); 3065Assert.True(control.IsDisposed); 3077Assert.True(control.IsDisposed); 3109Assert.Equal(callCount > 0, control.IsDisposed); 3122Assert.True(control.IsDisposed); 3135Assert.True(control.IsDisposed); 3165Assert.Equal(callCount > 0, control.IsDisposed); 3178Assert.True(control.IsDisposed); 3190Assert.True(control.IsDisposed); 3225Assert.Equal(callCount > 0, control.IsDisposed); 3246Assert.True(control.IsDisposed); 3266Assert.True(control.IsDisposed); 3296Assert.Equal(callCount > 0, control.IsDisposed); 3309Assert.True(control.IsDisposed); 3321Assert.True(control.IsDisposed); 3348Assert.False(control.IsDisposed); 3359Assert.False(control.IsDisposed); 3390Assert.Equal(callCount > 0, control.IsDisposed); 3403Assert.True(control.IsDisposed); 3416Assert.True(control.IsDisposed); 3449Assert.False(control.IsDisposed); 3462Assert.False(control.IsDisposed); 3498Assert.Equal(callCount > 0, control.IsDisposed); 3519Assert.True(control.IsDisposed); 3539Assert.True(control.IsDisposed); 3588Assert.False(control.IsDisposed); 3607Assert.False(control.IsDisposed);
System\Windows\Forms\ToolStripTests.cs (19)
4370Assert.Equal(callCount > 0, control.IsDisposed); 4383Assert.True(control.IsDisposed); 4395Assert.True(control.IsDisposed); 4424Assert.Equal(callCount > 0, control.IsDisposed); 4437Assert.True(control.IsDisposed); 4449Assert.True(control.IsDisposed); 4484Assert.Equal(callCount > 0, control.IsDisposed); 4505Assert.True(control.IsDisposed); 4525Assert.True(control.IsDisposed); 4555Assert.Equal(callCount > 0, control.IsDisposed); 4568Assert.True(control.IsDisposed); 4580Assert.True(control.IsDisposed); 4607Assert.False(control.IsDisposed); 4618Assert.False(control.IsDisposed); 4652Assert.Equal(callCount > 0, control.IsDisposed); 4673Assert.True(control.IsDisposed); 4693Assert.True(control.IsDisposed); 4742Assert.False(control.IsDisposed); 4761Assert.False(control.IsDisposed);
System\Windows\Forms\WebBrowserTests.cs (16)
2534Assert.Equal(callCount > 0, control.IsDisposed); 2547Assert.True(control.IsDisposed); 2558Assert.True(control.IsDisposed); 2589Assert.Equal(callCount > 0, control.IsDisposed); 2602Assert.True(control.IsDisposed); 2613Assert.True(control.IsDisposed); 2637Assert.Equal(callCount > 0, control.IsDisposed); 2650Assert.True(control.IsDisposed); 2661Assert.True(control.IsDisposed); 2694Assert.False(control.IsDisposed); 2705Assert.False(control.IsDisposed); 2736Assert.Equal(callCount > 0, control.IsDisposed); 2749Assert.True(control.IsDisposed); 2760Assert.True(control.IsDisposed); 2786Assert.False(control.IsDisposed); 2797Assert.False(control.IsDisposed);