-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
Closes #1271
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ImageCollectionEditor))] | ||
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ImageIndexEditor))] | ||
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.ListControlStringCollectionEditor))] | ||
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.StringArrayEditor))] | ||
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.StringCollectionEditor))] | ||
[assembly: TypeForwardedTo(typeof(System.Windows.Forms.Design.TabPageCollectionEditor))] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.ComponentModel; | ||
|
||
namespace System.Windows.Forms.Design | ||
{ | ||
/// <summary> | ||
/// The ListControlStringCollectionEditor override StringCollectionEditor | ||
/// to prevent the string collection from being edited if a DataSource | ||
/// has been set on the control. | ||
/// </summary> | ||
internal class ListControlStringCollectionEditor : StringCollectionEditor | ||
{ | ||
public ListControlStringCollectionEditor(Type type) : base(type) | ||
{ | ||
} | ||
|
||
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) | ||
{ | ||
// If we're trying to edit the items in an object that has a DataSource set, throw an exception | ||
ListControl control = context.Instance as ListControl; | ||
if (control?.DataSource != null) | ||
{ | ||
throw new ArgumentException(SR.DataSourceLocksItems); | ||
} | ||
|
||
return base.EditValue(context, provider, value); | ||
} | ||
} | ||
} |