Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / GridItemCollection.cs / 1 / GridItemCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.Windows.Forms.ComponentModel.Com2Interop;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms.PropertyGridInternal;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.Win32;
///
///
/// A read-only collection of GridItem objects
///
public class GridItemCollection : ICollection {
///
///
/// [To be supplied.]
///
public static GridItemCollection Empty = new GridItemCollection(new GridItem[0]);
internal GridItem[] entries;
internal GridItemCollection(GridItem[] entries) {
if (entries == null) {
this.entries = new GridItem[0];
}
else {
this.entries = entries;
}
}
///
///
/// Retrieves the number of member attributes.
///
public int Count {
get {
return entries.Length;
}
}
///
///
object ICollection.SyncRoot {
get {
return this;
}
}
///
///
bool ICollection.IsSynchronized {
get {
return false;
}
}
///
///
/// Retrieves the member attribute with the specified index.
///
public GridItem this[int index] {
get {
return entries[index];
}
}
///
///
/// [To be supplied.]
///
public GridItem this[string label]{
get {
foreach(GridItem g in entries) {
if (g.Label == label) {
return g;
}
}
return null;
}
}
///
///
void ICollection.CopyTo(Array dest, int index) {
if (entries.Length > 0) {
System.Array.Copy(entries, 0, dest, index, entries.Length);
}
}
///
///
/// Creates and retrieves a new enumerator for this collection.
///
public IEnumerator GetEnumerator() {
return entries.GetEnumerator();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripPanelCell.cs
- CompiledIdentityConstraint.cs
- MasterPageParser.cs
- SafeViewOfFileHandle.cs
- InternalSafeNativeMethods.cs
- HandlerBase.cs
- Single.cs
- WebPartRestoreVerb.cs
- BindingMemberInfo.cs
- MutexSecurity.cs
- TextSchema.cs
- ECDsaCng.cs
- DesignerWidgets.cs
- SchemaTableColumn.cs
- ClockGroup.cs
- _AuthenticationState.cs
- TextAdaptor.cs
- FieldTemplateFactory.cs
- Update.cs
- ComponentCollection.cs
- ErrorInfoXmlDocument.cs
- TrackingProfile.cs
- ExtendedProperty.cs
- WebColorConverter.cs
- CommonXSendMessage.cs
- ObjectHandle.cs
- DbConnectionClosed.cs
- ReferencedAssemblyResolver.cs
- FormsIdentity.cs
- Attributes.cs
- WebPartCollection.cs
- ApplicationId.cs
- ScrollChangedEventArgs.cs
- Console.cs
- CustomTypeDescriptor.cs
- DataGridCheckBoxColumn.cs
- XmlSchemaSearchPattern.cs
- BindingWorker.cs
- LineGeometry.cs
- MetadataConversionError.cs
- AnimationClock.cs
- JsonFormatMapping.cs
- SafePEFileHandle.cs
- GridViewSortEventArgs.cs
- SecurityPermission.cs
- XhtmlBasicSelectionListAdapter.cs
- PenLineJoinValidation.cs
- XmlConvert.cs
- BamlTreeNode.cs
- TokenBasedSetEnumerator.cs
- XamlReaderHelper.cs
- CapabilitiesState.cs
- Pair.cs
- UnmanagedMemoryStream.cs
- StateBag.cs
- AnnotationResource.cs
- FacetDescriptionElement.cs
- MobileUITypeEditor.cs
- ComboBoxItem.cs
- MetabaseServerConfig.cs
- GrammarBuilderRuleRef.cs
- PreloadedPackages.cs
- DocumentGridPage.cs
- PackageDigitalSignatureManager.cs
- AllMembershipCondition.cs
- ExceptionAggregator.cs
- AuthenticatedStream.cs
- PresentationAppDomainManager.cs
- ISAPIApplicationHost.cs
- NodeLabelEditEvent.cs
- LoginCancelEventArgs.cs
- WebPageTraceListener.cs
- BindValidationContext.cs
- SafeFindHandle.cs
- DragStartedEventArgs.cs
- Baml2006ReaderContext.cs
- InvalidComObjectException.cs
- Renderer.cs
- BaseServiceProvider.cs
- IdentityReference.cs
- LocatorBase.cs
- XmlSchemaObject.cs
- StateMachineDesignerPaint.cs
- InvalidProgramException.cs
- DataGridViewComboBoxColumn.cs
- FlowDocumentPageViewerAutomationPeer.cs
- ConfigurationSectionGroup.cs
- DesignOnlyAttribute.cs
- Contracts.cs
- PickBranch.cs
- HttpCapabilitiesBase.cs
- IISMapPath.cs
- FrameworkElementAutomationPeer.cs
- SqlTriggerContext.cs
- IItemProperties.cs
- DescendentsWalker.cs
- BitmapEncoder.cs
- UIElementPropertyUndoUnit.cs
- GeneralTransformCollection.cs
- IResourceProvider.cs