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
- CursorInteropHelper.cs
- UrlMappingCollection.cs
- FormatSettings.cs
- CornerRadiusConverter.cs
- NativeMethods.cs
- ZipIOLocalFileDataDescriptor.cs
- HebrewNumber.cs
- PrintDialogException.cs
- SqlCacheDependencyDatabase.cs
- ServicesUtilities.cs
- MSHTMLHost.cs
- MenuEventArgs.cs
- CaseInsensitiveHashCodeProvider.cs
- WorkflowApplicationException.cs
- ViewStateModeByIdAttribute.cs
- KeyInfo.cs
- FragmentNavigationEventArgs.cs
- ObjectStateManagerMetadata.cs
- PropertyOrder.cs
- Int16Converter.cs
- PresentationAppDomainManager.cs
- Rss20ItemFormatter.cs
- SignatureDescription.cs
- WebConfigurationFileMap.cs
- listitem.cs
- PanelStyle.cs
- TextContainerChangeEventArgs.cs
- XPathNodeList.cs
- SecurityState.cs
- DataTemplateSelector.cs
- BrowserCapabilitiesFactory.cs
- ObjectIDGenerator.cs
- OAVariantLib.cs
- QilReference.cs
- RuntimeWrappedException.cs
- CachedPathData.cs
- WeakReferenceEnumerator.cs
- InputLanguageEventArgs.cs
- DnsElement.cs
- Vector3DCollectionConverter.cs
- AttachedPropertyBrowsableAttribute.cs
- BuildProvidersCompiler.cs
- EventLogPermission.cs
- PeerTransportListenAddressValidator.cs
- StateMachine.cs
- DesignerTransaction.cs
- QueueSurrogate.cs
- Lease.cs
- XmlC14NWriter.cs
- BitmapEffectrendercontext.cs
- exports.cs
- ScriptingProfileServiceSection.cs
- WinFormsComponentEditor.cs
- ToolStripActionList.cs
- XmlWhitespace.cs
- FocusChangedEventArgs.cs
- DataExchangeServiceBinder.cs
- IntAverageAggregationOperator.cs
- StyleXamlParser.cs
- FirewallWrapper.cs
- SqlDataSourceParameterParser.cs
- XamlBuildTaskServices.cs
- SqlNode.cs
- ConfigsHelper.cs
- RadioButtonList.cs
- CustomCredentialPolicy.cs
- CodeExpressionCollection.cs
- PrinterSettings.cs
- AnnotationHighlightLayer.cs
- PermissionListSet.cs
- ValidatorCompatibilityHelper.cs
- WebPartEditorOkVerb.cs
- SafePipeHandle.cs
- HWStack.cs
- SchemaComplexType.cs
- ObjectDataSourceFilteringEventArgs.cs
- DbConnectionPool.cs
- BlockUIContainer.cs
- RootCodeDomSerializer.cs
- JsonWriterDelegator.cs
- FontFamily.cs
- MasterPageCodeDomTreeGenerator.cs
- DES.cs
- ContainerUIElement3D.cs
- ISessionStateStore.cs
- ServiceNotStartedException.cs
- SqlDataReader.cs
- CaseStatementSlot.cs
- UntrustedRecipientException.cs
- nulltextcontainer.cs
- DecimalConstantAttribute.cs
- adornercollection.cs
- MetadataCacheItem.cs
- FtpWebResponse.cs
- SignatureDescription.cs
- XmlIgnoreAttribute.cs
- StandardTransformFactory.cs
- HttpRequest.cs
- ImmutableCommunicationTimeouts.cs
- XslAstAnalyzer.cs