Code:
/ FX-1434 / FX-1434 / 1.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
- InvalidOleVariantTypeException.cs
- CustomWebEventKey.cs
- SqlWriter.cs
- AmbientProperties.cs
- Point3DValueSerializer.cs
- FrameworkElementAutomationPeer.cs
- BlurEffect.cs
- WebDescriptionAttribute.cs
- ClockController.cs
- Oid.cs
- XsdBuilder.cs
- ButtonChrome.cs
- StrongNameUtility.cs
- DSASignatureDeformatter.cs
- SqlAliaser.cs
- DataObject.cs
- ProtocolsSection.cs
- AmbientProperties.cs
- CngAlgorithmGroup.cs
- MessagingActivityHelper.cs
- BrowserDefinitionCollection.cs
- DataSourceGeneratorException.cs
- TableSectionStyle.cs
- TextInfo.cs
- GestureRecognitionResult.cs
- WinEventWrap.cs
- IndentedWriter.cs
- AutomationAttributeInfo.cs
- PropagationProtocolsTracing.cs
- UnitySerializationHolder.cs
- ContainerParagraph.cs
- FormsIdentity.cs
- ISFTagAndGuidCache.cs
- WindowsAuthenticationEventArgs.cs
- FamilyTypefaceCollection.cs
- EngineSiteSapi.cs
- PrefixQName.cs
- GraphicsContext.cs
- ProgressBarRenderer.cs
- VirtualPathUtility.cs
- SystemColorTracker.cs
- SessionStateUtil.cs
- BasicDesignerLoader.cs
- Pen.cs
- QueryOperationResponseOfT.cs
- SocketInformation.cs
- EntitySetBaseCollection.cs
- InternalConfigHost.cs
- Clock.cs
- Utils.cs
- Membership.cs
- ExpressionVisitor.cs
- XPathPatternBuilder.cs
- StorageFunctionMapping.cs
- httpstaticobjectscollection.cs
- FormViewDesigner.cs
- DragDeltaEventArgs.cs
- PathFigure.cs
- PageAsyncTask.cs
- StylusPlugInCollection.cs
- AsymmetricAlgorithm.cs
- XmlTextReader.cs
- _TLSstream.cs
- bidPrivateBase.cs
- GeneralTransformGroup.cs
- RootBuilder.cs
- DependencyProperty.cs
- CheckoutException.cs
- EntityDataSourceChangedEventArgs.cs
- EventDescriptor.cs
- COSERVERINFO.cs
- DeviceFilterEditorDialog.cs
- SystemColors.cs
- HttpResponseHeader.cs
- HttpRuntimeSection.cs
- XmlEnumAttribute.cs
- HttpStreamMessage.cs
- ProfileSettingsCollection.cs
- TransactionContextValidator.cs
- XmlBinaryReader.cs
- WebPartDisplayMode.cs
- MdiWindowListStrip.cs
- ExpressionContext.cs
- GetPageCompletedEventArgs.cs
- WindowsAltTab.cs
- SecurityKeyIdentifier.cs
- RelatedEnd.cs
- SqlDataAdapter.cs
- PathFigureCollection.cs
- Expr.cs
- XmlWriter.cs
- ButtonChrome.cs
- FormsAuthenticationUser.cs
- dataprotectionpermission.cs
- ExtensibleClassFactory.cs
- _CacheStreams.cs
- RegexInterpreter.cs
- TextPointerBase.cs
- IdentityModelStringsVersion1.cs
- RightsManagementEncryptionTransform.cs