Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / PropertyGridInternal / GridEntryCollection.cs / 1 / 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
- HandledMouseEvent.cs
- input.cs
- PartialCachingControl.cs
- Vector3dCollection.cs
- ImpersonationContext.cs
- NativeMethods.cs
- UrlRoutingModule.cs
- ping.cs
- CodeObject.cs
- StatementContext.cs
- WinEventWrap.cs
- AdRotator.cs
- WebAdminConfigurationHelper.cs
- UniqueIdentifierService.cs
- Misc.cs
- XPathDocumentIterator.cs
- SpellerStatusTable.cs
- OdbcException.cs
- ShapingWorkspace.cs
- TextEditorCharacters.cs
- HttpVersion.cs
- DependencyObjectPropertyDescriptor.cs
- DataGridViewSortCompareEventArgs.cs
- shaper.cs
- DateTimeOffsetAdapter.cs
- ChannelManager.cs
- ExpressionConverter.cs
- AnimatedTypeHelpers.cs
- TypeToArgumentTypeConverter.cs
- XmlQuerySequence.cs
- SqlCacheDependencyDatabaseCollection.cs
- DatagridviewDisplayedBandsData.cs
- OletxDependentTransaction.cs
- RepeaterDataBoundAdapter.cs
- PropertyDescriptor.cs
- Section.cs
- DesignerSelectionListAdapter.cs
- ProtocolsConfigurationEntry.cs
- SHA512CryptoServiceProvider.cs
- BinarySecretSecurityToken.cs
- ProcessModuleCollection.cs
- SimpleWorkerRequest.cs
- InkCanvasSelectionAdorner.cs
- HttpPostedFile.cs
- ClientCultureInfo.cs
- InteropAutomationProvider.cs
- RawUIStateInputReport.cs
- BaseCollection.cs
- ConnectionPoolManager.cs
- CommittableTransaction.cs
- EntityKey.cs
- PanningMessageFilter.cs
- CounterCreationDataCollection.cs
- Subordinate.cs
- FlowDocumentScrollViewer.cs
- AssemblyBuilder.cs
- FrameworkElementFactoryMarkupObject.cs
- InputReportEventArgs.cs
- TableRow.cs
- BitmapDecoder.cs
- tibetanshape.cs
- ColumnPropertiesGroup.cs
- ConfigurationElement.cs
- BehaviorDragDropEventArgs.cs
- DataGridRelationshipRow.cs
- ProtectedConfiguration.cs
- ContentElement.cs
- FeatureSupport.cs
- UrlMappingCollection.cs
- DbProviderFactoriesConfigurationHandler.cs
- LabelLiteral.cs
- SizeValueSerializer.cs
- HttpSessionStateBase.cs
- XpsSerializerWriter.cs
- PropertyIDSet.cs
- DecoderBestFitFallback.cs
- ButtonBase.cs
- SiteMapHierarchicalDataSourceView.cs
- ProxyManager.cs
- ConfigViewGenerator.cs
- EncoderParameters.cs
- MobileFormsAuthentication.cs
- LinqDataSourceEditData.cs
- XsltConvert.cs
- HtmlLabelAdapter.cs
- AssemblyBuilderData.cs
- DataObject.cs
- DbConnectionPoolIdentity.cs
- FullTextState.cs
- FtpCachePolicyElement.cs
- BackStopAuthenticationModule.cs
- GridViewRow.cs
- ScrollItemProviderWrapper.cs
- FormattedText.cs
- VScrollProperties.cs
- EventLog.cs
- DataMemberListEditor.cs
- InvalidAsynchronousStateException.cs
- KeyEventArgs.cs
- ProcessHostMapPath.cs