Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewSelectedCellCollection.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ParameterCollectionEditorForm.cs
- InheritanceRules.cs
- GroupStyle.cs
- BaseValidator.cs
- GeneralTransform3DCollection.cs
- objectresult_tresulttype.cs
- SqlCommandBuilder.cs
- WebEventTraceProvider.cs
- MessageSecurityVersionConverter.cs
- CacheOutputQuery.cs
- Permission.cs
- RelationalExpressions.cs
- ListParaClient.cs
- CompositeActivityValidator.cs
- DataGridViewCellFormattingEventArgs.cs
- HttpContextBase.cs
- CursorInteropHelper.cs
- VectorAnimation.cs
- SQLBinary.cs
- DefaultTextStoreTextComposition.cs
- ISCIIEncoding.cs
- ScriptHandlerFactory.cs
- ChangeProcessor.cs
- ScriptControlDescriptor.cs
- RouteParser.cs
- GridViewSelectEventArgs.cs
- Stack.cs
- PreApplicationStartMethodAttribute.cs
- HttpHandlerActionCollection.cs
- TreeNode.cs
- ListenerElementsCollection.cs
- DataSourceViewSchemaConverter.cs
- PropertyAccessVisitor.cs
- OrthographicCamera.cs
- XmlChildEnumerator.cs
- ExpressionEditorAttribute.cs
- CqlParserHelpers.cs
- DataKey.cs
- EventHandlerList.cs
- ManipulationDelta.cs
- ConfigurationSettings.cs
- DetailsViewDeletedEventArgs.cs
- PageThemeBuildProvider.cs
- SecurityTokenProvider.cs
- DataGridColumnStyleMappingNameEditor.cs
- MiniModule.cs
- AppSettingsReader.cs
- XsltLoader.cs
- NonValidatingSecurityTokenAuthenticator.cs
- NativeStructs.cs
- NamedElement.cs
- GcSettings.cs
- DebugHandleTracker.cs
- WebPartConnectionsConfigureVerb.cs
- SafeFindHandle.cs
- StandardOleMarshalObject.cs
- PromptStyle.cs
- Column.cs
- FocusManager.cs
- KeyValuePairs.cs
- Zone.cs
- SrgsGrammar.cs
- _TimerThread.cs
- Opcode.cs
- DocumentReferenceCollection.cs
- WindowsIPAddress.cs
- LineServicesRun.cs
- ReferentialConstraintRoleElement.cs
- AuthorizationRule.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- EntityDataSourceChangingEventArgs.cs
- QueryAccessibilityHelpEvent.cs
- DesignerView.xaml.cs
- CompatibleIComparer.cs
- JavascriptCallbackResponseProperty.cs
- CommonObjectSecurity.cs
- DrawingDrawingContext.cs
- InvalidComObjectException.cs
- FilterQueryOptionExpression.cs
- WrapperEqualityComparer.cs
- Timer.cs
- SynchronizedInputPattern.cs
- DiagnosticTrace.cs
- SourceElementsCollection.cs
- CodeDomSerializerException.cs
- MsmqBindingElementBase.cs
- MenuItemBinding.cs
- StylusButton.cs
- TableRowCollection.cs
- TranslateTransform3D.cs
- XmlQueryCardinality.cs
- CommandManager.cs
- DateBoldEvent.cs
- DesignSurfaceManager.cs
- datacache.cs
- AppearanceEditorPart.cs
- IDReferencePropertyAttribute.cs
- ClientUtils.cs
- FlowDocument.cs
- SQLDecimal.cs