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
- XPathNavigatorReader.cs
- HasCopySemanticsAttribute.cs
- SafeNativeMethodsCLR.cs
- BinaryObjectReader.cs
- LinkedResourceCollection.cs
- MobileContainerDesigner.cs
- BinaryFormatterSinks.cs
- TypeResolver.cs
- SimpleBitVector32.cs
- IdentityReference.cs
- SizeChangedInfo.cs
- MenuEventArgs.cs
- IProvider.cs
- Image.cs
- FormViewUpdatedEventArgs.cs
- DataGridState.cs
- mediaeventshelper.cs
- AspNetCompatibilityRequirementsAttribute.cs
- IfAction.cs
- ListSortDescription.cs
- SeekableReadStream.cs
- FormatException.cs
- XmlSchemaInclude.cs
- ResourceAttributes.cs
- DiagnosticsConfigurationHandler.cs
- _AutoWebProxyScriptWrapper.cs
- WindowsButton.cs
- DependencyPropertyHelper.cs
- ListBoxAutomationPeer.cs
- HttpPostedFile.cs
- FontFaceLayoutInfo.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- NullableBoolConverter.cs
- RequiredFieldValidator.cs
- AdornerDecorator.cs
- RelationshipType.cs
- InternalTypeHelper.cs
- ExtensionQuery.cs
- ZipIOExtraField.cs
- Expression.cs
- CounterSetInstanceCounterDataSet.cs
- Point3D.cs
- ControlTemplate.cs
- StylusPlugin.cs
- ButtonChrome.cs
- StrictAndMessageFilter.cs
- ReadOnlyMetadataCollection.cs
- XmlSchemaException.cs
- WebPartMenu.cs
- RelationshipEnd.cs
- DrawItemEvent.cs
- VisualTreeFlattener.cs
- Operator.cs
- HostingEnvironmentSection.cs
- EmptyEnumerator.cs
- CharAnimationUsingKeyFrames.cs
- SQLGuid.cs
- Function.cs
- SafeNativeMethods.cs
- InputProcessorProfiles.cs
- Padding.cs
- RouteUrlExpressionBuilder.cs
- PagePropertiesChangingEventArgs.cs
- cryptoapiTransform.cs
- StylusEventArgs.cs
- ContentFilePart.cs
- DockPatternIdentifiers.cs
- XmlSchemaObjectTable.cs
- ByteConverter.cs
- WebPartsPersonalization.cs
- TextHintingModeValidation.cs
- CaseInsensitiveOrdinalStringComparer.cs
- MimeReflector.cs
- ResolveCompletedEventArgs.cs
- AssemblyNameProxy.cs
- counter.cs
- Utility.cs
- DataBindingHandlerAttribute.cs
- ConfigXmlText.cs
- AnnouncementClient.cs
- BufferedGraphicsManager.cs
- SqlCharStream.cs
- NullableDoubleAverageAggregationOperator.cs
- XmlSchemaAny.cs
- URL.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- ProfileInfo.cs
- ScriptingWebServicesSectionGroup.cs
- Bold.cs
- XamlGridLengthSerializer.cs
- AccessKeyManager.cs
- Scheduling.cs
- TempEnvironment.cs
- ImageKeyConverter.cs
- CheckBoxFlatAdapter.cs
- Int32.cs
- CodeExpressionCollection.cs
- AutoCompleteStringCollection.cs
- CultureSpecificCharacterBufferRange.cs
- TableItemPattern.cs