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
- ReferenceSchema.cs
- FixedTextView.cs
- PackageRelationship.cs
- TextSpan.cs
- odbcmetadatafactory.cs
- SmuggledIUnknown.cs
- WebPartConnectionsConfigureVerb.cs
- WebPermission.cs
- XmlImplementation.cs
- TypeElement.cs
- SchemaConstraints.cs
- SelectionProcessor.cs
- DbParameterHelper.cs
- ObjectConverter.cs
- BuildProviderCollection.cs
- DependencySource.cs
- IPCCacheManager.cs
- DBParameter.cs
- AbstractSvcMapFileLoader.cs
- XmlCodeExporter.cs
- TemplateParser.cs
- PersonalizationProviderCollection.cs
- SqlSelectStatement.cs
- XmlSchemaAppInfo.cs
- DbSetClause.cs
- CacheHelper.cs
- SQLByteStorage.cs
- BufferBuilder.cs
- CompilerLocalReference.cs
- FixedBufferAttribute.cs
- SQLString.cs
- DataGridViewTextBoxColumn.cs
- RelationshipSet.cs
- TextOptions.cs
- BehaviorEditorPart.cs
- Group.cs
- RequestCache.cs
- DesignerDataSourceView.cs
- HotCommands.cs
- ListManagerBindingsCollection.cs
- Glyph.cs
- PresentationSource.cs
- SqlConnection.cs
- ListViewGroupItemCollection.cs
- ParseChildrenAsPropertiesAttribute.cs
- IsolationInterop.cs
- IItemProperties.cs
- HandlerFactoryWrapper.cs
- ListBox.cs
- SiteMapNode.cs
- JapaneseCalendar.cs
- ToolStrip.cs
- ADMembershipUser.cs
- StrokeNodeOperations.cs
- XmlArrayAttribute.cs
- ReflectionUtil.cs
- Hyperlink.cs
- TypedLocationWrapper.cs
- ListItemCollection.cs
- NumericUpDownAcceleration.cs
- SqlMethodAttribute.cs
- DiscriminatorMap.cs
- GPRECT.cs
- TemplateBindingExpressionConverter.cs
- SamlConstants.cs
- ConfigXmlSignificantWhitespace.cs
- GeometryDrawing.cs
- WCFModelStrings.Designer.cs
- log.cs
- DataAccessException.cs
- KnownTypesProvider.cs
- CustomValidator.cs
- CachedBitmap.cs
- TextDecoration.cs
- XmlSchemaInferenceException.cs
- _HeaderInfoTable.cs
- RoutedEventArgs.cs
- GeneralTransform3D.cs
- WebEvents.cs
- D3DImage.cs
- InheritanceContextHelper.cs
- WebUtil.cs
- DoubleCollection.cs
- FamilyTypeface.cs
- IdentityNotMappedException.cs
- EntityDataSourceEntityTypeFilterItem.cs
- InputScopeManager.cs
- DataSourceConverter.cs
- CodeGroup.cs
- Win32.cs
- SerializationInfoEnumerator.cs
- SapiRecoInterop.cs
- ExtendedPropertyInfo.cs
- HttpStreamMessageEncoderFactory.cs
- PeerHelpers.cs
- AnnotationHighlightLayer.cs
- EmptyStringExpandableObjectConverter.cs
- DataServiceConfiguration.cs
- OleStrCAMarshaler.cs
- Run.cs