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
- OleDbCommand.cs
- WindowsGraphics.cs
- ExtractorMetadata.cs
- SetIndexBinder.cs
- ClientEventManager.cs
- SQLMembershipProvider.cs
- TableChangeProcessor.cs
- TableLayoutPanelCellPosition.cs
- XmlElement.cs
- CircleHotSpot.cs
- XmlSchemaComplexContent.cs
- CategoryNameCollection.cs
- LeaseManager.cs
- ObjectIDGenerator.cs
- QuaternionRotation3D.cs
- NoResizeSelectionBorderGlyph.cs
- CodeObject.cs
- XmlSchemaSimpleTypeUnion.cs
- PrincipalPermission.cs
- RangeContentEnumerator.cs
- RichTextBox.cs
- GlyphShapingProperties.cs
- EdgeModeValidation.cs
- PaginationProgressEventArgs.cs
- DataRowView.cs
- ReverseInheritProperty.cs
- Pens.cs
- CompilerErrorCollection.cs
- SQLInt64Storage.cs
- HtmlSelect.cs
- Focus.cs
- ColumnPropertiesGroup.cs
- SpeakProgressEventArgs.cs
- BamlLocalizabilityResolver.cs
- XmlIterators.cs
- WindowInteractionStateTracker.cs
- Timer.cs
- DbSetClause.cs
- Annotation.cs
- FigureParagraph.cs
- SelectionGlyphBase.cs
- SelectionGlyph.cs
- DbProviderConfigurationHandler.cs
- ClientSideQueueItem.cs
- SemanticResultKey.cs
- HashCryptoHandle.cs
- DeleteBookmarkScope.cs
- DoubleLinkList.cs
- AbsoluteQuery.cs
- ControlsConfig.cs
- ChannelSinkStacks.cs
- BinaryNode.cs
- ScriptResourceHandler.cs
- DataKey.cs
- PackagingUtilities.cs
- DateRangeEvent.cs
- Pair.cs
- EmbeddedMailObjectsCollection.cs
- ViewStateException.cs
- WebCategoryAttribute.cs
- DataControlCommands.cs
- ProxyWebPart.cs
- hwndwrapper.cs
- SecurityRuntime.cs
- ScrollableControl.cs
- LinqDataSourceValidationException.cs
- KeyedHashAlgorithm.cs
- MetadataSource.cs
- PropertyInfoSet.cs
- OpenTypeMethods.cs
- DrawingServices.cs
- DataGridTableCollection.cs
- CodeNamespaceImport.cs
- LinqToSqlWrapper.cs
- DataKey.cs
- LayoutEditorPart.cs
- CancellationTokenRegistration.cs
- ChildDocumentBlock.cs
- OperationBehaviorAttribute.cs
- XmlSerializableWriter.cs
- ADMembershipProvider.cs
- RemotingException.cs
- OdbcCommand.cs
- RadioButtonAutomationPeer.cs
- Cloud.cs
- AsymmetricSecurityProtocol.cs
- Bezier.cs
- Expander.cs
- StreamAsIStream.cs
- CachedPathData.cs
- RuleValidation.cs
- AssociationType.cs
- EntityCollection.cs
- DrawingAttributeSerializer.cs
- RowTypeElement.cs
- DataErrorValidationRule.cs
- GACIdentityPermission.cs
- XmlObjectSerializerWriteContextComplex.cs
- Variable.cs
- XmlSortKey.cs