Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / CompMod / System / ComponentModel / Design / ArrayEditor.cs / 1 / ArrayEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel.Design { using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting.Activation; using System.Runtime.InteropServices; using System.ComponentModel; using System.Diagnostics; using System; using System.Collections; using Microsoft.Win32; using System.Drawing; using System.Drawing.Design; using System.Reflection; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Windows.Forms.ComponentModel; ////// /// public class ArrayEditor : CollectionEditor { ///Edits an array of values. ////// /// public ArrayEditor(Type type) : base(type) { } ////// Initializes a new instance of ///using the /// specified type for the array. /// /// /// protected override Type CreateCollectionItemType() { return CollectionType.GetElementType(); } ////// Gets or /// sets /// the data type this collection contains. /// ////// /// 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]; } } ////// Gets the items in the array. /// ////// /// 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./// Sets the items in the array. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReflectionPermission.cs
- WinCategoryAttribute.cs
- InfoCard.cs
- BulletChrome.cs
- GCHandleCookieTable.cs
- FrameworkElementAutomationPeer.cs
- Parameter.cs
- EventSinkHelperWriter.cs
- MultilineStringConverter.cs
- KeyValueInternalCollection.cs
- OdbcConnectionHandle.cs
- ConnectionsZone.cs
- DataSourceHelper.cs
- ContentElementAutomationPeer.cs
- BindingExpressionBase.cs
- AndAlso.cs
- SoapHelper.cs
- Pair.cs
- DataGridViewRowHeaderCell.cs
- ValueTypeFixupInfo.cs
- GlyphRunDrawing.cs
- VirtualPath.cs
- LinkDescriptor.cs
- SvcMapFile.cs
- HttpProtocolReflector.cs
- HasCopySemanticsAttribute.cs
- OleDbError.cs
- VirtualPathProvider.cs
- GridViewColumnCollectionChangedEventArgs.cs
- WindowsFormsHost.cs
- EntityDataSourceSelectingEventArgs.cs
- ErrorProvider.cs
- Int32.cs
- Point4D.cs
- ExtensionWindowHeader.cs
- TextDecorationLocationValidation.cs
- DbInsertCommandTree.cs
- BufferBuilder.cs
- Axis.cs
- CompilationRelaxations.cs
- PropertyManager.cs
- Screen.cs
- ExtendedPropertiesHandler.cs
- OracleEncoding.cs
- ObjectListCommandCollection.cs
- SynchronizationLockException.cs
- AssemblyResourceLoader.cs
- _CookieModule.cs
- PaintEvent.cs
- RuntimeConfigLKG.cs
- MarkedHighlightComponent.cs
- DefaultValueTypeConverter.cs
- precedingquery.cs
- InkPresenter.cs
- ChannelSinkStacks.cs
- PermissionToken.cs
- ProcessProtocolHandler.cs
- PerformanceCounterPermissionEntry.cs
- XmlSchemaValidator.cs
- SubMenuStyleCollection.cs
- WindowsSolidBrush.cs
- ImmutableCommunicationTimeouts.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- TaiwanCalendar.cs
- HTMLTagNameToTypeMapper.cs
- WebBrowserNavigatingEventHandler.cs
- Quad.cs
- VisualTreeHelper.cs
- Matrix.cs
- printdlgexmarshaler.cs
- RunWorkerCompletedEventArgs.cs
- WsatConfiguration.cs
- EntityKeyElement.cs
- Material.cs
- WebPartConnectionsConfigureVerb.cs
- ArrangedElementCollection.cs
- OracleBoolean.cs
- MetadataFile.cs
- ExtenderProviderService.cs
- GeometryValueSerializer.cs
- TableCell.cs
- ListMarkerLine.cs
- OAVariantLib.cs
- AsyncOperationManager.cs
- DiscreteKeyFrames.cs
- WorkflowRuntimeServiceElementCollection.cs
- WindowsAuthenticationEventArgs.cs
- WebServiceMethodData.cs
- ExceptionTrace.cs
- ButtonBaseAutomationPeer.cs
- MobilePage.cs
- SafeFileMappingHandle.cs
- PointHitTestParameters.cs
- ColorContext.cs
- KeyValueSerializer.cs
- NotifyParentPropertyAttribute.cs
- SinglePageViewer.cs
- Site.cs
- CustomSignedXml.cs
- DataGridViewAutoSizeModeEventArgs.cs