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
- InputReport.cs
- RegexMatchCollection.cs
- ServerValidateEventArgs.cs
- NameTable.cs
- WorkflowElementDialogWindow.xaml.cs
- FontStyles.cs
- TreeNodeBindingCollection.cs
- ResXBuildProvider.cs
- TreeViewAutomationPeer.cs
- ReadOnlyTernaryTree.cs
- SoapEnumAttribute.cs
- WCFServiceClientProxyGenerator.cs
- RestHandlerFactory.cs
- TextBoxLine.cs
- WebPartConnectVerb.cs
- MessageQueuePermissionAttribute.cs
- Pens.cs
- XmlSchemaInfo.cs
- HtmlInputButton.cs
- OpCellTreeNode.cs
- EnumBuilder.cs
- ObjectDataSourceMethodEventArgs.cs
- OdbcReferenceCollection.cs
- SerializationIncompleteException.cs
- BevelBitmapEffect.cs
- CellCreator.cs
- DataGridColumn.cs
- DataSetMappper.cs
- DocumentAutomationPeer.cs
- DataSetMappper.cs
- ObjectDataSource.cs
- ParserContext.cs
- LinkedList.cs
- SlotInfo.cs
- EditorOptionAttribute.cs
- FrameworkContentElement.cs
- ZipIOFileItemStream.cs
- HttpClientCertificate.cs
- XmlSchema.cs
- HttpWebRequest.cs
- CodeTypeConstructor.cs
- DefaultPropertyAttribute.cs
- MsdtcWrapper.cs
- DBConcurrencyException.cs
- COM2PropertyPageUITypeConverter.cs
- JapaneseCalendar.cs
- DebugViewWriter.cs
- DependencyObjectProvider.cs
- GAC.cs
- TreeWalkHelper.cs
- EditingCommands.cs
- StructuralObject.cs
- HorizontalAlignConverter.cs
- NGCSerializationManagerAsync.cs
- HtmlInputReset.cs
- BitmapEffectDrawingContextWalker.cs
- BinaryConverter.cs
- HttpResponseHeader.cs
- UrlMappingsModule.cs
- ColorTranslator.cs
- XmlSerializer.cs
- GradientStopCollection.cs
- BinaryFormatterSinks.cs
- CollectionsUtil.cs
- EncoderParameters.cs
- GeometryHitTestParameters.cs
- PrintEvent.cs
- SvcMapFileLoader.cs
- DataTableReaderListener.cs
- ToolStripItemCollection.cs
- SmiRecordBuffer.cs
- AQNBuilder.cs
- IFlowDocumentViewer.cs
- XmlSchemaComplexType.cs
- CodeConstructor.cs
- WebRequest.cs
- AtlasWeb.Designer.cs
- CatalogPartChrome.cs
- ReadOnlyDictionary.cs
- Adorner.cs
- ReliableOutputConnection.cs
- HMAC.cs
- IOException.cs
- RequestQueue.cs
- ColumnHeaderConverter.cs
- ChannelSinkStacks.cs
- TableCellCollection.cs
- KeyNotFoundException.cs
- EntityDataSourceWrapper.cs
- TransformPatternIdentifiers.cs
- MdiWindowListStrip.cs
- Internal.cs
- HttpProfileGroupBase.cs
- ContainerTracking.cs
- SiblingIterators.cs
- M3DUtil.cs
- complextypematerializer.cs
- ZoneLinkButton.cs
- Collection.cs
- OwnerDrawPropertyBag.cs