Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewSelectedCellCollection.cs / 1 / DataGridViewSelectedCellCollection.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 DataGridViewSelectedCellCollection : 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 DataGridViewSelectedCellCollection()
{
}
///
protected override ArrayList List
{
get
{
return this.items;
}
}
///
public DataGridViewCell this[int index]
{
get
{
return (DataGridViewCell) this.items[index];
}
}
///
///
/// Adds a to this collection.
///
internal int Add(DataGridViewCell dataGridViewCell)
{
Debug.Assert(!Contains(dataGridViewCell));
return this.items.Add(dataGridViewCell);
}
/* Not used for now
internal void AddRange(DataGridViewCell[] dataGridViewCells)
{
Debug.Assert(dataGridViewCells != null);
foreach(DataGridViewCell dataGridViewCell in dataGridViewCells)
{
Debug.Assert(!Contains(dataGridViewCell));
this.items.Add(dataGridViewCell);
}
}
internal void AddCellCollection(DataGridViewSelectedCellCollection dataGridViewCells)
{
Debug.Assert(dataGridViewCells != null);
foreach(DataGridViewCell dataGridViewCell in dataGridViewCells)
{
Debug.Assert(!Contains(dataGridViewCell));
this.items.Add(dataGridViewCell);
}
}
*/
///
///
/// Adds all the objects from the provided linked list to this collection.
///
internal void AddCellLinkedList(DataGridViewCellLinkedList dataGridViewCells)
{
Debug.Assert(dataGridViewCells != null);
foreach (DataGridViewCell dataGridViewCell in dataGridViewCells)
{
Debug.Assert(!Contains(dataGridViewCell));
this.items.Add(dataGridViewCell);
}
}
///
[
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(DataGridViewCell dataGridViewCell)
{
return this.items.IndexOf(dataGridViewCell) != -1;
}
///
public void CopyTo(DataGridViewCell[] array, int index)
{
this.items.CopyTo(array, index);
}
///
[
EditorBrowsable(EditorBrowsableState.Never),
SuppressMessage("Microsoft.Performance", "CA1801:AvoidUnusedParameters")
]
public void Insert(int index, DataGridViewCell dataGridViewCell)
{
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 DataGridViewSelectedCellCollection : 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 DataGridViewSelectedCellCollection()
{
}
///
protected override ArrayList List
{
get
{
return this.items;
}
}
///
public DataGridViewCell this[int index]
{
get
{
return (DataGridViewCell) this.items[index];
}
}
///
///
/// Adds a to this collection.
///
internal int Add(DataGridViewCell dataGridViewCell)
{
Debug.Assert(!Contains(dataGridViewCell));
return this.items.Add(dataGridViewCell);
}
/* Not used for now
internal void AddRange(DataGridViewCell[] dataGridViewCells)
{
Debug.Assert(dataGridViewCells != null);
foreach(DataGridViewCell dataGridViewCell in dataGridViewCells)
{
Debug.Assert(!Contains(dataGridViewCell));
this.items.Add(dataGridViewCell);
}
}
internal void AddCellCollection(DataGridViewSelectedCellCollection dataGridViewCells)
{
Debug.Assert(dataGridViewCells != null);
foreach(DataGridViewCell dataGridViewCell in dataGridViewCells)
{
Debug.Assert(!Contains(dataGridViewCell));
this.items.Add(dataGridViewCell);
}
}
*/
///
///
/// Adds all the objects from the provided linked list to this collection.
///
internal void AddCellLinkedList(DataGridViewCellLinkedList dataGridViewCells)
{
Debug.Assert(dataGridViewCells != null);
foreach (DataGridViewCell dataGridViewCell in dataGridViewCells)
{
Debug.Assert(!Contains(dataGridViewCell));
this.items.Add(dataGridViewCell);
}
}
///
[
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(DataGridViewCell dataGridViewCell)
{
return this.items.IndexOf(dataGridViewCell) != -1;
}
///
public void CopyTo(DataGridViewCell[] array, int index)
{
this.items.CopyTo(array, index);
}
///
[
EditorBrowsable(EditorBrowsableState.Never),
SuppressMessage("Microsoft.Performance", "CA1801:AvoidUnusedParameters")
]
public void Insert(int index, DataGridViewCell dataGridViewCell)
{
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
- ISO2022Encoding.cs
- Unit.cs
- TreeWalkHelper.cs
- DataServiceKeyAttribute.cs
- TextEditorCopyPaste.cs
- DateTimeValueSerializer.cs
- ListViewItemEventArgs.cs
- PreloadHost.cs
- ECDiffieHellmanCng.cs
- UserInitiatedNavigationPermission.cs
- SystemInfo.cs
- MULTI_QI.cs
- OuterGlowBitmapEffect.cs
- GradientPanel.cs
- TabRenderer.cs
- SourceInterpreter.cs
- BridgeDataRecord.cs
- EventKeyword.cs
- ScriptResourceAttribute.cs
- StylusButton.cs
- DesignerDataColumn.cs
- SchemaAttDef.cs
- DPCustomTypeDescriptor.cs
- GraphicsPathIterator.cs
- RoleService.cs
- IsolationInterop.cs
- LassoHelper.cs
- Column.cs
- EventSetter.cs
- LocalizationComments.cs
- WinFormsSpinner.cs
- PathSegment.cs
- handlecollector.cs
- HttpProfileGroupBase.cs
- FixedHyperLink.cs
- CounterSampleCalculator.cs
- TextPatternIdentifiers.cs
- TabItem.cs
- TextSerializer.cs
- TableLayoutRowStyleCollection.cs
- RelationshipEntry.cs
- StorageRoot.cs
- StrongNameIdentityPermission.cs
- SignatureToken.cs
- WebSysDescriptionAttribute.cs
- Int64.cs
- FormsAuthenticationEventArgs.cs
- GenericPrincipal.cs
- XmlUrlResolver.cs
- TraceHandler.cs
- Unit.cs
- _SslStream.cs
- InternalBufferOverflowException.cs
- ErrorFormatter.cs
- MaskDesignerDialog.cs
- BaseCAMarshaler.cs
- StopStoryboard.cs
- ValueTable.cs
- AssemblyAttributes.cs
- ProcessManager.cs
- InstanceDataCollection.cs
- BufferModesCollection.cs
- HwndSource.cs
- _SSPISessionCache.cs
- ContentIterators.cs
- EventSourceCreationData.cs
- XMLUtil.cs
- PtsContext.cs
- FtpCachePolicyElement.cs
- IdleTimeoutMonitor.cs
- SmtpNegotiateAuthenticationModule.cs
- CopyNamespacesAction.cs
- SafeHandle.cs
- WorkflowInstanceAbortedRecord.cs
- LinqDataSourceHelper.cs
- PrincipalPermission.cs
- StoragePropertyMapping.cs
- HttpCookie.cs
- RelatedPropertyManager.cs
- FieldNameLookup.cs
- precedingsibling.cs
- SerializationSectionGroup.cs
- RangeValidator.cs
- Set.cs
- DefaultShape.cs
- SqlClientPermission.cs
- UIntPtr.cs
- AudioException.cs
- VerificationException.cs
- PasswordBoxAutomationPeer.cs
- Frame.cs
- AppLevelCompilationSectionCache.cs
- ExtensionSimplifierMarkupObject.cs
- DeleteHelper.cs
- RequestUriProcessor.cs
- AssemblyFilter.cs
- HtmlForm.cs
- XmlSchemaSimpleContent.cs
- ProfileInfo.cs
- PolyQuadraticBezierSegment.cs