68 references to DataSourceUpdateMode
DesignSurface (1)
MainForm.cs (1)
367
richTextBox.DataBindings.Add(new Binding("Text", bindingSource, "Text", true,
DataSourceUpdateMode
.OnPropertyChanged));
System.Windows.Forms (16)
System\Windows\Forms\DataBinding\Binding.cs (9)
86
DataSourceUpdateMode
dataSourceUpdateMode)
104
DataSourceUpdateMode
dataSourceUpdateMode,
123
DataSourceUpdateMode
dataSourceUpdateMode,
143
DataSourceUpdateMode
dataSourceUpdateMode,
424
[DefaultValue(
DataSourceUpdateMode
.OnValidation)]
425
public
DataSourceUpdateMode
DataSourceUpdateMode { get; set; } =
DataSourceUpdateMode
.OnValidation;
858
if (DataSourceUpdateMode ==
DataSourceUpdateMode
.Never)
1099
if (DataSourceUpdateMode ==
DataSourceUpdateMode
.OnPropertyChanged)
System\Windows\Forms\DataBinding\ControlBindingsCollection.cs (6)
91
DataSourceUpdateMode
updateMode) =>
107
DataSourceUpdateMode
updateMode,
124
DataSourceUpdateMode
updateMode,
142
DataSourceUpdateMode
updateMode,
223
public
DataSourceUpdateMode
DefaultDataSourceUpdateMode { get; set; } =
DataSourceUpdateMode
.OnValidation;
System\Windows\Forms\DataBinding\ListBindingConverter.cs (1)
24
s_ctorTypes ??= [typeof(string), typeof(object), typeof(string), typeof(bool), typeof(
DataSourceUpdateMode
), typeof(object), typeof(string), typeof(IFormatProvider)];
System.Windows.Forms.Tests (51)
System\Windows\Forms\BindingTests.cs (25)
32
Assert.Equal(
DataSourceUpdateMode
.OnValidation, binding.DataSourceUpdateMode);
61
Assert.Equal(
DataSourceUpdateMode
.OnValidation, binding.DataSourceUpdateMode);
72
yield return new object[] { null, null, null, true,
DataSourceUpdateMode
.OnValidation };
73
yield return new object[] { string.Empty, new(), string.Empty, true,
DataSourceUpdateMode
.OnValidation - 1 };
74
yield return new object[] { "propertyName", new(), "dataMember", false,
DataSourceUpdateMode
.Never };
75
yield return new object[] { "propertyName", new(), "dataMember.subDataMember", false,
DataSourceUpdateMode
.Never + 1 };
80
public void Binding_Ctor_String_Object_String_Bool_DataSourceUpdateMode(string propertyName, object dataSource, string dataMember, bool formattingEnabled,
DataSourceUpdateMode
dataSourceUpdateMode)
101
yield return new object[] { null, null, null, true,
DataSourceUpdateMode
.OnValidation, null };
102
yield return new object[] { string.Empty, new(), string.Empty, true,
DataSourceUpdateMode
.OnValidation - 1, DBNull.Value };
103
yield return new object[] { "propertyName", new(), "dataMember", false,
DataSourceUpdateMode
.Never, new() };
104
yield return new object[] { "propertyName", new(), "dataMember.subDataMember", false,
DataSourceUpdateMode
.Never + 1, new() };
109
public void Binding_Ctor_String_Object_String_Bool_DataSourceUpdateMode_Object(string propertyName, object dataSource, string dataMember, bool formattingEnabled,
DataSourceUpdateMode
dataSourceUpdateMode, object nullValue)
130
yield return new object[] { null, null, null, true,
DataSourceUpdateMode
.OnValidation, null, null };
131
yield return new object[] { string.Empty, new(), string.Empty, true,
DataSourceUpdateMode
.OnValidation - 1, DBNull.Value, string.Empty };
132
yield return new object[] { "propertyName", new(), "dataMember", false,
DataSourceUpdateMode
.Never, new(), "formatString" };
133
yield return new object[] { "propertyName", new(), "dataMember.subDataMember", false,
DataSourceUpdateMode
.Never + 1, new(), "formatString" };
138
public void Binding_Ctor_String_Object_String_Bool_DataSourceUpdateMode_Object_String(string propertyName, object dataSource, string dataMember, bool formattingEnabled,
DataSourceUpdateMode
dataSourceUpdateMode, object nullValue, string formatString)
159
yield return new object[] { null, null, null, true,
DataSourceUpdateMode
.OnValidation, null, null, null };
160
yield return new object[] { string.Empty, new(), string.Empty, true,
DataSourceUpdateMode
.OnValidation - 1, DBNull.Value, string.Empty, CultureInfo.CurrentCulture };
161
yield return new object[] { "propertyName", new(), "dataMember", false,
DataSourceUpdateMode
.Never, new(), "formatString", CultureInfo.InvariantCulture };
162
yield return new object[] { "propertyName", new(), "dataMember.subDataMember", false,
DataSourceUpdateMode
.Never + 1, new(), "formatString", CultureInfo.CurrentCulture };
167
public void Binding_Ctor_String_Object_String_Bool_DataSourceUpdateMode_Object_String_IFormatProvider(string propertyName, object dataSource, string dataMember, bool formattingEnabled,
DataSourceUpdateMode
dataSourceUpdateMode, object nullValue, string formatString, IFormatProvider formatInfo)
225
[EnumData<
DataSourceUpdateMode
>]
226
[InvalidEnumData<
DataSourceUpdateMode
>]
227
public void Binding_DataSourceUpdateMode_Set_GetReturnsExpected(
DataSourceUpdateMode
value)
System\Windows\Forms\ControlBindingsCollectionTests.cs (26)
29
Assert.Equal(
DataSourceUpdateMode
.OnValidation, collection.DefaultDataSourceUpdateMode);
34
[EnumData<
DataSourceUpdateMode
>]
35
[InvalidEnumData<
DataSourceUpdateMode
>]
36
public void DefaultDataSourceUpdateMode_Set_GetReturnsExpected(
DataSourceUpdateMode
value)
132
Assert.Equal(
DataSourceUpdateMode
.OnValidation, binding.DataSourceUpdateMode);
149
Assert.Equal(
DataSourceUpdateMode
.OnValidation, binding.DataSourceUpdateMode);
160
Binding binding = collection.Add(nameof(Control.Text), 1, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged);
166
Assert.Equal(
DataSourceUpdateMode
.OnPropertyChanged, binding.DataSourceUpdateMode);
177
Binding binding = collection.Add(nameof(Control.Text), 1, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null");
183
Assert.Equal(
DataSourceUpdateMode
.OnPropertyChanged, binding.DataSourceUpdateMode);
194
Binding binding = collection.Add(nameof(Control.Text), 1, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString");
200
Assert.Equal(
DataSourceUpdateMode
.OnPropertyChanged, binding.DataSourceUpdateMode);
211
Binding binding = collection.Add(nameof(Control.Text), 1, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture);
217
Assert.Equal(
DataSourceUpdateMode
.OnPropertyChanged, binding.DataSourceUpdateMode);
230
Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged));
231
Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null"));
232
Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString"));
233
Assert.Throws<ArgumentNullException>("dataSource", () => collection.Add("propertyName", null, "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));
244
Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged));
245
Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null"));
246
Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString"));
247
Assert.Throws<ArgumentException>("PropertyName", () => collection.Add("NoSuchProperty", new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));
261
Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged));
262
Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null"));
263
Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString"));
264
Assert.Throws<ArgumentException>("binding", () => collection.Add(nameof(Control.Text), new object(), "dataMember", true,
DataSourceUpdateMode
.OnPropertyChanged, "null", "formatString", CultureInfo.CurrentCulture));