171 references to OrThrowIfNull
PresentationCore (11)
System\Windows\clipboard.cs (1)
447
resolver.
OrThrowIfNull
();
System\Windows\dataobject.cs (10)
58
SetData(format, data.
OrThrowIfNull
());
64
SetData(format.FullName.
OrThrowIfNull
(), data.
OrThrowIfNull
());
70
SetData(format, data.
OrThrowIfNull
(), autoConvert);
140
public object? GetData(Type format) => GetData(format.
OrThrowIfNull
().FullName.
OrThrowIfNull
());
151
resolver.
OrThrowIfNull
();
195
public bool GetDataPresent(Type format) => GetDataPresent(format.
OrThrowIfNull
().FullName.
OrThrowIfNull
());
359
string[] strings = new string[fileDropList.
OrThrowIfNull
().Count];
System.Private.Windows.Core (7)
System\Private\Windows\Ole\Composition.cs (2)
127
format ??= typeof(T).FullName.
OrThrowIfNull
();
177
ManagedDataObject.TryGetData(typeof(T).FullName.
OrThrowIfNull
(), out data);
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (3)
516
public object? GetData(Type format) => GetData(format.FullName.
OrThrowIfNull
());
517
public bool GetDataPresent(Type format) => GetDataPresent(format.FullName.
OrThrowIfNull
());
629
typeof(T).FullName.
OrThrowIfNull
(),
System\Private\Windows\Ole\DataObjectExtensions.cs (1)
12
if (filePaths.
OrThrowIfNull
().Count == 0)
System\Private\Windows\Ole\DataStore.cs (1)
94
SetData(format.FullName.
OrThrowIfNull
(), data);
System.Windows.Forms (131)
System\Drawing\Design\PaintValueEventArgs.cs (1)
25
Graphics = graphics.
OrThrowIfNull
();
System\Drawing\Design\PropertyValueUIItem.cs (2)
17
Image = uiItemImage.
OrThrowIfNull
();
18
InvokeHandler = handler.
OrThrowIfNull
();
System\Resources\ResXDataNode.cs (1)
108
_fileRef = fileRef.
OrThrowIfNull
();
System\Resources\ResXFileRef.cs (2)
25
FileName = fileName.
OrThrowIfNull
();
26
TypeName = typeName.
OrThrowIfNull
();
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (1)
41
_ownerControl = new(ownerControl.
OrThrowIfNull
());
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (1)
34
_owningChildEditAccessibilityObject = childEditAccessibilityObject.
OrThrowIfNull
();
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (1)
34
internal OleInterfaces(AxHost host) => _host = host.
OrThrowIfNull
();
System\Windows\Forms\Control.ControlCollection.cs (1)
26
Owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Control.ControlNativeWindow.cs (1)
17
_control = control.
OrThrowIfNull
();
System\Windows\Forms\Control.cs (2)
507
accessibleObject = CreateAccessibilityInstance().
OrThrowIfNull
();
4887
data.
OrThrowIfNull
(nameof(data));
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
19
internal ButtonBaseAdapter(ButtonBase control) => Control = control.
OrThrowIfNull
();
System\Windows\Forms\Controls\ComboBox\ComboBox.ChildAccessibleObject.cs (1)
14
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxItemAccessibleObject.cs (1)
29
_owningComboBox = owningComboBox.
OrThrowIfNull
();
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
34
_owningComboBox = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (1)
410
InnerList[index].Item = value.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (1)
70
DataGridViewCell dataGridViewCell = value.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewCellPaintingEventArgs.cs (3)
33
_dataGridView = dataGridView.
OrThrowIfNull
();
34
Graphics = graphics.
OrThrowIfNull
();
43
CellStyle = cellStyle.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStateChangedEventArgs.cs (1)
10
Cell = dataGridViewCell.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyleContentChangedEventArgs.cs (1)
10
CellStyle = dataGridViewCellStyle.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.ObjectCollection.cs (1)
166
InnerArray[index] = value.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewEditingControlShowingEventArgs.cs (3)
12
Control = control.
OrThrowIfNull
();
13
_cellStyle = cellStyle.
OrThrowIfNull
();
21
set => _cellStyle = value.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowDividerDoubleClickEventArgs.cs (1)
9
: base((e.
OrThrowIfNull
()).Button, e.Clicks, e.X, e.Y, e.Delta, e.Handled)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowEventArgs.cs (1)
10
Row = dataGridViewRow.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPostPaintEventArgs.cs (3)
24
_dataGridView = dataGridView.
OrThrowIfNull
();
25
Graphics = graphics.
OrThrowIfNull
();
31
InheritedRowStyle = inheritedRowStyle.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPrePaintEventArgs.cs (3)
26
_dataGridView = dataGridView.
OrThrowIfNull
();
27
Graphics = graphics.
OrThrowIfNull
();
33
InheritedRowStyle = inheritedRowStyle.
OrThrowIfNull
();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowStateChangedEventArgs.cs (1)
10
Row = dataGridViewRow.
OrThrowIfNull
();
System\Windows\Forms\Controls\Labels\LinkLabel.Link.LinkAccessibleObject.cs (2)
22
_owningLink = link.
OrThrowIfNull
();
23
_owningLinkLabel = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\Labels\LinkLabel.LinkCollection.cs (1)
22
public LinkCollection(LinkLabel owner) => _owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedIndexCollection.cs (1)
17
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListBoxes\ListBox.IntegerCollection.cs (1)
19
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (3)
23
_owningListBox = owningListBox.
OrThrowIfNull
();
24
_itemEntry = itemEntry.
OrThrowIfNull
();
25
_owningAccessibleObject = owningAccessibleObject.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
25
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedIndexCollection.cs (1)
17
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (1)
24
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ColumnHeader.ListViewColumnHeaderAccessibleObject.cs (1)
17
_owningColumnHeader = columnHeader.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (1)
28
Graphics = graphics.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (2)
23
Graphics = graphics.
OrThrowIfNull
();
24
Item = item.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
26
Graphics = graphics.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListView.CheckedIndexCollection.cs (1)
19
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListView.CheckedListViewItemCollection.cs (1)
24
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (1)
18
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (1)
23
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (2)
22
_owningGroup = owningGroup.
OrThrowIfNull
();
23
_owningListView = listView.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
28
_owningItem = owningItem.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemImageAccessibleObject.cs (1)
18
_owningItem = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
26
_owningItem = owningItem.
OrThrowIfNull
();
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (2)
23
_owner = owner.
OrThrowIfNull
();
59
_owner._subItems[index] = value.
OrThrowIfNull
();
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarChildAccessibleObject.cs (1)
20
_monthCalendarAccessibleObject = calendarAccessibleObject.
OrThrowIfNull
();
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyTabCollection.cs (1)
18
_ownerPropertyGrid = ownerPropertyGrid.
OrThrowIfNull
();
System\Windows\Forms\Controls\TabControl\TabControl.TabPageCollection.cs (1)
23
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\TabControl\TabPage.TabAccessibleObject.cs (1)
18
_owningTabPage = owningTabPage.
OrThrowIfNull
();
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
20
_owner = new(owner.
OrThrowIfNull
());
System\Windows\Forms\Controls\ToolStrips\ToolStripArrowRenderEventArgs.cs (1)
20
Graphics = g.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripContentPanelRenderEventArgs.cs (2)
15
Graphics = g.
OrThrowIfNull
();
16
ToolStripContentPanel = contentPanel.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (3)
1815
SourceControlInternal = control.
OrThrowIfNull
();
1831
SourceControlInternal = control.
OrThrowIfNull
();
1840
SourceControlInternal = control.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
23
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemAccessibleObject.cs (1)
27
_ownerItem = ownerItem.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (1)
27
_ownerItem = ownerItem.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
38
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripItemRenderEventArgs.cs (2)
15
Graphics = g.
OrThrowIfNull
();
16
Item = item.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (1)
1356
=> RevertMergeInternal(targetToolStrip, sourceToolStrip.
OrThrowIfNull
(nameof(sourceToolStrip)), revertMDIControls: false);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRenderEventArgs.cs (2)
15
Graphics = g.
OrThrowIfNull
();
16
ToolStripPanel = toolStripPanel.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderEventArgs.cs (3)
16
: this(g, toolStrip, new Rectangle(Point.Empty, toolStrip.
OrThrowIfNull
().Size), Color.Empty)
29
Graphics = g.
OrThrowIfNull
();
30
ToolStrip = toolStrip.
OrThrowIfNull
();
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (1)
18
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Controls\TrackBar\TrackBar.TrackBarChildAccessibleObject.cs (1)
18
=> _owningTrackBar = new(owningTrackBar.
OrThrowIfNull
());
System\Windows\Forms\Controls\TreeView\DrawTreeNodeEventArgs.cs (1)
22
Graphics = graphics.
OrThrowIfNull
();
System\Windows\Forms\Controls\TreeView\TreeNode.TreeNodeAccessibleObject.cs (2)
19
_owningTreeNode = owningTreeNode.
OrThrowIfNull
();
20
_owningTreeView = owningTreeView.
OrThrowIfNull
();
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.UpDownButtonsAccessibleObject.DirectionButtonAccessibleObject.cs (1)
23
_parent = parent.
OrThrowIfNull
();
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownEdit.UpDownEditAccessibleObject.cs (1)
18
_parent = parent.
OrThrowIfNull
();
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (1)
40
internal WebBrowserSiteBase(WebBrowserBase h) => _host = h.
OrThrowIfNull
();
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (1)
34
_form = form.
OrThrowIfNull
();
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (4)
331
=> ShowDialogAsync(IntPtr.Zero, page.
OrThrowIfNull
(), startupLocation);
462
=> ShowDialog(IntPtr.Zero, page.
OrThrowIfNull
(), startupLocation);
495
=> ShowDialog(owner.
OrThrowIfNull
().Handle, page.
OrThrowIfNull
(), startupLocation);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.WindowSubclassHandler.cs (1)
13
: base((HWND)taskDialog.
OrThrowIfNull
().Handle)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogControl.cs (1)
60
BoundPage = page.
OrThrowIfNull
();
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogIcon.cs (2)
112
: this(BitmapToIcon(image.
OrThrowIfNull
()), true)
130
: this(icon.
OrThrowIfNull
(), false)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (2)
134
_buttons = value.
OrThrowIfNull
();
165
_radioButtons = value.
OrThrowIfNull
();
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (1)
572
_icon = value.
OrThrowIfNull
();
System\Windows\Forms\Input\Cursor.cs (2)
46
: this(typeof(Cursors).Assembly.GetManifestResourceStream(typeof(Cursor), resource).
OrThrowIfNull
())
84
: this(type.
OrThrowIfNull
().Module.Assembly.GetManifestResourceStream(type, resource)!)
System\Windows\Forms\Input\InputLanguageChangedEventArgs.cs (1)
33
InputLanguage = inputLanguage.
OrThrowIfNull
();
System\Windows\Forms\Input\InputLanguageChangingEventArgs.cs (1)
34
InputLanguage = inputLanguage.
OrThrowIfNull
();
System\Windows\Forms\ItemCheckedEventArgs.cs (1)
13
Item = item.
OrThrowIfNull
();
System\Windows\Forms\OLE\Clipboard.cs (4)
311
resolver.
OrThrowIfNull
();
417
public static void SetAudio(byte[] audioBytes) => SetAudio(new MemoryStream(audioBytes.
OrThrowIfNull
()));
423
SetDataObject(new DataObject(DataFormatNames.WaveAudio, audioStream.
OrThrowIfNull
()), copy: true);
463
SetDataObject(new DataObject(DataFormatNames.Bitmap, autoConvert: true, image.
OrThrowIfNull
()), copy: true);
System\Windows\Forms\OLE\DataObject.cs (7)
76
public DataObject(string format, object data) : this() => SetData(format, data.
OrThrowIfNull
());
79
SetData(format, autoConvert, data.
OrThrowIfNull
());
159
resolver.
OrThrowIfNull
();
236
public virtual void SetAudio(byte[] audioBytes) => SetAudio(new MemoryStream(audioBytes.
OrThrowIfNull
()));
239
SetData(DataFormatNames.WaveAudio, autoConvert: false, audioStream.
OrThrowIfNull
());
243
string[] strings = new string[filePaths.
OrThrowIfNull
().Count];
248
public virtual void SetImage(Image image) => SetData(DataFormatNames.Bitmap, true, image.
OrThrowIfNull
());
System\Windows\Forms\OLE\DropSource.cs (2)
22
_peer = peer.
OrThrowIfNull
();
23
_dataObject = dataObject.
OrThrowIfNull
();
System\Windows\Forms\OLE\DropTarget.cs (1)
23
_owner = owner.
OrThrowIfNull
();
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutControlCollection.cs (1)
16
public TableLayoutControlCollection(TableLayoutPanel container) : base(container.
OrThrowIfNull
())
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
35
_graphics = graphics.
OrThrowIfNull
();
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (1)
29
Graphics = graphics.
OrThrowIfNull
();
System\Windows\Forms\ToolTip\ToolTip.ToolTipNativeWindow.cs (1)
14
_toolTip = toolTip.
OrThrowIfNull
();
System\Windows\Forms\VisualStyles\VisualStyleElement.cs (1)
21
ClassName = className.
OrThrowIfNull
();
System.Windows.Forms.Design (18)
System\ComponentModel\Design\CollectionEditor.CollectionForm.cs (1)
30
_editor = editor.
OrThrowIfNull
();
System\ComponentModel\Design\CollectionEditor.cs (1)
26
public CollectionEditor(Type type) => CollectionType = type.
OrThrowIfNull
();
System\ComponentModel\Design\DesignerActionPanel.Line.cs (1)
18
ActionPanel = actionPanel.
OrThrowIfNull
();
System\ComponentModel\Design\DesignSurfaceEvent.cs (1)
21
Surface = surface.
OrThrowIfNull
();
System\ComponentModel\Design\EventBindingService.cs (1)
27
_provider = provider.
OrThrowIfNull
();
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
53
_provider = provider.
OrThrowIfNull
();
System\ComponentModel\Design\Serialization\ExpressionContext.cs (3)
28
Expression = expression.
OrThrowIfNull
();
29
ExpressionType = expressionType.
OrThrowIfNull
();
30
Owner = owner.
OrThrowIfNull
();
System\ComponentModel\Design\Serialization\RootContext.cs (2)
22
Expression = expression.
OrThrowIfNull
();
23
Value = value.
OrThrowIfNull
();
System\ComponentModel\Design\UndoEngine.cs (1)
38
_provider = provider.
OrThrowIfNull
();
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (1)
30
UndoEngine = engine.
OrThrowIfNull
();
System\Windows\Forms\Design\ControlDesigner.TransparentBehavior.cs (1)
24
internal TransparentBehavior(ControlDesigner designer) => _designer = designer.
OrThrowIfNull
();
System\Windows\Forms\Design\ListAdapter.cs (4)
18
internal ListAdapter(IList list) => _list = list.
OrThrowIfNull
();
23
set => _list[index] = value.
OrThrowIfNull
();
30
void ICollection<T>.Add(T item) => _list.Add(item.
OrThrowIfNull
());
36
void IList<T>.Insert(int index, T item) => _list.Insert(index, item.
OrThrowIfNull
());
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Automation\UiaTextRange.cs (1)
41
_provider = provider.
OrThrowIfNull
();
System.Windows.Forms.Primitives.Tests (3)
System\Windows\Forms\Internals\ArgumentValidationTests.cs (3)
12
var exception = Assert.Throws<ArgumentNullException>(() => _ = param.
OrThrowIfNull
());
21
var exception = Assert.Throws<ArgumentNullException>(() => _ = param.
OrThrowIfNull
(paramName));
29
object variable = param.
OrThrowIfNull
();