Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / adornercollection.cs / 1 / adornercollection.cs
namespace System.Windows.Forms.Design.Behavior {
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
///
///
///
/// A collection that stores objects.
///
///
///
[SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
public sealed class BehaviorServiceAdornerCollection : CollectionBase {
private BehaviorService behaviorService;
///
///
///
/// Initializes a new instance of .
///
///
public BehaviorServiceAdornerCollection(BehaviorService behaviorService) {
this.behaviorService = behaviorService;
}
///
///
///
/// Initializes a new instance of based on another .
///
///
///
/// A from which the contents are copied
///
public BehaviorServiceAdornerCollection(BehaviorServiceAdornerCollection value) {
this.AddRange(value);
}
///
///
///
/// Initializes a new instance of containing any array of objects.
///
///
///
/// A array of objects with which to intialize the collection
///
public BehaviorServiceAdornerCollection(Adorner[] value) {
this.AddRange(value);
}
///
///
/// Represents the entry at the specified index of the .
///
/// The zero-based index of the entry to locate in the collection.
///
/// The entry at the specified index of the collection.
///
/// is outside the valid range of indexes for the collection.
public Adorner this[int index] {
get {
return ((Adorner)(List[index]));
}
set {
List[index] = value;
}
}
///
///
/// Adds a with the specified value to the
/// .
///
/// The to add.
///
/// The index at which the new element was inserted.
///
///
public int Add(Adorner value) {
value.BehaviorService = behaviorService;
return List.Add(value);
}
///
///
/// Copies the elements of an array to the end of the .
///
///
/// An array of type containing the objects to add to the collection.
///
///
/// None.
///
///
public void AddRange(Adorner[] value) {
for (int i = 0; (i < value.Length); i = (i + 1)) {
this.Add(value[i]);
}
}
///
///
///
/// Adds the contents of another to the end of the collection.
///
///
///
/// A containing the objects to add to the collection.
///
///
/// None.
///
///
public void AddRange(BehaviorServiceAdornerCollection value) {
for (int i = 0; (i < value.Count); i = (i + 1)) {
this.Add(value[i]);
}
}
///
///
/// Gets a value indicating whether the
/// contains the specified .
///
/// The to locate.
///
/// if the is contained in the collection;
/// otherwise, .
///
///
public bool Contains(Adorner value) {
return List.Contains(value);
}
///
///
/// Copies the values to a one-dimensional instance at the
/// specified index.
///
/// The one-dimensional that is the destination of the values copied from .
/// The index in where copying begins.
///
/// None.
///
/// is multidimensional. -or- The number of elements in the is greater than the available space between and the end of .
/// is .
/// is less than 's lowbound.
///
public void CopyTo(Adorner[] array, int index) {
List.CopyTo(array, index);
}
///
///
/// Returns the index of a in
/// the .
///
/// The to locate.
///
/// The index of the of in the
/// , if found; otherwise, -1.
///
///
public int IndexOf(Adorner value) {
return List.IndexOf(value);
}
///
///
/// Inserts a into the at the specified index.
///
/// The zero-based index where should be inserted.
/// The to insert.
/// None.
///
public void Insert(int index, Adorner value) {
List.Insert(index, value);
}
///
///
/// Returns an enumerator that can iterate through
/// the .
///
/// None.
///
public new BehaviorServiceAdornerCollectionEnumerator GetEnumerator() {
return new BehaviorServiceAdornerCollectionEnumerator(this);
}
///
///
/// Removes a specific from the
/// .
///
/// The to remove from the .
/// None.
/// is not found in the Collection.
public void Remove(Adorner value) {
List.Remove(value);
}
}
///
public class BehaviorServiceAdornerCollectionEnumerator : object, IEnumerator {
private IEnumerator baseEnumerator;
private IEnumerable temp;
///
public BehaviorServiceAdornerCollectionEnumerator(BehaviorServiceAdornerCollection mappings) {
this.temp = ((IEnumerable)(mappings));
this.baseEnumerator = temp.GetEnumerator();
}
///
public Adorner Current {
get {
return ((Adorner)(baseEnumerator.Current));
}
}
///
///
object IEnumerator.Current {
get {
return baseEnumerator.Current;
}
}
///
public bool MoveNext() {
return baseEnumerator.MoveNext();
}
///
///
bool IEnumerator.MoveNext() {
return baseEnumerator.MoveNext();
}
///
public void Reset() {
baseEnumerator.Reset();
}
///
///
void IEnumerator.Reset() {
baseEnumerator.Reset();
}
}
}
// 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
- EntityDataSourceWrapper.cs
- XmlUTF8TextWriter.cs
- DynamicDataResources.Designer.cs
- TextStore.cs
- BaseValidator.cs
- TreeViewBindingsEditor.cs
- PeerNameRegistration.cs
- ReaderWriterLockWrapper.cs
- AssemblyNameUtility.cs
- FontDriver.cs
- PointLightBase.cs
- ToolStripItemImageRenderEventArgs.cs
- CodeCatchClauseCollection.cs
- Validator.cs
- XPathSelectionIterator.cs
- ProcessHost.cs
- XmlSchemaImport.cs
- MetadataCache.cs
- NameObjectCollectionBase.cs
- CrossAppDomainChannel.cs
- FontEmbeddingManager.cs
- SpeechRecognitionEngine.cs
- PathSegment.cs
- ArcSegment.cs
- KeyedHashAlgorithm.cs
- SymLanguageType.cs
- FlowDocumentPaginator.cs
- AutoSizeToolBoxItem.cs
- FactoryGenerator.cs
- RealizedColumnsBlock.cs
- XomlSerializationHelpers.cs
- MatrixAnimationUsingKeyFrames.cs
- BitmapEffectState.cs
- TableLayout.cs
- HttpMethodConstraint.cs
- ItemContainerGenerator.cs
- _FixedSizeReader.cs
- BitmapEffectDrawing.cs
- AudienceUriMode.cs
- QuaternionAnimation.cs
- GeometryCombineModeValidation.cs
- Type.cs
- XmlMapping.cs
- CalendarKeyboardHelper.cs
- PriorityBindingExpression.cs
- SmtpMail.cs
- DefaultDialogButtons.cs
- XmlEncoding.cs
- ColorInterpolationModeValidation.cs
- StorageComplexTypeMapping.cs
- OleDbErrorCollection.cs
- ProtocolElementCollection.cs
- ModelItemKeyValuePair.cs
- WmiPutTraceRecord.cs
- _SafeNetHandles.cs
- QueryOutputWriter.cs
- SecurityDocument.cs
- ClientSettingsStore.cs
- Trace.cs
- SharedConnectionInfo.cs
- XmlParserContext.cs
- SchemaNotation.cs
- EventProvider.cs
- OutOfMemoryException.cs
- QuaternionRotation3D.cs
- DefaultBindingPropertyAttribute.cs
- IconConverter.cs
- DataObjectCopyingEventArgs.cs
- RowVisual.cs
- CategoryEditor.cs
- PartialClassGenerationTask.cs
- TextServicesCompartment.cs
- XhtmlBasicCalendarAdapter.cs
- GroupItemAutomationPeer.cs
- HostSecurityManager.cs
- SubstitutionDesigner.cs
- AnnotationComponentChooser.cs
- HtmlTextBoxAdapter.cs
- ConstructorNeedsTagAttribute.cs
- XmlParserContext.cs
- AutoResetEvent.cs
- WebHttpDispatchOperationSelector.cs
- Types.cs
- ListViewItem.cs
- GifBitmapDecoder.cs
- Guid.cs
- RoutedPropertyChangedEventArgs.cs
- UniqueIdentifierService.cs
- BaseTemplateCodeDomTreeGenerator.cs
- XmlCharCheckingReader.cs
- InputMethodStateChangeEventArgs.cs
- WebAdminConfigurationHelper.cs
- ActiveDocumentEvent.cs
- InputElement.cs
- OletxResourceManager.cs
- ThemeDictionaryExtension.cs
- SqlExpander.cs
- WindowHideOrCloseTracker.cs
- ConfigDefinitionUpdates.cs
- Serializer.cs