Code:
/ DotNET / DotNET / 8.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
- MetadataProperty.cs
- TimerElapsedEvenArgs.cs
- WebPartRestoreVerb.cs
- SettingsSection.cs
- MaterialGroup.cs
- TypeGeneratedEventArgs.cs
- ServiceDescriptionImporter.cs
- BindingListCollectionView.cs
- InternalConfigSettingsFactory.cs
- BitmapEffectInput.cs
- InkCanvasFeedbackAdorner.cs
- DataReceivedEventArgs.cs
- RawAppCommandInputReport.cs
- WorkflowServiceBuildProvider.cs
- SortedList.cs
- DataGridViewDataErrorEventArgs.cs
- Identity.cs
- NativeMethods.cs
- DbgCompiler.cs
- EntityProviderServices.cs
- StreamResourceInfo.cs
- TextChangedEventArgs.cs
- ToolTipService.cs
- TextBoxDesigner.cs
- Label.cs
- TextRangeEdit.cs
- DataColumnChangeEvent.cs
- TextBoxBase.cs
- ByteBufferPool.cs
- StrongName.cs
- AQNBuilder.cs
- DataPagerFieldCollection.cs
- SerializationInfo.cs
- DrawingContextDrawingContextWalker.cs
- LayoutTable.cs
- HttpInputStream.cs
- JournalNavigationScope.cs
- ConfigurationProperty.cs
- MenuItem.cs
- PerformanceCounterCategory.cs
- KnownTypeAttribute.cs
- ConnectionManagementElement.cs
- Attributes.cs
- XmlNotation.cs
- DrawingVisual.cs
- RequestNavigateEventArgs.cs
- DataGridItemCollection.cs
- TiffBitmapDecoder.cs
- ControlTemplate.cs
- AttributedMetaModel.cs
- NetworkAddressChange.cs
- ContainerControl.cs
- ViewBox.cs
- KeyTimeConverter.cs
- DataGridColumn.cs
- embossbitmapeffect.cs
- WindowsProgressbar.cs
- CustomValidator.cs
- BitmapEffectGroup.cs
- Point3DAnimationUsingKeyFrames.cs
- Connector.cs
- CaseExpr.cs
- validationstate.cs
- XmlNotation.cs
- CreateUserWizardDesigner.cs
- UserNamePasswordValidator.cs
- StyleModeStack.cs
- EntityDesignerUtils.cs
- ParsedAttributeCollection.cs
- SortedSet.cs
- OleCmdHelper.cs
- TextParagraphCache.cs
- ColorConvertedBitmap.cs
- SoapHelper.cs
- EnglishPluralizationService.cs
- Delegate.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- SpecialNameAttribute.cs
- CharEntityEncoderFallback.cs
- ThemeableAttribute.cs
- PersonalizableTypeEntry.cs
- StateManagedCollection.cs
- EventLogPermissionEntryCollection.cs
- TextEditorSelection.cs
- __Error.cs
- DeviceContext2.cs
- ResXResourceSet.cs
- DbMetaDataColumnNames.cs
- DependencyPropertyChangedEventArgs.cs
- XsltContext.cs
- UITypeEditors.cs
- ConfigXmlReader.cs
- SqlTopReducer.cs
- BindingObserver.cs
- ExpandSegment.cs
- DataGridViewBand.cs
- HtmlLiteralTextAdapter.cs
- IChannel.cs
- SystemTcpConnection.cs
- XmlWellformedWriter.cs