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
- DataKeyCollection.cs
- Msec.cs
- MouseEventArgs.cs
- RadialGradientBrush.cs
- RepeaterItem.cs
- RemoteHelper.cs
- TheQuery.cs
- MouseOverProperty.cs
- Region.cs
- SortKey.cs
- DesignTimeParseData.cs
- EntityRecordInfo.cs
- DocumentApplicationJournalEntryEventArgs.cs
- DesignerDataTableBase.cs
- HeaderUtility.cs
- StringOutput.cs
- WebPartExportVerb.cs
- DataGridParentRows.cs
- DiscriminatorMap.cs
- RootCodeDomSerializer.cs
- ExceptionNotification.cs
- WebPageTraceListener.cs
- GridToolTip.cs
- _UriSyntax.cs
- DocumentsTrace.cs
- ExchangeUtilities.cs
- HttpCacheParams.cs
- StrongNameIdentityPermission.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- XmlEventCache.cs
- ApplicationFileParser.cs
- DataGridRowClipboardEventArgs.cs
- EventBuilder.cs
- Opcode.cs
- InternalResources.cs
- DesignTimeTemplateParser.cs
- RewritingPass.cs
- FileDialogCustomPlacesCollection.cs
- TypeBuilderInstantiation.cs
- DetailsViewUpdatedEventArgs.cs
- SqlBulkCopyColumnMappingCollection.cs
- RegexBoyerMoore.cs
- Bidi.cs
- HttpDebugHandler.cs
- DecimalStorage.cs
- PropertyDescriptorGridEntry.cs
- DeclarativeCatalogPart.cs
- TraceListeners.cs
- XNameTypeConverter.cs
- MergePropertyDescriptor.cs
- RuntimeArgumentHandle.cs
- XmlFormatReaderGenerator.cs
- Vector3DCollection.cs
- PngBitmapEncoder.cs
- DrawingGroup.cs
- DataGridSortCommandEventArgs.cs
- MessageRpc.cs
- FieldAccessException.cs
- IntranetCredentialPolicy.cs
- CodeVariableReferenceExpression.cs
- ViewDesigner.cs
- DataSourceSelectArguments.cs
- PointLight.cs
- FormatSettings.cs
- ButtonChrome.cs
- AuthStoreRoleProvider.cs
- ObsoleteAttribute.cs
- FormsAuthenticationConfiguration.cs
- ClientTargetSection.cs
- MasterPageParser.cs
- TaskFormBase.cs
- ObjectToken.cs
- ConfigurationSectionCollection.cs
- ResponseBodyWriter.cs
- ListViewSortEventArgs.cs
- thaishape.cs
- httpserverutility.cs
- CalendarDateRangeChangingEventArgs.cs
- DataColumnChangeEvent.cs
- ClientApiGenerator.cs
- DeviceContext2.cs
- WorkflowApplicationCompletedException.cs
- CacheModeConverter.cs
- TriggerAction.cs
- AudioDeviceOut.cs
- TableHeaderCell.cs
- AtlasWeb.Designer.cs
- InkCanvasSelectionAdorner.cs
- Gdiplus.cs
- GridToolTip.cs
- TableLayoutStyle.cs
- AutoGeneratedField.cs
- MtomMessageEncoder.cs
- FieldMetadata.cs
- JavascriptCallbackMessageInspector.cs
- ExtendedPropertyCollection.cs
- SmtpException.cs
- CurrencyWrapper.cs
- ObfuscateAssemblyAttribute.cs
- SqlClientMetaDataCollectionNames.cs