123 references to TryGetValue
System.Windows.Forms (108)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
83
if (!Properties.
TryGetValue
(s_activeXImplProperty, out ActiveXImpl? activeXImpl))
System\Windows\Forms\Control.cs (28)
500
if (!Properties.
TryGetValue
(s_accessibilityProperty, out AccessibleObject? accessibleObject))
519
if (!Properties.
TryGetValue
(s_ncAccessibilityProperty, out AccessibleObject? ncAccessibleObject))
744
if (Properties.
TryGetValue
(s_backBrushProperty, out HBRUSH customBackBrush))
803
get => Properties.
TryGetValue
(s_dataContextProperty, out object? value)
1012
if (Properties.
TryGetValue
(s_bindingManagerProperty, out BindingContext? context))
1537
if (Properties.
TryGetValue
(s_cursorProperty, out Cursor? cursor))
1602
if (!Properties.
TryGetValue
(s_bindingsProperty, out ControlBindingsCollection? bindings))
1735
if (Properties.
TryGetValue
(s_fontHandleWrapperProperty, out FontHandleWrapper? fontHandle))
1990
if (!Properties.
TryGetValue
(s_fontHandleWrapperProperty, out FontHandleWrapper? fontHandle))
2007
if (Properties.
TryGetValue
(s_currentAmbientFontProperty, out Font? currentAmbient) && currentAmbient == ambientFont)
2030
if (Properties.
TryGetValue
(s_fontHeightProperty, out int fontHeight) && fontHeight != -1)
2070
Properties.
TryGetValue
(s_foreColorProperty, out Color color);
2924
if (!Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft)
3215
if (control.IsActiveX && control.Properties.
TryGetValue
(s_activeXImplProperty, out ActiveXImpl? activeX))
3457
get => Properties.
TryGetValue
(s_useCompatibleTextRenderingProperty, out bool value)
3488
if (!Properties.
TryGetValue
(s_controlVersionInfoProperty, out ControlVersionInfo? info))
4755
if (Properties.
TryGetValue
(s_backBrushProperty, out HBRUSH backBrush))
6649
if (Properties.
TryGetValue
(s_backBrushProperty, out HBRUSH backBrush))
7112
if (!Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft) || rightToLeft == RightToLeft.Inherit)
7352
if (Properties.
TryGetValue
(s_accessibilityProperty, out ControlAccessibleObject? clientAccessibleObject))
7359
if (Properties.
TryGetValue
(s_ncAccessibilityProperty, out ControlAccessibleObject? nonClientAccessibleObject))
7502
if (Properties.
TryGetValue
(s_accessibilityProperty, out ControlAccessibleObject? accObj))
7509
if (Properties.
TryGetValue
(s_ncAccessibilityProperty, out ControlAccessibleObject? nonClientAccessibleObject))
7516
if (!RecreatingHandle && GetState(States.OwnCtlBrush) && Properties.
TryGetValue
(s_backBrushProperty, out HBRUSH backBrush))
9442
Properties.
TryGetValue
(s_accessibilityProperty, out accessibleObject);
10573
Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft)
10759
Properties.
TryGetValue
(s_fontProperty, out font);
11172
if (!Properties.
TryGetValue
(s_contextMenuStripProperty, out ContextMenuStrip? contextMenuStrip))
System\Windows\Forms\Control.Ime.cs (2)
38
if (!Properties.
TryGetValue
(s_imeModeProperty, out ImeMode cachedImeMode))
501
return Properties.
TryGetValue
(s_imeModeProperty, out ImeMode imeMode) && imeMode != DefaultImeMode;
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (5)
431
get => Properties.
TryGetValue
(s_propDropDownWidth, out int dropDownWidth) ? dropDownWidth : Width;
457
get => Properties.
TryGetValue
(s_propDropDownHeight, out int dropDownHeight) ? dropDownHeight : DefaultDropDownHeight;
584
return Properties.
TryGetValue
(s_propItemHeight, out int itemHeight) ? itemHeight : FontHeight + 2;
2306
if (Properties.
TryGetValue
(s_propDropDownWidth, out int dropDownWidth))
3841
if (!Properties.
TryGetValue
(s_propFlatComboAdapter, out FlatComboAdapter? comboAdapter) || !comboAdapter.IsValid(this))
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
2958
if (!Properties.
TryGetValue
(s_propToolTip, out ToolTip? toolTip))
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
5580
if (Properties.
TryGetValue
(s_propToolTip, out ToolTip? keyboardToolTip))
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (3)
85
if (!Properties.
TryGetValue
(s_propDefaultCellStyle, out DataGridViewCellStyle? style))
120
if (Properties.
TryGetValue
(s_propDefaultHeaderCellType, out Type? type))
228
if (Properties.
TryGetValue
(s_propHeaderCell, out DataGridViewHeaderCell? headerCell))
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (3)
89
if (!Properties.
TryGetValue
(s_propCellAccessibilityObject, out AccessibleObject? result))
622
if (!Properties.
TryGetValue
(s_propCellStyle, out DataGridViewCellStyle? dataGridViewCellStyle))
708
if (!Properties.
TryGetValue
(s_propCellValueType, out Type? cellValueType) && OwningColumn is not null)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (1)
160
get => Properties.
TryGetValue
(s_propForeColor, out Color color) ? color : Color.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
1086
if (!Properties.
TryGetValue
(s_propComboBoxCellItems, out ObjectCollection? items))
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.DataGridViewComboBoxCellAccessibleObject.cs (1)
45
if (Owner.Properties.
TryGetValue
(s_propComboBoxCellEditingComboBox, out DataGridViewComboBoxEditingControl? comboBox)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (3)
47
if (Properties.
TryGetValue
(s_propLinkCellActiveLinkColor, out Color color))
155
if (Properties.
TryGetValue
(s_propLinkCellLinkColor, out Color color))
292
if (Properties.
TryGetValue
(s_propLinkCellVisitedLinkColor, out Color color))
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
41
if (!Properties.
TryGetValue
(s_propRowAccessibilityObject, out AccessibleObject? result))
System\Windows\Forms\Controls\Labels\Label.cs (2)
487
if (!Properties.
TryGetValue
(s_propImageIndex, out LabelImageIndexer? imageIndexer))
856
if (animate == currentlyAnimating || !Properties.
TryGetValue
(s_propImage, out Image? image))
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2231
if (Properties.
TryGetValue
(s_propDelayedUpdateItems, out List<ListViewItem>? newItems))
4016
if (_updateCounter > 0 && Properties.
TryGetValue
(s_propDelayedUpdateItems, out List<ListViewItem>? itemList))
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (5)
382
if (Properties.
TryGetValue
(s_propBindingContext, out BindingContext? context))
1402
if (!IsDropDown && !IsDisposed && !Properties.
TryGetValue
(s_propToolStripPanelCell, out toolStripPanelCell))
1677
if (!Properties.
TryGetValue
(s_propToolTip, out ToolTip? toolTip))
1892
if (Properties.
TryGetValue
(s_propToolStripPanelCell, out ToolStripPanelCell? toolStripPanelCell))
1902
if (Properties.
TryGetValue
(s_propToolTip, out ToolTip? toolTip))
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (7)
195
if (!Properties.
TryGetValue
(s_accessibilityProperty, out AccessibleObject? accessibleObject))
1639
if (!Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft))
2941
if (!Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft) || rightToLeft == RightToLeft.Inherit)
2957
if (!Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft))
3090
if (Properties.
TryGetValue
(s_accessibilityProperty, out AccessibleObject? accessibleObject))
3358
if (!Properties.
TryGetValue
(s_rightToLeftProperty, out RightToLeft rightToLeft))
3635
internal bool TryGetExplicitlySetFont([NotNullWhen(true)] out Font? local) => Properties.
TryGetValue
(s_fontProperty, out local);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (1)
274
if (!Properties.
TryGetValue
(s_propToolStripPanelRowCollection, out ToolStripPanelRowCollection? rowCollection))
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
92
if (!Properties.
TryGetValue
(s_propControlsCollection, out ToolStripPanelRowControlCollection? controlsCollection))
System\Windows\Forms\Form.cs (23)
777
if (Properties.
TryGetValue
(s_propDialogOwner, out IWin32Window? dialogOwner))
1190
get => Properties.
TryGetValue
(s_propMaxTrackSize, out Size maximumSize) ? maximumSize : Size.Empty;
1303
get => Properties.
TryGetValue
(s_propMinTrackSize, out Size minimumSize) ? minimumSize : DefaultMinimumSize;
1617
public Form[] OwnedForms => Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms) ? ([.. ownedForms]) : ([]);
2906
if (!Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
3173
if (Properties.
TryGetValue
(s_propFormMdiParent, out Form? formMdiParent) && formMdiParent.MdiClient != value)
3558
if (Properties.
TryGetValue
(s_propOwner, out Form? owner))
3566
if (Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
3584
if (Properties.
TryGetValue
(s_propDummyMdiMenu, out HMENU dummyMenu))
4759
if (Properties.
TryGetValue
(s_propDefaultButton, out IButtonControl? button))
4772
if (Properties.
TryGetValue
(s_propCancelButton, out button))
4865
if (Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
4893
if (Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
4986
if (Properties.
TryGetValue
(s_propFormBorderColor, out Color? formBorderColor))
4991
if (Properties.
TryGetValue
(s_propFormCaptionBackColor, out Color? formCaptionBackColor))
4996
if (Properties.
TryGetValue
(s_propFormCaptionTextColor, out Color? formCaptionTextColor))
5002
if (Properties.
TryGetValue
(s_propFormCornerPreference, out FormCornerPreference? cornerPreference))
5028
if (Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
6108
if (Properties.
TryGetValue
(s_propOwner, out Form? owner))
6184
if (!Properties.
TryGetValue
(s_propDummyMdiMenu, out HMENU dummyMenu) || recreateMenu)
6721
if (Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
6790
if (Properties.
TryGetValue
(s_propOwnedForms, out List<Form>? ownedForms))
6927
if (Properties.
TryGetValue
(s_propFormMdiParent, out Form? formMdiParent))
System\Windows\Forms\Layout\CommonProperties.cs (7)
86
if (element.Properties.
TryGetValue
(s_marginProperty, out Padding padding))
99
if (element.Properties.
TryGetValue
(s_maximumSizeProperty, out Size size))
112
if (element.Properties.
TryGetValue
(s_minimumSizeProperty, out Size size))
135
if (element.Properties.
TryGetValue
(s_paddingProperty, out Padding padding))
152
element.Properties.
TryGetValue
(s_specifiedBoundsProperty, out Rectangle rectangle)
377
if (element.Properties.
TryGetValue
(s_preferredSizeCacheProperty, out Size size) && (size != LayoutUtils.s_invalidSize))
676
if (element.Properties.
TryGetValue
(s_layoutBoundsProperty, out Size size))
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
580
if (!Properties.
TryGetValue
(s_propAxContainer, out AxHost.AxContainer? container))
System\Windows\Forms\Layout\DefaultLayout.cs (3)
1006
if (container.Properties.
TryGetValue
(s_cachedBoundsProperty, out IDictionary? dictionary))
1035
if (!container.Properties.
TryGetValue
(s_cachedBoundsProperty, out IDictionary? dictionary))
1075
if (!container.Properties.
TryGetValue
(s_cachedBoundsProperty, out IDictionary? dictionary))
System\Windows\Forms\Layout\FlowLayout.cs (1)
283
!container.Properties.
TryGetValue
(s_wrapContentsProperty, out bool wrap) || wrap;
System\Windows\Forms\Layout\TableLayout.cs (2)
1352
if (!element.Properties.
TryGetValue
(s_layoutInfoProperty, out LayoutInfo? layoutInfo))
1377
if (!container.Properties.
TryGetValue
(s_containerInfoProperty, out ContainerInfo? containerInfo))
System\Windows\Forms\PropertyStore.cs (2)
102
/// <see cref="
TryGetValue
{T}(int, out T)"/> if <see langword="null"/> values are not allowed.
130
bool found =
TryGetValue
(key, out string? previous);
System.Windows.Forms.Tests (15)
System\Windows\Forms\PropertyStoreTests.cs (15)
40
store.
TryGetValue
(key, out object? outValue).Should().BeTrue();
63
store.
TryGetValue
(key, out object? outValue).Should().BeFalse();
72
store.
TryGetValue
(1, out FormWindowState outValue).Should().BeFalse();
82
store.
TryGetValue
(1, out Color outValue).Should().BeFalse();
92
store.
TryGetValue
(1, out int outValue).Should().BeFalse();
103
Action action = () => store.
TryGetValue
(1, out FormWindowState outValue);
113
Action action = () => store.
TryGetValue
(1, out Color outValue);
123
Action action = () => store.
TryGetValue
(1, out int outValue);
132
store.
TryGetValue
(1, out FormWindowState? outValue).Should().BeFalse();
141
store.
TryGetValue
(1, out Color? outValue).Should().BeFalse();
150
store.
TryGetValue
(1, out int? outValue).Should().BeFalse();
166
store.
TryGetValue
(1, out Rectangle result).Should().BeTrue();
179
store.
TryGetValue
(1, out Rectangle result).Should().BeTrue();
185
store.
TryGetValue
(1, out result).Should().BeTrue();
201
store.
TryGetValue
(1, out Padding result).Should().BeTrue();