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
- AttributedMetaModel.cs
- PropertyPath.cs
- UIElementAutomationPeer.cs
- AnnouncementService.cs
- SiteMapNodeCollection.cs
- XsdBuildProvider.cs
- messageonlyhwndwrapper.cs
- SmtpSection.cs
- CodeTypeReferenceCollection.cs
- TextSimpleMarkerProperties.cs
- ContextMenuStrip.cs
- FontSizeConverter.cs
- TraceInternal.cs
- UIAgentAsyncBeginRequest.cs
- SmtpFailedRecipientException.cs
- WsdlImporterElement.cs
- X509Utils.cs
- DataGridCellItemAutomationPeer.cs
- SchemaComplexType.cs
- ClientConvert.cs
- ConfigurationErrorsException.cs
- ProtocolViolationException.cs
- WebPart.cs
- ApplicationException.cs
- HelpFileFileNameEditor.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- SqlDataSourceSummaryPanel.cs
- _AcceptOverlappedAsyncResult.cs
- DateBoldEvent.cs
- RectValueSerializer.cs
- UITypeEditor.cs
- QueryMatcher.cs
- _RegBlobWebProxyDataBuilder.cs
- TransformerInfoCollection.cs
- handlecollector.cs
- ELinqQueryState.cs
- Compiler.cs
- ClientScriptManagerWrapper.cs
- StrokeIntersection.cs
- ScalarConstant.cs
- UserControl.cs
- SiteMapNode.cs
- PartialClassGenerationTask.cs
- DynamicActivity.cs
- Matrix.cs
- TextEndOfLine.cs
- TypeConverterHelper.cs
- Subtree.cs
- ExportFileRequest.cs
- InternalCache.cs
- SendMailErrorEventArgs.cs
- SqlFunctionAttribute.cs
- DockEditor.cs
- SoundPlayer.cs
- WeakReferenceKey.cs
- TextTreeRootNode.cs
- PageFunction.cs
- LZCodec.cs
- _SslState.cs
- ContextStack.cs
- WarningException.cs
- DefaultValueTypeConverter.cs
- ClientTargetCollection.cs
- Validator.cs
- DrawingGroup.cs
- Int64Storage.cs
- FloatMinMaxAggregationOperator.cs
- Calendar.cs
- CompositeControl.cs
- GroupJoinQueryOperator.cs
- StyleConverter.cs
- TextMetrics.cs
- InputProcessorProfiles.cs
- XmlRawWriter.cs
- StringUtil.cs
- HtmlControlPersistable.cs
- TemplateKeyConverter.cs
- PageAsyncTask.cs
- ProcessHost.cs
- RemotingException.cs
- MailAddress.cs
- NotifyCollectionChangedEventArgs.cs
- DateTimePickerDesigner.cs
- TdsParser.cs
- BooleanFacetDescriptionElement.cs
- Pen.cs
- XmlSchemaAttributeGroupRef.cs
- RootBuilder.cs
- WorkflowViewElement.cs
- ForeignConstraint.cs
- NullableFloatAverageAggregationOperator.cs
- HtmlSelect.cs
- Site.cs
- ResourceReferenceExpressionConverter.cs
- ClickablePoint.cs
- AppDomain.cs
- relpropertyhelper.cs
- PackUriHelper.cs
- StickyNote.cs
- GeneralTransform3D.cs