Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / DataFieldEditor.cs / 1 / DataFieldEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI.Design.WebControls { using System; using System.Collections; using Microsoft.Win32; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; ////// /// The DataFieldEditor is a collection editor that is specifically /// designed to edit arrays containing strings. /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] internal class DataFieldEditor : DataFieldCollectionEditor { public DataFieldEditor(Type type) : base(type) { } ////// /// Retrieves the data type this collection contains. The default /// implementation looks inside of the collection for the Item property /// and returns the returning datatype of the item. Do not call this /// method directly. Instead, use the CollectionItemType property. Use this /// method to override the default implementation. /// protected override Type CreateCollectionItemType() { return CollectionType.GetElementType(); } ////// /// We implement the getting and setting of items on this collection. /// protected override object[] GetItems(object editValue) { if (editValue is Array) { Array valueArray = (Array)editValue; object[] items = new object[valueArray.GetLength(0)]; Array.Copy(valueArray, items, items.Length); return items; } else { return new object[0]; } } ////// /// We implement the getting and setting of items on this collection. /// It should return an instance to replace editValue with, or editValue /// if there is no need to replace the instance. /// protected override object SetItems(object editValue, object[] value) { if (editValue is Array || editValue == null) { Array newArray = Array.CreateInstance(CollectionItemType, value.Length); Array.Copy(value, newArray, value.Length); return newArray; } return editValue; } } } // 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
- XmlSchemaResource.cs
- validationstate.cs
- GroupDescription.cs
- EventHandlersStore.cs
- PreviewPrintController.cs
- WebConfigurationHostFileChange.cs
- TrimSurroundingWhitespaceAttribute.cs
- ConsumerConnectionPointCollection.cs
- SparseMemoryStream.cs
- TreeNode.cs
- ByteStorage.cs
- MouseOverProperty.cs
- UserPersonalizationStateInfo.cs
- Dump.cs
- ScriptRegistrationManager.cs
- DockPatternIdentifiers.cs
- selecteditemcollection.cs
- OletxEnlistment.cs
- EmptyEnumerable.cs
- WebPartCollection.cs
- bidPrivateBase.cs
- ThreadSafeList.cs
- GZipDecoder.cs
- Simplifier.cs
- Int16AnimationBase.cs
- MouseButtonEventArgs.cs
- WebPartChrome.cs
- AutomationPropertyInfo.cs
- TemplateControlParser.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- CodeDOMUtility.cs
- ValidationHelper.cs
- DocumentXmlWriter.cs
- TransformProviderWrapper.cs
- DelegateArgument.cs
- DataGridView.cs
- EditModeSwitchButton.cs
- Avt.cs
- XmlImplementation.cs
- StructuredCompositeActivityDesigner.cs
- UpdateRecord.cs
- MailMessageEventArgs.cs
- AccessControlEntry.cs
- PackWebResponse.cs
- Point4D.cs
- PerformanceCounterPermissionAttribute.cs
- MsmqChannelFactoryBase.cs
- OdbcFactory.cs
- SplitterPanelDesigner.cs
- ACE.cs
- CodeVariableDeclarationStatement.cs
- TemplatedEditableDesignerRegion.cs
- WindowsGraphicsCacheManager.cs
- PreviewPrintController.cs
- Vector3D.cs
- EventWaitHandle.cs
- DiscoveryOperationContext.cs
- StreamSecurityUpgradeAcceptor.cs
- WebBrowserNavigatingEventHandler.cs
- OleDbException.cs
- RequestQueue.cs
- PlainXmlDeserializer.cs
- TypeUtils.cs
- BitmapSizeOptions.cs
- DelegateBodyWriter.cs
- Win32.cs
- MethodAccessException.cs
- DbCommandTree.cs
- PropertyRecord.cs
- WebPartConnectionsDisconnectVerb.cs
- _SslState.cs
- CallContext.cs
- SerializationSectionGroup.cs
- DurableInstanceProvider.cs
- PropertyStore.cs
- Font.cs
- KeyValueConfigurationElement.cs
- RecipientInfo.cs
- GeneratedView.cs
- SingleObjectCollection.cs
- ObjectDataSourceView.cs
- CardSpaceSelector.cs
- WindowsBrush.cs
- XmlDocumentType.cs
- CqlLexerHelpers.cs
- DataAdapter.cs
- EtwTrackingBehaviorElement.cs
- RefreshEventArgs.cs
- ResourceDescriptionAttribute.cs
- XmlTextAttribute.cs
- CollectionTypeElement.cs
- SecurityElement.cs
- EdmTypeAttribute.cs
- parserscommon.cs
- StatusBar.cs
- UTF7Encoding.cs
- SqlDataSourceCommandEventArgs.cs
- LinqExpressionNormalizer.cs
- _NestedSingleAsyncResult.cs
- TypeDelegator.cs