Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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.
//
//-----------------------------------------------------------------------------
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CollectionDataContract.cs
- PolyLineSegment.cs
- QueryOpeningEnumerator.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- XmlSchemaComplexContentExtension.cs
- UnsafeNativeMethods.cs
- MSG.cs
- RequestDescription.cs
- DateTimeFormatInfo.cs
- ProgressBarBrushConverter.cs
- DataObjectAttribute.cs
- TabControl.cs
- Attributes.cs
- PolicyLevel.cs
- BaseHashHelper.cs
- IndexOutOfRangeException.cs
- ScrollPattern.cs
- SqlComparer.cs
- ViewEvent.cs
- MiniModule.cs
- FixedTextContainer.cs
- SchemeSettingElementCollection.cs
- PeerNameRegistration.cs
- EntityAdapter.cs
- WebExceptionStatus.cs
- StreamGeometryContext.cs
- TaskExceptionHolder.cs
- MemberDescriptor.cs
- TextHidden.cs
- WindowsIPAddress.cs
- GeneralTransformGroup.cs
- GestureRecognizer.cs
- WasNotInstalledException.cs
- XmlComplianceUtil.cs
- CriticalHandle.cs
- SqlNode.cs
- BitmapEffectDrawingContextWalker.cs
- StringFunctions.cs
- PlatformCulture.cs
- ChannelSettingsElement.cs
- DragEvent.cs
- ProcessThread.cs
- AssemblyCollection.cs
- EventItfInfo.cs
- FormsAuthenticationTicket.cs
- AssertUtility.cs
- DecimalFormatter.cs
- IISUnsafeMethods.cs
- FunctionDetailsReader.cs
- SubMenuStyleCollection.cs
- FeatureSupport.cs
- BlobPersonalizationState.cs
- TextBlock.cs
- columnmapfactory.cs
- SingleKeyFrameCollection.cs
- _emptywebproxy.cs
- GrabHandleGlyph.cs
- NextPreviousPagerField.cs
- DesignOnlyAttribute.cs
- XamlTypeMapper.cs
- XmlQuerySequence.cs
- TextEditor.cs
- UnknownWrapper.cs
- DrawingContextDrawingContextWalker.cs
- SystemIPInterfaceStatistics.cs
- PagerSettings.cs
- CultureInfoConverter.cs
- CheckPair.cs
- FlowDocument.cs
- RegistryKey.cs
- ThreadPool.cs
- SerializationStore.cs
- XmlSerializerFactory.cs
- ContextToken.cs
- Span.cs
- PermissionRequestEvidence.cs
- DispatcherExceptionFilterEventArgs.cs
- Converter.cs
- XmlMapping.cs
- BufferedGraphicsContext.cs
- TemplateBindingExtensionConverter.cs
- QueryableDataSourceEditData.cs
- DataGridViewCellValidatingEventArgs.cs
- ListControlStringCollectionEditor.cs
- Column.cs
- SiteMapDataSourceView.cs
- EasingFunctionBase.cs
- SemanticResultKey.cs
- LambdaCompiler.ControlFlow.cs
- BlockCollection.cs
- SafeSecurityHelper.cs
- EntityTransaction.cs
- GeometryHitTestResult.cs
- Repeater.cs
- CompoundFileReference.cs
- MeasurementDCInfo.cs
- TrustLevel.cs
- ByteKeyFrameCollection.cs
- CodeEventReferenceExpression.cs
- EditorZoneBase.cs