Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewSelectedColumnCollection.cs / 1 / DataGridViewSelectedColumnCollection.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;
///
[
ListBindable(false),
SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface") // Consider adding an IList implementation
]
public class DataGridViewSelectedColumnCollection : 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 DataGridViewSelectedColumnCollection()
{
}
///
protected override ArrayList List
{
get
{
return this.items;
}
}
///
public DataGridViewColumn this[int index]
{
get
{
return (DataGridViewColumn) this.items[index];
}
}
///
///
/// Adds a to this collection.
///
internal int Add(DataGridViewColumn dataGridViewColumn)
{
return this.items.Add(dataGridViewColumn);
}
/* Unused at this point
internal void AddRange(DataGridViewColumn[] dataGridViewColumns)
{
Debug.Assert(dataGridViewColumns != null);
foreach(DataGridViewColumn dataGridViewColumn in dataGridViewColumns)
{
this.items.Add(dataGridViewColumn);
}
}
*/
/* Unused at this point
internal void AddColumnCollection(DataGridViewColumnCollection dataGridViewColumns)
{
Debug.Assert(dataGridViewColumns != null);
foreach(DataGridViewColumn dataGridViewColumn in dataGridViewColumns)
{
this.items.Add(dataGridViewColumn);
}
}
*/
///
[
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(DataGridViewColumn dataGridViewColumn)
{
return this.items.IndexOf(dataGridViewColumn) != -1;
}
///
public void CopyTo(DataGridViewColumn[] array, int index)
{
this.items.CopyTo(array, index);
}
///
[
EditorBrowsable(EditorBrowsableState.Never),
SuppressMessage("Microsoft.Performance", "CA1801:AvoidUnusedParameters")
]
public void Insert(int index, DataGridViewColumn dataGridViewColumn)
{
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;
///
[
ListBindable(false),
SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface") // Consider adding an IList implementation
]
public class DataGridViewSelectedColumnCollection : 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 DataGridViewSelectedColumnCollection()
{
}
///
protected override ArrayList List
{
get
{
return this.items;
}
}
///
public DataGridViewColumn this[int index]
{
get
{
return (DataGridViewColumn) this.items[index];
}
}
///
///
/// Adds a to this collection.
///
internal int Add(DataGridViewColumn dataGridViewColumn)
{
return this.items.Add(dataGridViewColumn);
}
/* Unused at this point
internal void AddRange(DataGridViewColumn[] dataGridViewColumns)
{
Debug.Assert(dataGridViewColumns != null);
foreach(DataGridViewColumn dataGridViewColumn in dataGridViewColumns)
{
this.items.Add(dataGridViewColumn);
}
}
*/
/* Unused at this point
internal void AddColumnCollection(DataGridViewColumnCollection dataGridViewColumns)
{
Debug.Assert(dataGridViewColumns != null);
foreach(DataGridViewColumn dataGridViewColumn in dataGridViewColumns)
{
this.items.Add(dataGridViewColumn);
}
}
*/
///
[
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(DataGridViewColumn dataGridViewColumn)
{
return this.items.IndexOf(dataGridViewColumn) != -1;
}
///
public void CopyTo(DataGridViewColumn[] array, int index)
{
this.items.CopyTo(array, index);
}
///
[
EditorBrowsable(EditorBrowsableState.Never),
SuppressMessage("Microsoft.Performance", "CA1801:AvoidUnusedParameters")
]
public void Insert(int index, DataGridViewColumn dataGridViewColumn)
{
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
- MessageSmuggler.cs
- Point3DCollectionValueSerializer.cs
- TcpHostedTransportConfiguration.cs
- SelectionChangedEventArgs.cs
- ProcessInfo.cs
- COM2AboutBoxPropertyDescriptor.cs
- RefreshPropertiesAttribute.cs
- ScrollBarAutomationPeer.cs
- DataGridViewComboBoxCell.cs
- MultiTrigger.cs
- FileDetails.cs
- Model3D.cs
- PhonemeConverter.cs
- BitmapEffectDrawingContent.cs
- EventMappingSettingsCollection.cs
- ProfileServiceManager.cs
- BufferModeSettings.cs
- BamlReader.cs
- MetadataItem.cs
- WebPartDescription.cs
- PipeException.cs
- GridView.cs
- CollectionConverter.cs
- MobileCategoryAttribute.cs
- DocumentProperties.cs
- XmlComment.cs
- FileReader.cs
- Image.cs
- BindUriHelper.cs
- StringUtil.cs
- AppDomainFactory.cs
- IInstanceContextProvider.cs
- XmlSchemaAnyAttribute.cs
- DuplexSecurityProtocolFactory.cs
- RC2.cs
- BitmapEffectDrawingContent.cs
- ListViewSortEventArgs.cs
- SafeSecurityHandles.cs
- WebPartVerbCollection.cs
- ImageList.cs
- SourceElementsCollection.cs
- MeasureItemEvent.cs
- PassportAuthenticationEventArgs.cs
- ElementUtil.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- DragDeltaEventArgs.cs
- EventMappingSettings.cs
- RuntimeEnvironment.cs
- ConfigurationPermission.cs
- Operator.cs
- LookupNode.cs
- SHA1.cs
- FilteredReadOnlyMetadataCollection.cs
- OutputCacheSettings.cs
- ThicknessKeyFrameCollection.cs
- PropertyChangedEventArgs.cs
- CharAnimationBase.cs
- StylusDownEventArgs.cs
- WsatServiceCertificate.cs
- CodeConditionStatement.cs
- BindableTemplateBuilder.cs
- DataKey.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- UnauthorizedWebPart.cs
- DbProviderFactories.cs
- BufferBuilder.cs
- DataShape.cs
- Color.cs
- SmiEventSink_DeferedProcessing.cs
- DoubleMinMaxAggregationOperator.cs
- WebPartUtil.cs
- InputDevice.cs
- UpdatableGenericsFeature.cs
- DataGridViewCellConverter.cs
- RtfControlWordInfo.cs
- SqlOuterApplyReducer.cs
- ListGeneralPage.cs
- TemplateKeyConverter.cs
- UnitySerializationHolder.cs
- ProfileSection.cs
- AttributeSetAction.cs
- TypeProvider.cs
- WindowAutomationPeer.cs
- FacetValueContainer.cs
- LogicalCallContext.cs
- OleDbCommandBuilder.cs
- ListViewItemEventArgs.cs
- QueryCursorEventArgs.cs
- BatchStream.cs
- SqlDataSourceSelectingEventArgs.cs
- AuthorizationContext.cs
- HtmlTableRowCollection.cs
- XmlCompatibilityReader.cs
- CommonGetThemePartSize.cs
- FamilyMap.cs
- TreeNodeStyleCollection.cs
- PagedDataSource.cs
- HtmlTextArea.cs
- PermissionSet.cs
- SessionParameter.cs