Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewSelectedRowCollection.cs / 1305376 / DataGridViewSelectedRowCollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms
{
using System.Diagnostics;
using System;
using System.Collections;
using System.Windows.Forms;
using System.ComponentModel;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
///
///
/// Represents a collection of selected objects in the
/// control.
///
[
ListBindable(false),
SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface") // Consider adding an IList implementation
]
public class DataGridViewSelectedRowCollection : BaseCollection, IList
{
ArrayList items = new ArrayList();
///
///
int IList.Add(object value)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
void IList.Clear()
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
bool IList.Contains(object value)
{
return this.items.Contains(value);
}
///
///
int IList.IndexOf(object value)
{
return this.items.IndexOf(value);
}
///
///
void IList.Insert(int index, object value)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
void IList.Remove(object value)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
void IList.RemoveAt(int index)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
bool IList.IsFixedSize
{
get { return true; }
}
///
///
bool IList.IsReadOnly
{
get { return true; }
}
///
///
object IList.this[int index]
{
get { return this.items[index]; }
set { throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection)); }
}
///
///
void ICollection.CopyTo(Array array, int index)
{
this.items.CopyTo(array, index);
}
///
///
int ICollection.Count
{
get { return this.items.Count; }
}
///
///
bool ICollection.IsSynchronized
{
get { return false; }
}
///
///
object ICollection.SyncRoot
{
get { return this; }
}
///
///
IEnumerator IEnumerable.GetEnumerator()
{
return this.items.GetEnumerator();
}
internal DataGridViewSelectedRowCollection()
{
}
///
protected override ArrayList List
{
get
{
return this.items;
}
}
///
public DataGridViewRow this[int index]
{
get
{
return (DataGridViewRow) this.items[index];
}
}
///
///
/// Adds a to this collection.
///
internal int Add(DataGridViewRow dataGridViewRow)
{
return this.items.Add(dataGridViewRow);
}
/* Unused at this point
internal void AddRange(DataGridViewRow[] dataGridViewRows)
{
Debug.Assert(dataGridViewRows != null);
foreach(DataGridViewRow dataGridViewRow in dataGridViewRows)
{
this.items.Add(dataGridViewRow);
}
}
internal void AddRowCollection(DataGridViewRowCollection dataGridViewRows)
{
Debug.Assert(dataGridViewRows != null);
foreach(DataGridViewRow dataGridViewRow in dataGridViewRows)
{
this.items.Add(dataGridViewRow);
}
}
*/
///
[
EditorBrowsable(EditorBrowsableState.Never)
]
public void Clear()
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
/// Checks to see if a DataGridViewCell is contained in this collection.
///
public bool Contains(DataGridViewRow dataGridViewRow)
{
return this.items.IndexOf(dataGridViewRow) != -1;
}
///
public void CopyTo(DataGridViewRow[] array, int index)
{
this.items.CopyTo(array, index);
}
///
[
EditorBrowsable(EditorBrowsableState.Never),
SuppressMessage("Microsoft.Performance", "CA1801:AvoidUnusedParameters")
]
public void Insert(int index, DataGridViewRow dataGridViewRow)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
}
}
// 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.Collections;
using System.Windows.Forms;
using System.ComponentModel;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
///
///
/// Represents a collection of selected objects in the
/// control.
///
[
ListBindable(false),
SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface") // Consider adding an IList implementation
]
public class DataGridViewSelectedRowCollection : BaseCollection, IList
{
ArrayList items = new ArrayList();
///
///
int IList.Add(object value)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
void IList.Clear()
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
bool IList.Contains(object value)
{
return this.items.Contains(value);
}
///
///
int IList.IndexOf(object value)
{
return this.items.IndexOf(value);
}
///
///
void IList.Insert(int index, object value)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
void IList.Remove(object value)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
void IList.RemoveAt(int index)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
bool IList.IsFixedSize
{
get { return true; }
}
///
///
bool IList.IsReadOnly
{
get { return true; }
}
///
///
object IList.this[int index]
{
get { return this.items[index]; }
set { throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection)); }
}
///
///
void ICollection.CopyTo(Array array, int index)
{
this.items.CopyTo(array, index);
}
///
///
int ICollection.Count
{
get { return this.items.Count; }
}
///
///
bool ICollection.IsSynchronized
{
get { return false; }
}
///
///
object ICollection.SyncRoot
{
get { return this; }
}
///
///
IEnumerator IEnumerable.GetEnumerator()
{
return this.items.GetEnumerator();
}
internal DataGridViewSelectedRowCollection()
{
}
///
protected override ArrayList List
{
get
{
return this.items;
}
}
///
public DataGridViewRow this[int index]
{
get
{
return (DataGridViewRow) this.items[index];
}
}
///
///
/// Adds a to this collection.
///
internal int Add(DataGridViewRow dataGridViewRow)
{
return this.items.Add(dataGridViewRow);
}
/* Unused at this point
internal void AddRange(DataGridViewRow[] dataGridViewRows)
{
Debug.Assert(dataGridViewRows != null);
foreach(DataGridViewRow dataGridViewRow in dataGridViewRows)
{
this.items.Add(dataGridViewRow);
}
}
internal void AddRowCollection(DataGridViewRowCollection dataGridViewRows)
{
Debug.Assert(dataGridViewRows != null);
foreach(DataGridViewRow dataGridViewRow in dataGridViewRows)
{
this.items.Add(dataGridViewRow);
}
}
*/
///
[
EditorBrowsable(EditorBrowsableState.Never)
]
public void Clear()
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
///
///
/// Checks to see if a DataGridViewCell is contained in this collection.
///
public bool Contains(DataGridViewRow dataGridViewRow)
{
return this.items.IndexOf(dataGridViewRow) != -1;
}
///
public void CopyTo(DataGridViewRow[] array, int index)
{
this.items.CopyTo(array, index);
}
///
[
EditorBrowsable(EditorBrowsableState.Never),
SuppressMessage("Microsoft.Performance", "CA1801:AvoidUnusedParameters")
]
public void Insert(int index, DataGridViewRow dataGridViewRow)
{
throw new NotSupportedException(SR.GetString(SR.DataGridView_ReadOnlyCollection));
}
}
}
// 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
- LineServicesRun.cs
- PolyLineSegment.cs
- Peer.cs
- _SSPISessionCache.cs
- Point3DCollection.cs
- MessageSecurityVersion.cs
- IdnElement.cs
- SqlCachedBuffer.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ViewEventArgs.cs
- OleTxTransactionInfo.cs
- CharAnimationUsingKeyFrames.cs
- FormatException.cs
- Freezable.cs
- CodeMemberEvent.cs
- Route.cs
- MulticastOption.cs
- EdmItemCollection.cs
- RelationshipNavigation.cs
- OleDbParameter.cs
- TraceFilter.cs
- SwitchLevelAttribute.cs
- MsmqAppDomainProtocolHandler.cs
- JournalEntry.cs
- ChameleonKey.cs
- ExpressionEditorAttribute.cs
- SelectionPattern.cs
- NumberAction.cs
- DataServiceException.cs
- XmlNamespaceMapping.cs
- DbFunctionCommandTree.cs
- MainMenu.cs
- HashAlgorithm.cs
- MatchingStyle.cs
- Transactions.cs
- ActiveXHelper.cs
- FontStyle.cs
- DataGridViewRowPrePaintEventArgs.cs
- FlowDecisionDesigner.xaml.cs
- InArgument.cs
- CalloutQueueItem.cs
- OverrideMode.cs
- DataView.cs
- DataGridViewCheckBoxColumn.cs
- ReferenceConverter.cs
- Pens.cs
- FirstMatchCodeGroup.cs
- InertiaRotationBehavior.cs
- IUnknownConstantAttribute.cs
- TemplateLookupAction.cs
- ZoneLinkButton.cs
- TableLayoutPanelBehavior.cs
- TypeConstant.cs
- MapPathBasedVirtualPathProvider.cs
- TagMapCollection.cs
- AddingNewEventArgs.cs
- DrawItemEvent.cs
- ImageField.cs
- DefaultTraceListener.cs
- RoutedPropertyChangedEventArgs.cs
- FacetValueContainer.cs
- XmlSchemaParticle.cs
- ThousandthOfEmRealPoints.cs
- TableCellAutomationPeer.cs
- MiniLockedBorderGlyph.cs
- PropertyTab.cs
- XmlSchemaExternal.cs
- StsCommunicationException.cs
- RepeaterItemCollection.cs
- OleDbFactory.cs
- Int32RectValueSerializer.cs
- Application.cs
- Aes.cs
- ConfigXmlCDataSection.cs
- JsonReader.cs
- SrgsDocument.cs
- WinEventTracker.cs
- LiteralControl.cs
- UpdateCommandGenerator.cs
- DataGridRowAutomationPeer.cs
- SchemaExporter.cs
- RuntimeConfigurationRecord.cs
- ComAdminWrapper.cs
- EraserBehavior.cs
- CompiledELinqQueryState.cs
- SymbolEqualComparer.cs
- Polyline.cs
- RuleElement.cs
- HttpTransportElement.cs
- ImageConverter.cs
- WindowsMenu.cs
- PictureBoxDesigner.cs
- FixedSchema.cs
- HitTestWithPointDrawingContextWalker.cs
- NegotiateStream.cs
- SamlAuthenticationStatement.cs
- RenderOptions.cs
- CollectionCodeDomSerializer.cs
- BooleanFunctions.cs
- ImageDrawing.cs