Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / DocumentReferenceCollection.cs / 1 / DocumentReferenceCollection.cs
//----------------------------------------------------------------------------
//
// Copyright (C) 2004 by Microsoft Corporation. All rights reserved.
//
//
// Description:
// Implements the DocumentReferenceCollection as holder for a collection
// of DocumentReference
//
// History:
// 05/07/2004 - [....] ([....]) - Created.
//
//
//---------------------------------------------------------------------------
namespace System.Windows.Documents
{
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
//=====================================================================
///
/// DocumentReferenceCollection is an ordered collection of DocumentReference
///
[CLSCompliant(false)]
public sealed class DocumentReferenceCollection : IEnumerable, INotifyCollectionChanged
{
//-------------------------------------------------------------------
//
// Connstructors
//
//----------------------------------------------------------------------
#region Constructors
internal DocumentReferenceCollection()
{
}
#endregion Constructors
//-------------------------------------------------------------------
//
// Public Methods
//
//----------------------------------------------------------------------
#region Public Methods
#region IEnumerable
///
///
///
public IEnumerator GetEnumerator()
{
return _InternalList.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return ((IEnumerable)this).GetEnumerator();
}
#endregion IEnumerable
///
///
///
public void Add(DocumentReference item)
{
int count = _InternalList.Count;
_InternalList.Add(item);
OnCollectionChanged(NotifyCollectionChangedAction.Add, item, count);
}
///
/// Passes in document reference array to be copied
///
public void CopyTo(DocumentReference[] array, int arrayIndex)
{
_InternalList.CopyTo(array, arrayIndex);
}
#endregion Public Methods
#region Public Properties
///
/// Count of Document References in collection
///
public int Count
{
get
{
return _InternalList.Count;
}
}
///
///
///
public DocumentReference this[int index]
{
get
{
return _InternalList[index];
}
}
#endregion Public Properties
//--------------------------------------------------------------------
//
// Public Events
//
//---------------------------------------------------------------------
#region Public Event
///
/// Occurs when the collection changes, either by adding or removing an item.
///
///
/// see
///
public event NotifyCollectionChangedEventHandler CollectionChanged;
#endregion Public Event
//--------------------------------------------------------------------
//
// private Properties
//
//---------------------------------------------------------------------
#region Private Properties
// Aggregated IList
private IList _InternalList
{
get
{
if (_internalList == null)
{
_internalList = new List();
}
return _internalList;
}
}
#endregion Private Properties
#region Private Methods
//-------------------------------------------------------------------
//
// Private Methods
//
//---------------------------------------------------------------------
// fire CollectionChanged event to any listeners
private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index)
{
if (CollectionChanged != null)
{
NotifyCollectionChangedEventArgs args;
args = new NotifyCollectionChangedEventArgs(action, item, index);
CollectionChanged(this, args);
}
}
#endregion Private Methods
//--------------------------------------------------------------------
//
// Private Fields
//
//---------------------------------------------------------------------
#region Private Fields
private List _internalList;
#endregion Private Fields
}
}
// 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
- CqlLexer.cs
- ClockGroup.cs
- GregorianCalendarHelper.cs
- StackSpiller.Generated.cs
- SafeArrayRankMismatchException.cs
- HitTestDrawingContextWalker.cs
- SQLGuidStorage.cs
- XmlIlGenerator.cs
- XmlDocumentFragment.cs
- CompoundFileIOPermission.cs
- AppendHelper.cs
- InheritablePropertyChangeInfo.cs
- DataServiceRequestException.cs
- KnownBoxes.cs
- DesignerAttribute.cs
- SQLMembershipProvider.cs
- DSASignatureFormatter.cs
- StylusButtonEventArgs.cs
- DecoderFallbackWithFailureFlag.cs
- TransformedBitmap.cs
- AssociationTypeEmitter.cs
- Decoder.cs
- MimeBasePart.cs
- SecurityUtils.cs
- ReadonlyMessageFilter.cs
- DbProviderConfigurationHandler.cs
- Model3DGroup.cs
- OdbcEnvironment.cs
- SettingsBase.cs
- StylusPoint.cs
- RegexEditorDialog.cs
- GeneratedContractType.cs
- ArrayList.cs
- PreviewControlDesigner.cs
- FileUtil.cs
- DataRowChangeEvent.cs
- GridPatternIdentifiers.cs
- TagElement.cs
- WinCategoryAttribute.cs
- ImpersonationContext.cs
- HttpCachePolicyElement.cs
- MultipleViewPattern.cs
- ContextMenuStrip.cs
- ToolStripSystemRenderer.cs
- BaseCodeDomTreeGenerator.cs
- NavigatingCancelEventArgs.cs
- DataGridViewComboBoxEditingControl.cs
- UriSection.cs
- ColumnHeader.cs
- FixedFlowMap.cs
- WebBrowserUriTypeConverter.cs
- TextContainerChangedEventArgs.cs
- RegistryKey.cs
- MimeMultiPart.cs
- DynamicEndpoint.cs
- AuthenticatingEventArgs.cs
- RSAOAEPKeyExchangeFormatter.cs
- XsdCachingReader.cs
- RuntimeEnvironment.cs
- DataColumnChangeEvent.cs
- DBSchemaTable.cs
- Grammar.cs
- StreamSecurityUpgradeInitiator.cs
- TraceSwitch.cs
- PngBitmapDecoder.cs
- Mouse.cs
- __Filters.cs
- UIElementAutomationPeer.cs
- FormViewInsertedEventArgs.cs
- Content.cs
- UnauthorizedWebPart.cs
- ToolStripGripRenderEventArgs.cs
- WorkflowFileItem.cs
- WorkBatch.cs
- UriParserTemplates.cs
- EventLogPermissionAttribute.cs
- SourceFileInfo.cs
- ProviderConnectionPointCollection.cs
- KnownTypeAttribute.cs
- AttributeCallbackBuilder.cs
- XsdBuildProvider.cs
- RadioButton.cs
- DesignerGenericWebPart.cs
- HostedAspNetEnvironment.cs
- PathFigureCollectionValueSerializer.cs
- UserMapPath.cs
- BufferedStream.cs
- BinaryParser.cs
- WebServiceHost.cs
- RoutedEventConverter.cs
- SessionConnectionReader.cs
- NamespaceList.cs
- SqlTypesSchemaImporter.cs
- HwndPanningFeedback.cs
- JournalNavigationScope.cs
- AttributeSetAction.cs
- SimpleLine.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- HttpConfigurationContext.cs
- ColumnTypeConverter.cs