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