Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / PropertyGridInternal / GridEntryCollection.cs / 1305376 / GridEntryCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.PropertyGridInternal { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.Collections; using System.Reflection; using System.Drawing.Design; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Drawing; using Microsoft.Win32; internal class GridEntryCollection : GridItemCollection { private GridEntry owner; public GridEntryCollection(GridEntry owner, GridEntry[] entries) : base(entries) { this.owner = owner; } public void AddRange(GridEntry[] value) { if (value == null) { throw new ArgumentNullException("value"); } if (entries != null) { GridEntry[] newArray = new GridEntry[entries.Length + value.Length]; entries.CopyTo(newArray, 0); value.CopyTo(newArray, entries.Length); entries = newArray; } else { entries = (GridEntry[])value.Clone(); } } public void Clear() { entries = new GridEntry[0]; } public void CopyTo(Array dest, int index) { entries.CopyTo(dest, index); } internal GridEntry GetEntry(int index) { return (GridEntry)entries[index]; } internal int GetEntry(GridEntry child) { return Array.IndexOf(entries, child); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { if (owner != null && entries != null) { for (int i = 0; i < entries.Length; i++) { if (entries[i] != null) { ((GridEntry)entries[i]).Dispose(); entries[i] = null; } } entries = new GridEntry[0]; } } } ~GridEntryCollection() { Dispose(false); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.PropertyGridInternal { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.Collections; using System.Reflection; using System.Drawing.Design; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Drawing; using Microsoft.Win32; internal class GridEntryCollection : GridItemCollection { private GridEntry owner; public GridEntryCollection(GridEntry owner, GridEntry[] entries) : base(entries) { this.owner = owner; } public void AddRange(GridEntry[] value) { if (value == null) { throw new ArgumentNullException("value"); } if (entries != null) { GridEntry[] newArray = new GridEntry[entries.Length + value.Length]; entries.CopyTo(newArray, 0); value.CopyTo(newArray, entries.Length); entries = newArray; } else { entries = (GridEntry[])value.Clone(); } } public void Clear() { entries = new GridEntry[0]; } public void CopyTo(Array dest, int index) { entries.CopyTo(dest, index); } internal GridEntry GetEntry(int index) { return (GridEntry)entries[index]; } internal int GetEntry(GridEntry child) { return Array.IndexOf(entries, child); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { if (owner != null && entries != null) { for (int i = 0; i < entries.Length; i++) { if (entries[i] != null) { ((GridEntry)entries[i]).Dispose(); entries[i] = null; } } entries = new GridEntry[0]; } } } ~GridEntryCollection() { Dispose(false); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UnmanagedMemoryStreamWrapper.cs
- SafeNativeMethods.cs
- AttachedAnnotationChangedEventArgs.cs
- RawStylusActions.cs
- CharacterBufferReference.cs
- TypeForwardedFromAttribute.cs
- KeyBinding.cs
- HashStream.cs
- DefaultHttpHandler.cs
- WSSecureConversationFeb2005.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- Types.cs
- ScalarConstant.cs
- MsmqUri.cs
- DataControlLinkButton.cs
- CompilerGeneratedAttribute.cs
- SqlNodeAnnotation.cs
- URIFormatException.cs
- Int32RectConverter.cs
- StandardOleMarshalObject.cs
- oledbconnectionstring.cs
- SynchronizingStream.cs
- Stopwatch.cs
- FastEncoderWindow.cs
- ClientSession.cs
- TablePatternIdentifiers.cs
- ConstraintConverter.cs
- CodeArrayIndexerExpression.cs
- RSAPKCS1SignatureFormatter.cs
- ComponentChangedEvent.cs
- CopyNodeSetAction.cs
- CollectionViewGroup.cs
- DataGridCaption.cs
- DefaultBindingPropertyAttribute.cs
- OrderedDictionaryStateHelper.cs
- InheritablePropertyChangeInfo.cs
- XmlArrayAttribute.cs
- SchemaElement.cs
- HTMLTagNameToTypeMapper.cs
- Decoder.cs
- ToolstripProfessionalRenderer.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DataGridBeginningEditEventArgs.cs
- TickBar.cs
- CollectionChangedEventManager.cs
- TemplateControl.cs
- DmlSqlGenerator.cs
- SqlAliaser.cs
- DataKey.cs
- FtpCachePolicyElement.cs
- SafeArrayTypeMismatchException.cs
- DataServiceQueryContinuation.cs
- Matrix3D.cs
- BuildProviderCollection.cs
- XsltContext.cs
- ClaimTypes.cs
- NotifyParentPropertyAttribute.cs
- MetaModel.cs
- UntrustedRecipientException.cs
- Mappings.cs
- LoginView.cs
- TextProperties.cs
- EntityViewGenerationConstants.cs
- DispatcherProcessingDisabled.cs
- SafeCertificateContext.cs
- ImplicitInputBrush.cs
- NetTcpSection.cs
- EntitySqlQueryCacheKey.cs
- TdsParserStateObject.cs
- StringDictionary.cs
- ConfigurationManagerInternal.cs
- Mouse.cs
- RelatedPropertyManager.cs
- ImageAnimator.cs
- ExtensionDataObject.cs
- IdentityNotMappedException.cs
- AddressAccessDeniedException.cs
- RawStylusActions.cs
- ByteConverter.cs
- StickyNote.cs
- WindowsIPAddress.cs
- XmlNullResolver.cs
- GenericEnumConverter.cs
- SoapSchemaExporter.cs
- TypeReference.cs
- OneToOneMappingSerializer.cs
- TableItemPattern.cs
- Link.cs
- VBIdentifierName.cs
- DPAPIProtectedConfigurationProvider.cs
- IdnElement.cs
- IgnoreSectionHandler.cs
- XmlDataSource.cs
- InitialServerConnectionReader.cs
- XslAst.cs
- XsltContext.cs
- WasAdminWrapper.cs
- QueryOpcode.cs
- DataBindingExpressionBuilder.cs
- WebControlsSection.cs