Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / ListControlStringCollectionEditor.cs / 1 / ListControlStringCollectionEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.ListControlStringCollectionEditor..ctor(System.Type)")] namespace System.Windows.Forms.Design { using System.Design; using System.ComponentModel; using System; using System.Collections; using Microsoft.Win32; using System.ComponentModel.Design; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; ////// /// The ListControlStringCollectionEditor override StringCollectionEditor /// to prevent the string collection from being edited if a DataSource /// has been set on the control. /// 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 != null && control.DataSource != null) { throw new ArgumentException(SR.GetString(SR.DataSourceLocksItems)); } return base.EditValue(context, provider, value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlServices.cs
- NullReferenceException.cs
- ClickablePoint.cs
- ButtonFieldBase.cs
- EntityKeyElement.cs
- TextureBrush.cs
- XmlSchemaException.cs
- OneOfConst.cs
- basecomparevalidator.cs
- WebRequestModulesSection.cs
- StreamingContext.cs
- Vector3D.cs
- PropertyRecord.cs
- Application.cs
- ProfileService.cs
- _ConnectionGroup.cs
- BaseDataList.cs
- SafeNativeMethods.cs
- DesignSurfaceServiceContainer.cs
- HiddenFieldPageStatePersister.cs
- ClientCultureInfo.cs
- CompositeScriptReferenceEventArgs.cs
- FrameworkReadOnlyPropertyMetadata.cs
- _BaseOverlappedAsyncResult.cs
- Thumb.cs
- WindowsHyperlink.cs
- Margins.cs
- TabControlEvent.cs
- ModelTreeManager.cs
- VersionedStreamOwner.cs
- DesignerAdRotatorAdapter.cs
- SqlDataSourceCache.cs
- IntegrationExceptionEventArgs.cs
- TypedElement.cs
- CompositeDataBoundControl.cs
- hwndwrapper.cs
- SetterTriggerConditionValueConverter.cs
- XmlMembersMapping.cs
- DispatcherHookEventArgs.cs
- TaskHelper.cs
- TextSpan.cs
- SqlVersion.cs
- DataTableNewRowEvent.cs
- DeclarativeCatalogPart.cs
- DocumentSchemaValidator.cs
- WebHttpSecurity.cs
- Set.cs
- BufferModesCollection.cs
- DivideByZeroException.cs
- MarkupCompiler.cs
- CellPartitioner.cs
- ParsedAttributeCollection.cs
- PageParserFilter.cs
- ThrowHelper.cs
- ReflectionTypeLoadException.cs
- PropertyMetadata.cs
- StyleModeStack.cs
- sqlstateclientmanager.cs
- PartialList.cs
- HashCodeCombiner.cs
- ExtensionFile.cs
- MetaDataInfo.cs
- BaseAutoFormat.cs
- EntityDataSourceContextCreatedEventArgs.cs
- ToggleButton.cs
- Models.cs
- ReadOnlyTernaryTree.cs
- ExcludePathInfo.cs
- ArrayConverter.cs
- DataBoundControl.cs
- NamedPermissionSet.cs
- BrowserCapabilitiesCodeGenerator.cs
- XdrBuilder.cs
- SqlExpressionNullability.cs
- RowParagraph.cs
- ManageRequest.cs
- DotAtomReader.cs
- HierarchicalDataBoundControl.cs
- AssemblyResourceLoader.cs
- HttpConfigurationSystem.cs
- ThreadStartException.cs
- DbParameterCollection.cs
- EntityDataSourceSelectedEventArgs.cs
- RuleElement.cs
- BroadcastEventHelper.cs
- SqlDataSource.cs
- LinkLabel.cs
- DataGrid.cs
- SerializationFieldInfo.cs
- RectConverter.cs
- ItemAutomationPeer.cs
- ListItemCollection.cs
- XmlWriterTraceListener.cs
- CollectionViewProxy.cs
- InternalEnumValidator.cs
- LocalizabilityAttribute.cs
- SamlAssertionKeyIdentifierClause.cs
- ContextMenuStrip.cs
- Int64Converter.cs
- PersonalizationAdministration.cs