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
- Base64Stream.cs
- RegisteredArrayDeclaration.cs
- ResourceReferenceExpression.cs
- ActionMessageFilterTable.cs
- PasswordPropertyTextAttribute.cs
- XmlILStorageConverter.cs
- OdbcCommand.cs
- MethodCallTranslator.cs
- ProfilePropertyNameValidator.cs
- DataSourceConverter.cs
- WindowsFont.cs
- StylusPoint.cs
- Cell.cs
- ConfigurationException.cs
- X509ClientCertificateCredentialsElement.cs
- EqualityComparer.cs
- XmlStreamStore.cs
- CompatibleComparer.cs
- EncoderFallback.cs
- Part.cs
- ReaderContextStackData.cs
- CodeTypeOfExpression.cs
- Style.cs
- ScriptingAuthenticationServiceSection.cs
- DataServiceQueryProvider.cs
- SecureStringHasher.cs
- XmlValueConverter.cs
- QueuePropertyVariants.cs
- ComplexLine.cs
- Line.cs
- LineGeometry.cs
- ValueSerializerAttribute.cs
- TreeBuilderBamlTranslator.cs
- ScrollChrome.cs
- Transactions.cs
- DataGridCell.cs
- StringAnimationBase.cs
- RenderDataDrawingContext.cs
- TablePatternIdentifiers.cs
- ExpressionVisitorHelpers.cs
- PropertyGridCommands.cs
- SHA256.cs
- Quad.cs
- PolyLineSegment.cs
- GridViewColumnHeader.cs
- QuotedStringWriteStateInfo.cs
- UidPropertyAttribute.cs
- RayMeshGeometry3DHitTestResult.cs
- MD5CryptoServiceProvider.cs
- EventBuilder.cs
- PixelShader.cs
- metadatamappinghashervisitor.cs
- MsmqIntegrationProcessProtocolHandler.cs
- MultiPropertyDescriptorGridEntry.cs
- ADConnectionHelper.cs
- DefaultMergeHelper.cs
- PlainXmlDeserializer.cs
- TextBlock.cs
- WebEventTraceProvider.cs
- SamlDoNotCacheCondition.cs
- SafeUserTokenHandle.cs
- DNS.cs
- x509store.cs
- ToolStripLabel.cs
- BatchStream.cs
- DbConnectionPoolOptions.cs
- OleDbConnection.cs
- ComponentDispatcher.cs
- Converter.cs
- _FixedSizeReader.cs
- LinqExpressionNormalizer.cs
- XPathSingletonIterator.cs
- Claim.cs
- ColumnHeader.cs
- BlurEffect.cs
- ExpressionEditorAttribute.cs
- CustomActivityDesigner.cs
- GridViewRow.cs
- NextPreviousPagerField.cs
- WebConfigurationHostFileChange.cs
- ProviderMetadata.cs
- CompositionAdorner.cs
- GeometryDrawing.cs
- Group.cs
- TypeListConverter.cs
- OutputCacheProfile.cs
- EncodingTable.cs
- TraceHwndHost.cs
- GroupStyle.cs
- SatelliteContractVersionAttribute.cs
- UnsafeNativeMethods.cs
- Control.cs
- GenerateHelper.cs
- RevocationPoint.cs
- ProxyHelper.cs
- RemotingException.cs
- MetadataSerializer.cs
- DesignerSerializationOptionsAttribute.cs
- HttpRequestTraceRecord.cs
- ConversionHelper.cs