Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IgnoreDataMemberAttribute.cs
- ObjectConverter.cs
- ConfigXmlComment.cs
- ProtocolInformationReader.cs
- AnnotationDocumentPaginator.cs
- DocumentOrderQuery.cs
- AppearanceEditorPart.cs
- X509SecurityTokenParameters.cs
- HeaderedItemsControl.cs
- Main.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- WrapperSecurityCommunicationObject.cs
- ResXBuildProvider.cs
- XmlAttributeCollection.cs
- DataListItem.cs
- BaseParagraph.cs
- GraphicsContainer.cs
- ETagAttribute.cs
- FlowLayoutPanel.cs
- ModifiableIteratorCollection.cs
- DependencyProperty.cs
- UnsafeNativeMethods.cs
- DataGridViewColumn.cs
- SimpleWebHandlerParser.cs
- SmiEventSink_DeferedProcessing.cs
- BitmapEffectrendercontext.cs
- OptimalTextSource.cs
- SymbolDocumentGenerator.cs
- XsltContext.cs
- SignedPkcs7.cs
- DetailsViewDeletedEventArgs.cs
- CompositeCollection.cs
- ExpressionPrefixAttribute.cs
- WmlFormAdapter.cs
- GridViewRow.cs
- SR.Designer.cs
- TextInfo.cs
- ImageAttributes.cs
- HttpPostedFileWrapper.cs
- ElementAction.cs
- HierarchicalDataSourceControl.cs
- DiscoveryRequestHandler.cs
- ActivityDesigner.cs
- ClientFactory.cs
- BoolLiteral.cs
- X509CertificateCollection.cs
- DelegatingTypeDescriptionProvider.cs
- GridItemCollection.cs
- ZipFileInfoCollection.cs
- Identity.cs
- MembershipPasswordException.cs
- ServiceModelInstallComponent.cs
- ObjectStorage.cs
- WebConfigurationManager.cs
- ActivityStatusChangeEventArgs.cs
- AssociatedControlConverter.cs
- ToolStripSplitButton.cs
- ViewKeyConstraint.cs
- safePerfProviderHandle.cs
- KeyValueInternalCollection.cs
- FamilyCollection.cs
- LambdaCompiler.Expressions.cs
- TdsParserSafeHandles.cs
- InfoCardRSACryptoProvider.cs
- TargetConverter.cs
- VirtualizingPanel.cs
- XmlDictionaryString.cs
- Encoder.cs
- XPathDocumentNavigator.cs
- DetailsViewCommandEventArgs.cs
- GeneratedCodeAttribute.cs
- LayoutEvent.cs
- ConsoleCancelEventArgs.cs
- MULTI_QI.cs
- VisualProxy.cs
- ClusterSafeNativeMethods.cs
- UIAgentCrashedException.cs
- ComplexType.cs
- AsyncResult.cs
- FileSystemEnumerable.cs
- DesignTimeParseData.cs
- SystemColorTracker.cs
- XmlStreamStore.cs
- WpfPayload.cs
- ControlBuilder.cs
- _CacheStreams.cs
- WebPartMinimizeVerb.cs
- GridViewDeleteEventArgs.cs
- SymbolMethod.cs
- DetailsViewUpdateEventArgs.cs
- Thumb.cs
- WebPartConnection.cs
- ManagementScope.cs
- ThemeableAttribute.cs
- XmlTextWriter.cs
- DesignerTransactionCloseEvent.cs
- FieldNameLookup.cs
- CheckBoxList.cs
- IDispatchConstantAttribute.cs
- ControlCodeDomSerializer.cs