Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / StringArrayEditor.cs / 1 / StringArrayEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.Design { using System; using System.Collections; using Microsoft.Win32; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Drawing; using System.Windows.Forms; ////// /// The StringArrayEditor is a collection editor that is specifically /// designed to edit arrays containing strings. /// internal class StringArrayEditor : StringCollectionEditor { [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] public StringArrayEditor(Type type) : base(type) { } ////// /// Retrieves the data type this collection contains. The default /// implementation looks inside of the collection for the Item property /// and returns the returning datatype of the item. Do not call this /// method directly. Instead, use the CollectionItemType property. Use this /// method to override the default implementation. /// protected override Type CreateCollectionItemType() { return CollectionType.GetElementType(); } ////// /// We implement the getting and setting of items on this collection. /// protected override object[] GetItems(object editValue) { Array valueArray = editValue as Array; if (valueArray == null) { return new object[0]; } else { object[] items = new object[valueArray.GetLength(0)]; Array.Copy(valueArray, items, items.Length); return items; } } ////// /// We implement the getting and setting of items on this collection. /// It should return an instance to replace editValue with, or editValue /// if there is no need to replace the instance. /// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ManualWorkflowSchedulerService.cs
- LexicalChunk.cs
- ChangeBlockUndoRecord.cs
- ChannelAcceptor.cs
- GenericsInstances.cs
- LeaseManager.cs
- DeviceContext.cs
- EntitySqlQueryState.cs
- DataGridViewHitTestInfo.cs
- FileDialog.cs
- ReliableOutputConnection.cs
- FamilyMap.cs
- AnimationException.cs
- MediaContextNotificationWindow.cs
- TextBoxAutomationPeer.cs
- MessagePartProtectionMode.cs
- Variant.cs
- smtpconnection.cs
- FilterRepeater.cs
- XmlAttributeCollection.cs
- XmlSignatureProperties.cs
- ToolboxItem.cs
- EditorZoneDesigner.cs
- PrimitiveDataContract.cs
- SafePipeHandle.cs
- IntSecurity.cs
- IntSecurity.cs
- AnimationTimeline.cs
- ItemCheckEvent.cs
- _Connection.cs
- Regex.cs
- DataViewSettingCollection.cs
- DataGridViewCellLinkedList.cs
- NavigationWindowAutomationPeer.cs
- EntityConnection.cs
- AsynchronousChannelMergeEnumerator.cs
- CTreeGenerator.cs
- IDictionary.cs
- LiteralLink.cs
- UserMapPath.cs
- ProgressBarBrushConverter.cs
- ListSourceHelper.cs
- ObjectStateFormatter.cs
- Dictionary.cs
- TextTreeDeleteContentUndoUnit.cs
- CodeComment.cs
- HttpClientCredentialType.cs
- PropertyIDSet.cs
- TypeUtil.cs
- indexingfiltermarshaler.cs
- SqlDataSourceView.cs
- SizeChangedInfo.cs
- TimelineCollection.cs
- storepermission.cs
- ConfigXmlComment.cs
- Rect3D.cs
- IPipelineRuntime.cs
- BaseUriHelper.cs
- WebPartUserCapability.cs
- SubclassTypeValidator.cs
- DynamicQueryableWrapper.cs
- PropertyDescriptorCollection.cs
- EntitySqlQueryState.cs
- FlowDocumentReaderAutomationPeer.cs
- EmptyCollection.cs
- ClientSideQueueItem.cs
- EncryptedPackageFilter.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SecurityPolicySection.cs
- Point3DKeyFrameCollection.cs
- NativeMethodsCLR.cs
- ReadOnlyDictionary.cs
- IteratorFilter.cs
- ErrorFormatterPage.cs
- MaskedTextBoxTextEditor.cs
- _PooledStream.cs
- FormsAuthenticationUserCollection.cs
- SynchronizationContext.cs
- LookupNode.cs
- Convert.cs
- ConnectionManagementElementCollection.cs
- SiteMapNodeItemEventArgs.cs
- StylusPointPropertyId.cs
- HandleRef.cs
- SelectionWordBreaker.cs
- TrackingLocation.cs
- ConfigXmlSignificantWhitespace.cs
- FieldAccessException.cs
- DataSourceBooleanViewSchemaConverter.cs
- BrowserCapabilitiesFactoryBase.cs
- ZipIOExtraFieldElement.cs
- ClickablePoint.cs
- DirtyTextRange.cs
- RemoteHelper.cs
- Model3D.cs
- AbsoluteQuery.cs
- ImageSource.cs
- DesignerForm.cs
- x509store.cs
- FileUpload.cs