Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / TriggerCollection.cs / 1 / TriggerCollection.cs
/****************************************************************************\ * * File: TriggerCollection.cs * * A collection of TriggerBase-derived classes. See use in Style.cs and other * places. * * Copyright (C) by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System.Diagnostics; using System.Collections.Generic; using System.Collections.ObjectModel; // Collectionusing MS.Internal; namespace System.Windows { /// /// A set of TriggerBase's /// [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)] public sealed class TriggerCollection : Collection{ #region Constructors internal TriggerCollection() : this(null) { } internal TriggerCollection(FrameworkElement owner) : base() { _sealed = false; _owner = owner; } #endregion Constructors #region ProtectedMethods /// /// ClearItems override /// protected override void ClearItems() { CheckSealed(); OnClear(); base.ClearItems(); } ////// InsertItem override /// protected override void InsertItem(int index, TriggerBase item) { CheckSealed(); TriggerBaseValidation(item); OnAdd(item); base.InsertItem(index, item); } ////// RemoveItem override /// protected override void RemoveItem(int index) { CheckSealed(); TriggerBase triggerBase = this[index]; OnRemove(triggerBase); base.RemoveItem(index); } ////// SetItem override /// protected override void SetItem(int index, TriggerBase item) { CheckSealed(); TriggerBaseValidation(item); OnAdd(item); base.SetItem(index, item); } #endregion ProtectedMethods #region PublicMethods ////// Returns the sealed state of this object. If true, any attempt /// at modifying the state of this object will trigger an exception. /// public bool IsSealed { get { return _sealed; } } #endregion PublicMethods #region InternalMethods internal void Seal() { Debug.Assert (Owner == null); _sealed = true; // Seal all the setters for (int i=0; i= 0; i--) { InheritanceContextHelper.RemoveContextFromObject(Owner, this[i]); } } } #endregion PrivateMethods #region Data private bool _sealed; private FrameworkElement _owner; #endregion Data } } // 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
- MonikerHelper.cs
- DataGridCaption.cs
- WebPartTracker.cs
- XmlRawWriter.cs
- XmlSchemaDocumentation.cs
- SafeThemeHandle.cs
- UriTemplateEquivalenceComparer.cs
- CornerRadius.cs
- TableLayoutPanelCellPosition.cs
- Transactions.cs
- MenuScrollingVisibilityConverter.cs
- EntityTypeEmitter.cs
- Rules.cs
- TrackingQueryElement.cs
- UnsafeNativeMethods.cs
- ResourceReferenceExpression.cs
- ImageListImageEditor.cs
- SoapHeaders.cs
- IndicCharClassifier.cs
- DynamicRouteExpression.cs
- BuildProvidersCompiler.cs
- AspCompat.cs
- Nullable.cs
- DropSource.cs
- ViewCellRelation.cs
- FunctionImportElement.cs
- PrintDocument.cs
- ThemeDictionaryExtension.cs
- DirtyTextRange.cs
- DbReferenceCollection.cs
- DefaultTraceListener.cs
- ToolStripDropDownDesigner.cs
- FormsAuthenticationCredentials.cs
- CoTaskMemSafeHandle.cs
- parserscommon.cs
- TemplateKeyConverter.cs
- DesignerListAdapter.cs
- UiaCoreProviderApi.cs
- MimeWriter.cs
- TableStyle.cs
- TreeViewItemAutomationPeer.cs
- QueueProcessor.cs
- ItemMap.cs
- ActivationServices.cs
- HashAlgorithm.cs
- RectAnimation.cs
- StylusPointPropertyInfoDefaults.cs
- BinaryObjectReader.cs
- InputScope.cs
- SafeMILHandle.cs
- ErrorWrapper.cs
- StringAttributeCollection.cs
- PropertyGridDesigner.cs
- UIElement3D.cs
- LoginStatusDesigner.cs
- activationcontext.cs
- DataGridViewComboBoxColumn.cs
- StorageSetMapping.cs
- MSAAEventDispatcher.cs
- XmlObjectSerializerReadContext.cs
- CalculatedColumn.cs
- ToolStripPanelCell.cs
- ListSortDescriptionCollection.cs
- ExtentCqlBlock.cs
- TTSEvent.cs
- EntityViewGenerator.cs
- figurelengthconverter.cs
- FocusTracker.cs
- FixedSOMImage.cs
- HighlightVisual.cs
- Delegate.cs
- SqlFormatter.cs
- EntityConnectionStringBuilder.cs
- ComboBoxItem.cs
- ConfigXmlSignificantWhitespace.cs
- InvokeGenerator.cs
- DataRowCollection.cs
- MetadataUtil.cs
- TaskForm.cs
- MultiByteCodec.cs
- StringUtil.cs
- Decorator.cs
- ErrorHandler.cs
- LogoValidationException.cs
- StandardBindingReliableSessionElement.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- WebEncodingValidatorAttribute.cs
- Latin1Encoding.cs
- _CookieModule.cs
- XsdValidatingReader.cs
- DecoderFallbackWithFailureFlag.cs
- Membership.cs
- HScrollBar.cs
- EdgeProfileValidation.cs
- TypeForwardedFromAttribute.cs
- OutputCacheModule.cs
- Environment.cs
- MailBnfHelper.cs
- AuthorizationRule.cs
- __Error.cs