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
- StrongNameMembershipCondition.cs
- BindStream.cs
- WebReferenceOptions.cs
- SecondaryIndexList.cs
- CornerRadius.cs
- GradientStopCollection.cs
- FormViewCommandEventArgs.cs
- GeometryConverter.cs
- TargetControlTypeAttribute.cs
- OutputCacheSettingsSection.cs
- ColumnPropertiesGroup.cs
- OptionalMessageQuery.cs
- VectorConverter.cs
- ApplicationActivator.cs
- BlockCollection.cs
- PersonalizationState.cs
- GridViewItemAutomationPeer.cs
- ProxyAttribute.cs
- FormViewInsertEventArgs.cs
- SingleConverter.cs
- InstanceHandleReference.cs
- MappingItemCollection.cs
- CheckBoxAutomationPeer.cs
- RegionInfo.cs
- ObjectDataSource.cs
- _ShellExpression.cs
- FixedFindEngine.cs
- LazyTextWriterCreator.cs
- DataControlButton.cs
- CheckedPointers.cs
- UrlPath.cs
- CryptoConfig.cs
- ExpandSegment.cs
- Separator.cs
- MimeTypeMapper.cs
- EdmFunctions.cs
- SystemInfo.cs
- ToolStripButton.cs
- FileCodeGroup.cs
- ConnectionPoint.cs
- GeometryGroup.cs
- UidPropertyAttribute.cs
- CapacityStreamGeometryContext.cs
- SafeProcessHandle.cs
- MutexSecurity.cs
- SQLSingle.cs
- Constraint.cs
- XmlWrappingReader.cs
- Repeater.cs
- XPathArrayIterator.cs
- externdll.cs
- UnsafeNativeMethods.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- FocusWithinProperty.cs
- ChtmlTextBoxAdapter.cs
- DurableEnlistmentState.cs
- MenuBase.cs
- HMACSHA256.cs
- ThicknessAnimationBase.cs
- MergeFailedEvent.cs
- ReaderContextStackData.cs
- TextBoxLine.cs
- SubtreeProcessor.cs
- TextElementEditingBehaviorAttribute.cs
- XmlUtil.cs
- Error.cs
- AlignmentXValidation.cs
- TypeRefElement.cs
- SafeRightsManagementQueryHandle.cs
- SqlStream.cs
- UserPersonalizationStateInfo.cs
- ToolStripItemDesigner.cs
- UserPersonalizationStateInfo.cs
- WrappedIUnknown.cs
- BasicBrowserDialog.cs
- ThreadStartException.cs
- FilterableAttribute.cs
- OleDbSchemaGuid.cs
- TranslateTransform.cs
- XamlReaderHelper.cs
- SelectiveScrollingGrid.cs
- SelectionHighlightInfo.cs
- BufferedGraphics.cs
- TrueReadOnlyCollection.cs
- RegexMatchCollection.cs
- XmlParserContext.cs
- DataControlFieldTypeEditor.cs
- WindowsStatusBar.cs
- SQLSingleStorage.cs
- RemoveStoryboard.cs
- RegexGroup.cs
- InvalidOleVariantTypeException.cs
- CodeStatement.cs
- FormsAuthenticationCredentials.cs
- NavigatingCancelEventArgs.cs
- ModuleElement.cs
- CacheMemory.cs
- StrokeNodeData.cs
- ToolStripItemEventArgs.cs
- SelectedDatesCollection.cs