Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; ////// /// [ ListBindable(false), SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface") // Consider adding an IListRepresents a collection of selected ///objects in the /// control. 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]; } } /// /// /// 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 a ///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); } } ///Adds all the ///objects from the provided linked list to this collection. [ 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Item.cs
- HtmlTernaryTree.cs
- TextMessageEncodingElement.cs
- ColumnResizeUndoUnit.cs
- ClosableStream.cs
- Size.cs
- TextServicesCompartmentEventSink.cs
- XmlSchema.cs
- ConfigurationValues.cs
- SchemaObjectWriter.cs
- KoreanCalendar.cs
- BrowserCapabilitiesFactoryBase.cs
- MeasureData.cs
- OlePropertyStructs.cs
- CheckBoxRenderer.cs
- MimeImporter.cs
- DrawListViewSubItemEventArgs.cs
- ElapsedEventArgs.cs
- EdmFunction.cs
- x509store.cs
- glyphs.cs
- Translator.cs
- BitmapEffectInput.cs
- Options.cs
- ExpressionVisitor.cs
- EncodingTable.cs
- ImageButton.cs
- FrameworkContentElement.cs
- ActionItem.cs
- HotSpotCollection.cs
- XmlNamespaceManager.cs
- CodeMemberField.cs
- SqlBooleanizer.cs
- SimpleTextLine.cs
- UserControl.cs
- OleDbRowUpdatingEvent.cs
- ValueExpressions.cs
- DataFieldConverter.cs
- BaseTransportHeaders.cs
- AttachedAnnotation.cs
- DataBindingHandlerAttribute.cs
- IntersectQueryOperator.cs
- OraclePermissionAttribute.cs
- XmlQueryOutput.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ControlValuePropertyAttribute.cs
- SafeNativeMethods.cs
- SqlServices.cs
- IssuanceLicense.cs
- TriState.cs
- OdbcStatementHandle.cs
- SQLDateTime.cs
- CodeSnippetTypeMember.cs
- MobileControlDesigner.cs
- DocumentXPathNavigator.cs
- Misc.cs
- CommandLibraryHelper.cs
- _AutoWebProxyScriptHelper.cs
- PointAnimationClockResource.cs
- ImageBrush.cs
- CheckBoxStandardAdapter.cs
- EntitySet.cs
- HtmlControl.cs
- Content.cs
- ModelVisual3D.cs
- mda.cs
- CharacterBuffer.cs
- MdiWindowListItemConverter.cs
- FileRecordSequenceCompletedAsyncResult.cs
- RelationshipEndMember.cs
- ParameterModifier.cs
- Select.cs
- ScheduleChanges.cs
- ButtonFlatAdapter.cs
- ToolStripItemEventArgs.cs
- InputDevice.cs
- MatrixUtil.cs
- ListItemCollection.cs
- UDPClient.cs
- BatchWriter.cs
- ProfilePropertySettingsCollection.cs
- OrthographicCamera.cs
- XsdValidatingReader.cs
- WebControl.cs
- CacheVirtualItemsEvent.cs
- SocketElement.cs
- MethodExpr.cs
- OdbcConnectionOpen.cs
- basecomparevalidator.cs
- DefaultEventAttribute.cs
- SmiContext.cs
- PixelFormats.cs
- BinaryFormatter.cs
- WebPartMinimizeVerb.cs
- CategoryNameCollection.cs
- CompilerLocalReference.cs
- QueryLifecycle.cs
- RecordConverter.cs
- odbcmetadatacolumnnames.cs
- Label.cs