Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / TriggerCollection.cs / 1305600 / 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
- DataIdProcessor.cs
- TypeExtensions.cs
- TextDecorationCollectionConverter.cs
- ControlPaint.cs
- BookmarkWorkItem.cs
- UserMapPath.cs
- AnnotationResourceCollection.cs
- RsaSecurityTokenAuthenticator.cs
- PagesChangedEventArgs.cs
- TextDecorationCollection.cs
- UIElementParaClient.cs
- TransferMode.cs
- InfoCardAsymmetricCrypto.cs
- XmlCharCheckingReader.cs
- altserialization.cs
- __ComObject.cs
- UpdatePanelTriggerCollection.cs
- NativeMethods.cs
- CssStyleCollection.cs
- DocumentApplicationJournalEntry.cs
- DelegateSerializationHolder.cs
- UInt64.cs
- TextRunProperties.cs
- PropertyOverridesDialog.cs
- Region.cs
- DropAnimation.xaml.cs
- CollectionViewGroup.cs
- SelectorItemAutomationPeer.cs
- GacUtil.cs
- SamlAdvice.cs
- MarkupCompiler.cs
- PageParser.cs
- AssemblyNameProxy.cs
- SoapTypeAttribute.cs
- SmiEventStream.cs
- MaskDesignerDialog.cs
- CodeTypeParameterCollection.cs
- WebPartEditorOkVerb.cs
- FontSource.cs
- BamlReader.cs
- JavaScriptString.cs
- DropSource.cs
- BaseCodeDomTreeGenerator.cs
- DataShape.cs
- CalendarDayButton.cs
- StringAnimationBase.cs
- ToolStripTextBox.cs
- DiscoveryServerProtocol.cs
- BaseProcessProtocolHandler.cs
- Message.cs
- CollectionBase.cs
- ConstraintStruct.cs
- WebPartAddingEventArgs.cs
- XmlValueConverter.cs
- RegexCompiler.cs
- FileLoadException.cs
- FlowLayoutSettings.cs
- DesignerTransaction.cs
- TextPenaltyModule.cs
- Timeline.cs
- LifetimeServices.cs
- DocumentAutomationPeer.cs
- DbBuffer.cs
- PreservationFileReader.cs
- ObjectDataSourceDisposingEventArgs.cs
- DataGrid.cs
- FastPropertyAccessor.cs
- ImageInfo.cs
- GifBitmapDecoder.cs
- ReceiveActivityValidator.cs
- XmlILStorageConverter.cs
- CompoundFileStreamReference.cs
- BuildProvider.cs
- DataRecordInternal.cs
- Scene3D.cs
- NetworkInterface.cs
- SrgsItemList.cs
- ApplicationInterop.cs
- BindingUtils.cs
- CanonicalFontFamilyReference.cs
- CategoryGridEntry.cs
- PropertyTabAttribute.cs
- BuildProviderUtils.cs
- QilTypeChecker.cs
- HostingPreferredMapPath.cs
- SymLanguageType.cs
- HttpWebRequestElement.cs
- TimeSpanStorage.cs
- BuildProviderAppliesToAttribute.cs
- SslStream.cs
- TemplatedWizardStep.cs
- Rect3D.cs
- SplitterCancelEvent.cs
- LinkLabel.cs
- AssemblyNameUtility.cs
- Membership.cs
- TextServicesHost.cs
- DataViewSetting.cs
- FamilyTypeface.cs
- Rotation3DAnimationBase.cs