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
- AssemblyContextControlItem.cs
- ThreadStartException.cs
- SqlNodeAnnotations.cs
- HelpKeywordAttribute.cs
- DrawingGroup.cs
- SiteIdentityPermission.cs
- HitTestParameters.cs
- MetabaseReader.cs
- DataGridRow.cs
- SoapAttributes.cs
- SafeRightsManagementPubHandle.cs
- RunInstallerAttribute.cs
- NativeRecognizer.cs
- NetMsmqBindingElement.cs
- OutOfProcStateClientManager.cs
- Mouse.cs
- Int32Collection.cs
- DataGridBeginningEditEventArgs.cs
- EventBuilder.cs
- UserControlAutomationPeer.cs
- LinearKeyFrames.cs
- IFormattable.cs
- OpenTypeLayoutCache.cs
- StringResourceManager.cs
- EtwTrace.cs
- ObjectQuery.cs
- webbrowsersite.cs
- UserControlParser.cs
- HwndPanningFeedback.cs
- ArrangedElement.cs
- CodeVariableDeclarationStatement.cs
- FlowThrottle.cs
- UrlPath.cs
- XmlWriterSettings.cs
- UIntPtr.cs
- TransactionCache.cs
- IPPacketInformation.cs
- SerializationInfo.cs
- StdRegProviderWrapper.cs
- ProfessionalColorTable.cs
- ColumnCollection.cs
- ReflectionUtil.cs
- KeyGesture.cs
- XPathNodeInfoAtom.cs
- LabelDesigner.cs
- DbCommandDefinition.cs
- RequestTimeoutManager.cs
- NTAccount.cs
- RectKeyFrameCollection.cs
- NetworkCredential.cs
- OdbcConnectionPoolProviderInfo.cs
- EdmType.cs
- Vector3DAnimation.cs
- SoapInteropTypes.cs
- MergeFilterQuery.cs
- ZipIORawDataFileBlock.cs
- AuthenticationSection.cs
- CultureMapper.cs
- View.cs
- LambdaExpression.cs
- RunWorkerCompletedEventArgs.cs
- XmlSchemaIdentityConstraint.cs
- WebDescriptionAttribute.cs
- SyndicationFeedFormatter.cs
- ConnectionInterfaceCollection.cs
- SelectedDatesCollection.cs
- XsltInput.cs
- WindowsRebar.cs
- SafeCryptContextHandle.cs
- PrintPreviewDialog.cs
- MaskedTextBoxDesigner.cs
- Point4DConverter.cs
- ObjectDataSource.cs
- DockPatternIdentifiers.cs
- GenerateScriptTypeAttribute.cs
- SmuggledIUnknown.cs
- CategoryAttribute.cs
- BulletDecorator.cs
- RelationshipEndMember.cs
- ConditionalWeakTable.cs
- DesignerTextBoxAdapter.cs
- SkipQueryOptionExpression.cs
- IndexerNameAttribute.cs
- ValueUtilsSmi.cs
- InvokeProviderWrapper.cs
- HtmlShim.cs
- printdlgexmarshaler.cs
- HiddenFieldPageStatePersister.cs
- SrgsRule.cs
- NativeMethods.cs
- TimeSpanConverter.cs
- ProbeMatchesMessage11.cs
- PageSettings.cs
- SmiEventSink.cs
- XmlSchemaDatatype.cs
- IPAddress.cs
- XmlMtomWriter.cs
- SimpleTextLine.cs
- GraphicsState.cs
- TimeSpanFormat.cs