161 references to GetValueOrDefault
System.Windows.Forms (145)
System\Windows\Forms\Control.cs (27)
451return Properties.GetValueOrDefault( 472return Properties.GetValueOrDefault( 546get => Properties.GetValueOrDefault<string>(s_accessibleDefaultActionProperty); 559get => Properties.GetValueOrDefault<string>(s_accessibleDescriptionProperty); 572get => Properties.GetValueOrDefault<string>(s_accessibleNameProperty); 584get => Properties.GetValueOrDefault(s_accessibleRoleProperty, AccessibleRole.Default); 722get => Properties.GetValueOrDefault(s_autoScrollOffsetProperty, Point.Empty); 909get => Properties.GetValueOrDefault<Image>(s_backgroundImageProperty); 939get => Properties.GetValueOrDefault(s_backgroundImageLayoutProperty, ImageLayout.Tile); 999Properties.GetValueOrDefault<ControlBindingsCollection>(s_bindingsProperty)?.Clear(); 1180int cacheTextCounter = Properties.GetValueOrDefault<int>(s_cacheTextCountProperty); 1193int cacheTextCounter = Properties.GetValueOrDefault<int>(s_cacheTextCountProperty); 1210_text = Properties.GetValueOrDefault<string?>(s_cacheTextFieldProperty); 1300get => Properties.GetValueOrDefault<ContextMenuStrip>(s_contextMenuStripProperty); 1550Cursor? localCursor = Properties.GetValueOrDefault<Cursor>(s_cursorProperty); 1881Font? previous = Properties.GetValueOrDefault<Font>(s_fontProperty); 2009fontHandle = Properties.GetValueOrDefault<FontHandleWrapper?>(s_fontHandleWrapperProperty); 2664string? name = Properties.GetValueOrDefault<string>(s_namePropertyProperty); 2734internal Color RawBackColor => Properties.GetValueOrDefault<Color>(s_backColorProperty); 2784get => Properties.GetValueOrDefault<Region>(s_regionProperty); 3178get => Properties.GetValueOrDefault<object>(s_userDataProperty); 4796Properties.GetValueOrDefault<ActiveXImpl>(s_activeXImplProperty)?.Dispose(); 6972Color backColor = Properties.GetValueOrDefault<Color>(s_backColorProperty); 7008if (Equals(Properties.GetValueOrDefault<object>(s_dataContextProperty), Parent?.DataContext)) 7102Color foreColor = Properties.GetValueOrDefault<Color>(s_foreColorProperty); 10540Color backColor = Properties.GetValueOrDefault<Color>(s_backColorProperty); 10560internal virtual bool ShouldSerializeForeColor() => !Properties.GetValueOrDefault<Color>(s_foreColorProperty).IsEmpty;
System\Windows\Forms\Control.Ime.cs (3)
110int val = Properties.GetValueOrDefault<int>(s_disableImeModeChangedCountProperty); 231get => Properties.GetValueOrDefault<int>(s_imeWmCharsToIgnoreProperty); 250get => Properties.GetValueOrDefault(s_lastCanEnableImeProperty, true);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (6)
410get => Properties.GetValueOrDefault(s_propDrawMode, DrawMode.Normal); 436if (Properties.GetValueOrDefault<int>(s_propDropDownWidth) != value) 462if (Properties.GetValueOrDefault<int>(s_propDropDownHeight) != value) 599if (Properties.GetValueOrDefault<int>(s_propItemHeight) != value) 684return Properties.GetValueOrDefault<int>(s_propMaxLength); 1044get => Properties.GetValueOrDefault(s_propStyle, ComboBoxStyle.DropDown);
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (4)
58get => Properties.GetValueOrDefault<ContextMenuStrip>(s_propContextMenuStrip); 173get => Properties.GetValueOrDefault<int>(s_propDividerThickness); 262DataGridViewHeaderCell? priorValue = Properties.GetValueOrDefault<DataGridViewHeaderCell?>(s_propHeaderCell); 596get => Properties.GetValueOrDefault<object?>(s_propUserData);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (3)
40get => Properties.GetValueOrDefault(s_propButtonCellState, ButtonState.Normal); 60get => Properties.GetValueOrDefault(s_propButtonCellFlatStyle, FlatStyle.Standard); 91get => Properties.GetValueOrDefault<bool>(s_propButtonCellUseColumnTextForButtonValue);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (5)
116get => Properties.GetValueOrDefault<ContextMenuStrip>(s_propCellContextMenuStrip); 658get => Properties.GetValueOrDefault<object?>(s_propCellTag); 1542string? objErrorText = Properties.GetValueOrDefault<string>(s_propCellErrorText); 2432return Properties.GetValueOrDefault<object>(s_propCellValue); 2443return Properties.GetValueOrDefault<object>(s_propCellValue);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (9)
69get => Properties.GetValueOrDefault(s_propAlignment, DataGridViewContentAlignment.NotSet); 109get => Properties.GetValueOrDefault<Color>(s_propBackColor); 145get => Properties.GetValueOrDefault<Font>(s_propFont); 193get => Properties.GetValueOrDefault<IFormatProvider>(s_propFormatProvider) ?? Globalization.CultureInfo.CurrentCulture; 263get => Properties.GetValueOrDefault<Padding>(s_propPadding); 309get => Properties.GetValueOrDefault<Color>(s_propSelectionBackColor); 323get => Properties.GetValueOrDefault<Color>(s_propSelectionForeColor); 338get => Properties.GetValueOrDefault<object?>(s_propTag); 346get => Properties.GetValueOrDefault(s_propWrapMode, DataGridViewTriState.NotSet);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (5)
182get => Properties.GetValueOrDefault(s_propButtonCellState, ButtonState.Normal); 209get => Properties.GetValueOrDefault<object?>(s_propFalseValue); 235get => Properties.GetValueOrDefault(s_propFlatStyle, FlatStyle.Standard); 264get => Properties.GetValueOrDefault<object?>(s_propIndeterminateValue); 362get => Properties.GetValueOrDefault<object?>(s_propTrueValue);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (1)
791get => Properties.GetValueOrDefault<Type>(s_propDataGridViewColumnValueType);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (11)
132get => Properties.GetValueOrDefault<object>(s_propComboBoxCellDataSource); 226get => Properties.GetValueOrDefault<PropertyDescriptor?>(s_propComboBoxCellDisplayMemberProp); 233get => Properties.GetValueOrDefault(s_propComboBoxCellDisplayStyle, DataGridViewComboBoxDisplayStyle.DropDownButton); 269get => Properties.GetValueOrDefault<bool>(s_propComboBoxCellDisplayStyleForCurrentCellOnly); 318get => Properties.GetValueOrDefault(s_propComboBoxCellDropDownWidth, 1); 336get => Properties.GetValueOrDefault<DataGridViewComboBoxEditingControl?>(s_propComboBoxCellEditingComboBox); 346get => Properties.GetValueOrDefault(s_propComboBoxCellFlatStyle, FlatStyle.Standard); 378get => Properties.GetValueOrDefault(s_propComboBoxCellMaxDropDownItems, DefaultMaxDropDownItems); 447get => Properties.GetValueOrDefault<DataGridViewComboBoxColumn>(s_propComboBoxCellColumnTemplate); 482get => Properties.GetValueOrDefault<PropertyDescriptor?>(s_propComboBoxCellValueMemberProp); 792CurrencyManager? cm = Properties.GetValueOrDefault<CurrencyManager?>(s_propComboBoxCellDataManager);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (4)
31get => Properties.GetValueOrDefault(s_propButtonState, ButtonState.Normal); 80get => Properties.GetValueOrDefault<Bitmap?>(s_propFlipXPThemesBitmap); 157get => Properties.GetValueOrDefault<Type?>(s_propValueType, s_defaultValueType); 425return Properties.GetValueOrDefault<object>(s_propCellValue);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
98get => Properties.GetValueOrDefault(s_propImageCellLayout, DataGridViewImageCellLayout.Normal);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
117get => Properties.GetValueOrDefault(s_propLinkCellLinkBehavior, LinkBehavior.SystemDefault); 206get => Properties.GetValueOrDefault(s_propLinkCellLinkState, LinkState.Normal); 241get => Properties.GetValueOrDefault(s_propLinkCellTrackVisitedState, true); 272get => Properties.GetValueOrDefault<bool>(s_propLinkCellUseColumnTextForLinkValue);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
570return Properties.GetValueOrDefault<object?>(s_propCellValue);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (2)
51get => Properties.GetValueOrDefault<DataGridViewTextBoxEditingControl?>(s_propTextBoxCellEditingTextBox); 67get => Properties.GetValueOrDefault(s_propTextBoxCellMaxInputLength, MaxInputLengthDefault);
System\Windows\Forms\Controls\Labels\Label.cs (4)
372Image? image = Properties.GetValueOrDefault<Image>(s_propImage); 507get => Properties.GetValueOrDefault<ImageList>(s_propImageList); 552get => Properties.GetValueOrDefault(s_propImageAlign, ContentAlignment.MiddleCenter); 696get => Properties.GetValueOrDefault(s_propTextAlign, ContentAlignment.TopLeft);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1693ToolStripTextDirection textDirection = Properties.GetValueOrDefault(s_propTextDirection, ToolStripTextDirection.Horizontal);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
568get => Properties.GetValueOrDefault(s_propOpacity, 1.0d); 753get => Properties.GetValueOrDefault<Control>(s_propSourceControl);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (22)
214get => Properties.GetValueOrDefault<string>(s_accessibleDefaultActionDescriptionProperty); 231get => Properties.GetValueOrDefault<string>(s_accessibleDescriptionProperty); 248get => Properties.GetValueOrDefault<string>(s_accessibleNameProperty); 264get => Properties.GetValueOrDefault(s_accessibleRoleProperty, AccessibleRole.Default); 390get => Properties.GetValueOrDefault<Image>(s_backgroundImageProperty); 489get => Properties.GetValueOrDefault(s_backgroundImageLayoutProperty, ImageLayout.Tile); 863Color foreColor = Properties.GetValueOrDefault<Color>(s_foreColorProperty); 1025Image? image = Properties.GetValueOrDefault<Image>(s_imageProperty); 1196Color color = Properties.GetValueOrDefault<Color>(s_foreColorProperty); 1284get => Properties.GetValueOrDefault(s_mergeActionProperty, MergeAction.Append); 1300get => Properties.GetValueOrDefault(s_mergeIndexProperty, -1); 1386get => WindowsFormsUtils.GetComponentName(this, Properties.GetValueOrDefault<string>(s_nameProperty)); 1556Image? image = Properties.GetValueOrDefault<Image>(s_imageProperty); 1609internal Color RawBackColor => Properties.GetValueOrDefault(s_backColorProperty, Color.Empty); 1725return Properties.GetValueOrDefault<Image>(s_mirroredImageProperty); 1845get => Properties.GetValueOrDefault<object>(s_tagProperty); 1904ToolStripTextDirection textDirection = Properties.GetValueOrDefault(s_textDirectionProperty, ToolStripTextDirection.Inherit); 2883Color backColor = Properties.GetValueOrDefault<Color>(s_backColorProperty); 2931Color foreColor = Properties.GetValueOrDefault<Color>(s_foreColorProperty); 2972ToolStripTextDirection textDirection = Properties.GetValueOrDefault(s_textDirectionProperty, ToolStripTextDirection.Inherit); 3290Color backColor = Properties.GetValueOrDefault<Color>(s_backColorProperty); 3304Color foreColor = Properties.GetValueOrDefault<Color>(s_foreColorProperty);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (3)
302get => Properties.GetValueOrDefault(s_propCheckState, CheckState.Unchecked); 359get => Properties.GetValueOrDefault(s_propShortcutKeys, Keys.None); 480internal Form? MdiForm => Properties.GetValueOrDefault<Form>(s_propMdiForm);
System\Windows\Forms\Form.cs (23)
219get => Properties.GetValueOrDefault<IButtonControl?>(s_propAcceptButton); 334get => Properties.GetValueOrDefault<Form>(s_propActiveMdiChild); 342get => Properties.GetValueOrDefault<Form>(s_propFormerlyActiveMdiChild); 711get => Properties.GetValueOrDefault<IButtonControl>(s_propCancelButton); 801Form? formMdiParent = Properties.GetValueOrDefault<Form>(s_propFormMdiParent); 1077get => Properties.GetValueOrDefault<bool>(s_propMdiChildFocusable); 1159get => Properties.GetValueOrDefault<Rectangle>(s_propMaximizedBounds); 1261get => Properties.GetValueOrDefault<MenuStrip>(s_propMainMenuStrip); 1453get => Properties.GetValueOrDefault<Form>(s_propFormMdiParent); 1456Form? formMdiParent = Properties.GetValueOrDefault<Form>(s_propFormMdiParent); 1525get => Properties.GetValueOrDefault<MdiWindowListStrip>(s_propMdiWindowListStrip); 1531get => Properties.GetValueOrDefault<MdiControlStrip>(s_propMdiControlStrip); 1570get => Properties.GetValueOrDefault(s_propOpacity, 1.0d); 1657internal Form? OwnerInternal => Properties.GetValueOrDefault<Form?>(s_propOwner); 1762get => Properties.GetValueOrDefault(s_propFormScreenCaptureMode, ScreenCaptureMode.Allow); 2084get => Properties.GetValueOrDefault(s_propTransparencyKey, Color.Empty); 2267get => Properties.GetValueOrDefault(s_propFormCornerPreference, FormCornerPreference.Default); 2359get => Properties.GetValueOrDefault(s_propFormBorderColor, Color.Empty); 2421get => Properties.GetValueOrDefault(s_propFormCaptionBackColor, Color.Empty); 2484get => Properties.GetValueOrDefault(s_propFormCaptionTextColor, Color.Empty); 3360Form? form = Properties.GetValueOrDefault<Form>(s_propFormMdiParent); 3733IWin32Window? dialogOwner = Properties.GetValueOrDefault<IWin32Window>(s_propDialogOwner); 5359IButtonControl? existing = Properties.GetValueOrDefault<IButtonControl>(s_propDefaultButton);
System\Windows\Forms\Layout\CommonProperties.cs (1)
723element.Properties.GetValueOrDefault<BitVector32>(s_layoutStateProperty);
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
571private void AxContainerFormCreated() => Properties.GetValueOrDefault<AxHost.AxContainer>(s_propAxContainer)?.FormCreated();
System\Windows\Forms\Layout\DefaultLayout.cs (1)
1085element.Properties.GetValueOrDefault<AnchorInfo>(s_layoutInfoProperty);
System\Windows\Forms\Layout\FlowLayout.cs (1)
293container.Properties.GetValueOrDefault<FlowDirection>(s_flowDirectionProperty);
System.Windows.Forms.Tests (16)
System\Windows\Forms\PropertyStoreTests.cs (16)
238value.Should().Be(store.GetValueOrDefault<bool>(1)); 248value.Should().Be(store.GetValueOrDefault<byte>(1)); 258value.Should().Be(store.GetValueOrDefault<sbyte>(1)); 268value.Should().Be(store.GetValueOrDefault<char>(1)); 278value.Should().Be(store.GetValueOrDefault<decimal>(1)); 288value.Should().Be(store.GetValueOrDefault<double>(1)); 298value.Should().Be(store.GetValueOrDefault<float>(1)); 308value.Should().Be(store.GetValueOrDefault<int>(1)); 318value.Should().Be(store.GetValueOrDefault<uint>(1)); 328value.Should().Be(store.GetValueOrDefault<long>(1)); 338value.Should().Be(store.GetValueOrDefault<ulong>(1)); 348value.Should().Be(store.GetValueOrDefault<short>(1)); 358value.Should().Be(store.GetValueOrDefault<ushort>(1)); 368value.Should().Be(store.GetValueOrDefault<object>(1)); 378value.Should().Be(store.GetValueOrDefault<Color>(1)); 388value.Should().Be(store.GetValueOrDefault<FormWindowState>(1));