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
- InputLangChangeRequestEvent.cs
- EventKeyword.cs
- EndEvent.cs
- OdbcError.cs
- TagPrefixCollection.cs
- RestHandlerFactory.cs
- DataGridViewAccessibleObject.cs
- TimeStampChecker.cs
- ObjectCloneHelper.cs
- SystemEvents.cs
- Grid.cs
- ExceptionUtil.cs
- DispatcherTimer.cs
- Delegate.cs
- ClientApiGenerator.cs
- DES.cs
- TextDecoration.cs
- MyContact.cs
- SystemBrushes.cs
- WebException.cs
- LoadedOrUnloadedOperation.cs
- XmlQueryTypeFactory.cs
- AmbiguousMatchException.cs
- ListItemCollection.cs
- ColumnHeader.cs
- NetTcpSecurity.cs
- AsymmetricKeyExchangeDeformatter.cs
- _BasicClient.cs
- RoleManagerModule.cs
- SystemIcmpV4Statistics.cs
- RoleManagerModule.cs
- BrowsableAttribute.cs
- GenericTextProperties.cs
- PeerCollaboration.cs
- ScriptControlManager.cs
- XmlSchemaSimpleContentRestriction.cs
- GridViewDeletedEventArgs.cs
- MailMessageEventArgs.cs
- ExpressionBindingCollection.cs
- RenderingEventArgs.cs
- RuntimeWrappedException.cs
- SoapHeaderException.cs
- BitStack.cs
- KeyValueConfigurationElement.cs
- DetailsViewInsertEventArgs.cs
- Speller.cs
- CodeVariableReferenceExpression.cs
- TemplateParser.cs
- InputQueueChannelAcceptor.cs
- OutputCacheProfile.cs
- CodeIndexerExpression.cs
- RoleService.cs
- BigInt.cs
- TCPListener.cs
- BindingCompleteEventArgs.cs
- LinqDataSourceStatusEventArgs.cs
- ConstructorBuilder.cs
- querybuilder.cs
- XmlSchemaObjectCollection.cs
- HttpListenerResponse.cs
- GPStream.cs
- DynamicValueConverter.cs
- SurrogateDataContract.cs
- Ops.cs
- CustomPopupPlacement.cs
- IndexerNameAttribute.cs
- WindowVisualStateTracker.cs
- XmlBinaryWriterSession.cs
- RowVisual.cs
- Vars.cs
- CodeDomDecompiler.cs
- ByteStreamGeometryContext.cs
- UserControlBuildProvider.cs
- PermissionSetEnumerator.cs
- OrthographicCamera.cs
- Page.cs
- ManagedWndProcTracker.cs
- Avt.cs
- DocumentViewerAutomationPeer.cs
- COMException.cs
- HttpFileCollectionBase.cs
- NgenServicingAttributes.cs
- Error.cs
- SqlCacheDependencyDatabaseCollection.cs
- SqlClientWrapperSmiStream.cs
- ConstantSlot.cs
- GetKeyedHashRequest.cs
- SimplePropertyEntry.cs
- LeaseManager.cs
- prompt.cs
- ByeOperationCD1AsyncResult.cs
- DataGridRelationshipRow.cs
- CompletedAsyncResult.cs
- SimpleNameService.cs
- RotationValidation.cs
- ExpressionVisitorHelpers.cs
- TraceSwitch.cs
- ScriptControl.cs
- DesignerWebPartChrome.cs
- ToolTipService.cs