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 IEnumeratorGetEnumerator() { 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
- AutomationEvent.cs
- MissingManifestResourceException.cs
- ObjectCloneHelper.cs
- ConfigurationSection.cs
- XamlWriter.cs
- NonBatchDirectoryCompiler.cs
- ContentType.cs
- PeerNameRecordCollection.cs
- DSASignatureFormatter.cs
- SamlAction.cs
- TypeCodeDomSerializer.cs
- AliasedSlot.cs
- Rule.cs
- HtmlInputButton.cs
- CultureSpecificStringDictionary.cs
- CombinedGeometry.cs
- Quaternion.cs
- Path.cs
- FloaterParaClient.cs
- PopupEventArgs.cs
- TaskFileService.cs
- ElementsClipboardData.cs
- HtmlAnchor.cs
- Processor.cs
- SecurityKeyType.cs
- WizardStepBase.cs
- HttpRequestWrapper.cs
- Errors.cs
- ItemType.cs
- _LocalDataStoreMgr.cs
- DataGridTable.cs
- EncodingInfo.cs
- TextServicesCompartmentContext.cs
- _CacheStreams.cs
- FrameworkObject.cs
- Setter.cs
- AuthStoreRoleProvider.cs
- HttpMethodAttribute.cs
- _ShellExpression.cs
- ChangePassword.cs
- DataSourceViewSchemaConverter.cs
- BindingListCollectionView.cs
- DesignerActionVerbItem.cs
- DependencyPropertyAttribute.cs
- ImageIndexConverter.cs
- EndEvent.cs
- SqlRowUpdatedEvent.cs
- SizeChangedEventArgs.cs
- ListManagerBindingsCollection.cs
- ConfigUtil.cs
- ImageUrlEditor.cs
- AutoSizeComboBox.cs
- DataGridViewRowPrePaintEventArgs.cs
- DataBoundControl.cs
- DirectionalLight.cs
- SapiGrammar.cs
- ChildChangedEventArgs.cs
- ThreadPool.cs
- SpecularMaterial.cs
- WebPartVerb.cs
- ValidationRuleCollection.cs
- MemoryMappedView.cs
- ProviderSettings.cs
- ContextBase.cs
- MachineKeyConverter.cs
- ZipIORawDataFileBlock.cs
- ReadContentAsBinaryHelper.cs
- MouseOverProperty.cs
- EventBookmark.cs
- TdsEnums.cs
- MethodCallTranslator.cs
- RefType.cs
- SortDescriptionCollection.cs
- PriorityBindingExpression.cs
- ServiceThrottlingElement.cs
- IncrementalReadDecoders.cs
- WarningException.cs
- SecurityDocument.cs
- Exceptions.cs
- NonSerializedAttribute.cs
- FrugalList.cs
- PrinterSettings.cs
- ToolboxCategory.cs
- SaveFileDialog.cs
- WeakEventManager.cs
- GacUtil.cs
- PostBackOptions.cs
- DurableRuntimeValidator.cs
- DbConnectionPoolGroupProviderInfo.cs
- ActionFrame.cs
- counter.cs
- Int64KeyFrameCollection.cs
- Debugger.cs
- DBParameter.cs
- ExpressionBuilder.cs
- DesignerLoader.cs
- TextEndOfSegment.cs
- _UriTypeConverter.cs
- AnonymousIdentificationModule.cs
- WebFormsRootDesigner.cs