Code:
/ FX-1434 / FX-1434 / 1.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
- ComponentManagerBroker.cs
- ComNativeDescriptor.cs
- DataConnectionHelper.cs
- XmlDataImplementation.cs
- mactripleDES.cs
- Point3D.cs
- DbgUtil.cs
- InstanceLockLostException.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SoapRpcServiceAttribute.cs
- EventSinkActivityDesigner.cs
- DoubleAnimationUsingKeyFrames.cs
- CompositeCollectionView.cs
- Operand.cs
- PingReply.cs
- DateTimeParse.cs
- Expression.cs
- UrlPath.cs
- EventLog.cs
- RegionData.cs
- TextServicesPropertyRanges.cs
- GlyphManager.cs
- TextMetrics.cs
- DropSource.cs
- SemanticAnalyzer.cs
- MessageSmuggler.cs
- AssociationTypeEmitter.cs
- TextViewSelectionProcessor.cs
- MailWriter.cs
- HttpGetProtocolImporter.cs
- FixedPageStructure.cs
- _FtpControlStream.cs
- PartialTrustVisibleAssembliesSection.cs
- WebPartMenu.cs
- DocumentSequence.cs
- WsdlWriter.cs
- TagPrefixCollection.cs
- DataRow.cs
- CharacterString.cs
- DocumentGrid.cs
- ActiveXHelper.cs
- AlternateViewCollection.cs
- SamlConstants.cs
- ChainOfResponsibility.cs
- XmlSchemaRedefine.cs
- TreeNodeStyleCollection.cs
- selecteditemcollection.cs
- SoapIncludeAttribute.cs
- X509Certificate2.cs
- XmlSchemaSimpleType.cs
- SerializationInfo.cs
- MultipartContentParser.cs
- Screen.cs
- HelpInfo.cs
- XmlSchemaComplexContent.cs
- GridSplitterAutomationPeer.cs
- SrgsElementFactory.cs
- GlobalItem.cs
- SimpleNameService.cs
- DetailsViewDeleteEventArgs.cs
- InkCanvasSelectionAdorner.cs
- DictionaryBase.cs
- NavigationProgressEventArgs.cs
- XmlSchemaSimpleTypeList.cs
- FunctionQuery.cs
- _StreamFramer.cs
- ExecutionEngineException.cs
- TabPage.cs
- HighlightVisual.cs
- MembershipUser.cs
- Debug.cs
- ProgressBarAutomationPeer.cs
- ApplicationContext.cs
- WorkflowMessageEventHandler.cs
- RemoteArgument.cs
- NameService.cs
- HealthMonitoringSectionHelper.cs
- PatternMatcher.cs
- RotationValidation.cs
- PointAnimation.cs
- TripleDES.cs
- PathFigureCollectionConverter.cs
- __Filters.cs
- RegionInfo.cs
- ArcSegment.cs
- AppDomainGrammarProxy.cs
- WebBrowser.cs
- XmlSchemaComplexContent.cs
- SqlInternalConnectionTds.cs
- LinearGradientBrush.cs
- DummyDataSource.cs
- DataGridViewTextBoxCell.cs
- FileUtil.cs
- MatrixTransform3D.cs
- VerticalAlignConverter.cs
- ErrorEventArgs.cs
- WindowHelperService.cs
- RandomNumberGenerator.cs
- SoapFault.cs
- RSAOAEPKeyExchangeDeformatter.cs