Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Media / DrawingCollection.cs / 1 / DrawingCollection.cs
//---------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // Description: This file contains non-generated DrawingCollection // methods. // // History: // // 2005/03/18 : [....] - Created it. // //--------------------------------------------------------------------------- using System.Collections; using System.Collections.Generic; using System.Windows.Media.Animation; using System.Windows.Markup; namespace System.Windows.Media { ////// Collection of Drawing objects /// public sealed partial class DrawingCollection : Animatable, IList, IList{ /// /// Appends the entire input DrawingCollection, while only firing a single set of /// public events. If an exception is thrown from the public events, the /// Append operation is rolled back. /// internal void TransactionalAppend(DrawingCollection collectionToAppend) { // Use appendCount to avoid inconsistencies & runaway loops when // this == collectionToAppend, and to ensure collectionToAppend.Count // is only evaluated once. int appendCount = collectionToAppend.Count; // First, append the collection for(int i = 0; i < appendCount; i++) { AddWithoutFiringPublicEvents(collectionToAppend.Internal_GetItem(i)); } // Fire the public Changed event after all the elements have been added. // // If an exception is thrown, then the Append operation is rolled-back without // firing additional events. try { FireChanged(); } catch (Exception) { // Compute the number of elements that existed before the append int beforeAppendCount = Count - appendCount; // Remove the appended elements in reverse order without firing Changed events. for ( int i = Count - 1; // Start at the current last index i >= beforeAppendCount; // Until the previous last index i-- // Move to the preceding index ) { RemoveAtWithoutFiringPublicEvents(i); } // Avoid firing WritePostscript events (e.g., OnChanged) after rolling-back // the current operation. // // This ensures that only a single set of events is fired for both exceptional & // typical cases, and it's likely that firing events would cause another exception. throw; } } } } // 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
- HyperLinkStyle.cs
- XLinq.cs
- TableItemProviderWrapper.cs
- CompoundFileIOPermission.cs
- CodeDomDecompiler.cs
- Utility.cs
- AttachInfo.cs
- _LazyAsyncResult.cs
- baseaxisquery.cs
- EventLogEntry.cs
- DependsOnAttribute.cs
- ColorTransform.cs
- NavigationHelper.cs
- EventBuilder.cs
- ZipIOLocalFileHeader.cs
- GenerateScriptTypeAttribute.cs
- WebCodeGenerator.cs
- FixedSOMPage.cs
- CorrelationService.cs
- Pointer.cs
- AsnEncodedData.cs
- linebase.cs
- CaseInsensitiveComparer.cs
- BrowserCapabilitiesCodeGenerator.cs
- BindingExpressionUncommonField.cs
- DbProviderFactories.cs
- ValidatingReaderNodeData.cs
- DownloadProgressEventArgs.cs
- SmiRecordBuffer.cs
- COSERVERINFO.cs
- XmlSchemaComplexContent.cs
- EntryPointNotFoundException.cs
- WebConfigurationHostFileChange.cs
- ImageBrush.cs
- WinEventTracker.cs
- XmlSchemaSequence.cs
- UnsafeNetInfoNativeMethods.cs
- PtsContext.cs
- DocumentSequence.cs
- AudioFormatConverter.cs
- OfTypeExpression.cs
- EdmScalarPropertyAttribute.cs
- SspiWrapper.cs
- MeasureData.cs
- DBBindings.cs
- ComponentConverter.cs
- DomainConstraint.cs
- SamlSecurityToken.cs
- SortKey.cs
- ConfigXmlDocument.cs
- SaveFileDialog.cs
- DataGridItemCollection.cs
- EventMappingSettings.cs
- ContourSegment.cs
- ManagementObjectCollection.cs
- LexicalChunk.cs
- ExecutedRoutedEventArgs.cs
- AnnotationResourceCollection.cs
- XmlLanguage.cs
- AliasedSlot.cs
- ApplicationContext.cs
- OpacityConverter.cs
- SecurityRequiresReviewAttribute.cs
- DayRenderEvent.cs
- ChannelBinding.cs
- Catch.cs
- Annotation.cs
- EntityViewContainer.cs
- WinEventWrap.cs
- DataGridViewControlCollection.cs
- ByteRangeDownloader.cs
- RegistryKey.cs
- CorePropertiesFilter.cs
- NetworkInterface.cs
- CssTextWriter.cs
- NetMsmqBindingCollectionElement.cs
- PageBuildProvider.cs
- DBCSCodePageEncoding.cs
- KeyEventArgs.cs
- ErrorEventArgs.cs
- WindowVisualStateTracker.cs
- MenuStrip.cs
- ListViewInsertEventArgs.cs
- AuthorizationRuleCollection.cs
- NonParentingControl.cs
- ChooseAction.cs
- BindingExpressionUncommonField.cs
- WebBrowserPermission.cs
- DataGridViewRowsAddedEventArgs.cs
- SqlVersion.cs
- TableDesigner.cs
- MetadataUtil.cs
- DataBoundLiteralControl.cs
- SchemaTypeEmitter.cs
- HttpResponseWrapper.cs
- AggregateNode.cs
- WaitHandleCannotBeOpenedException.cs
- pingexception.cs
- BinaryWriter.cs
- RepeatInfo.cs