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
- EntityDescriptor.cs
- ConfigXmlSignificantWhitespace.cs
- ToolBar.cs
- Native.cs
- EmptyEnumerator.cs
- ToolStripContentPanel.cs
- AggregateNode.cs
- Queue.cs
- Trigger.cs
- ScopelessEnumAttribute.cs
- RelationshipType.cs
- TableItemPatternIdentifiers.cs
- Preprocessor.cs
- ValidationErrorEventArgs.cs
- StringBuilder.cs
- QilStrConcat.cs
- StrokeCollection2.cs
- Point3DCollection.cs
- RequestResizeEvent.cs
- ToolStripContentPanel.cs
- Thumb.cs
- WebPartTransformerAttribute.cs
- BatchParser.cs
- XpsFilter.cs
- InertiaRotationBehavior.cs
- EventPrivateKey.cs
- SqlExpander.cs
- GlobalizationSection.cs
- RunClient.cs
- ClientScriptManager.cs
- TrackBarRenderer.cs
- ICspAsymmetricAlgorithm.cs
- SafeBitVector32.cs
- UInt64Converter.cs
- WmpBitmapDecoder.cs
- TextPenaltyModule.cs
- CategoryGridEntry.cs
- SortedList.cs
- shaperfactory.cs
- JournalEntryStack.cs
- XmlUtf8RawTextWriter.cs
- TransformerInfo.cs
- FusionWrap.cs
- keycontainerpermission.cs
- DSASignatureFormatter.cs
- HttpModulesInstallComponent.cs
- HwndSource.cs
- PrintingPermissionAttribute.cs
- ImageAnimator.cs
- Size.cs
- ToolStripTemplateNode.cs
- DbConnectionInternal.cs
- SystemIPAddressInformation.cs
- SortedDictionary.cs
- GridViewRowEventArgs.cs
- NamedPipeAppDomainProtocolHandler.cs
- InertiaRotationBehavior.cs
- BooleanExpr.cs
- ProcessProtocolHandler.cs
- ReadOnlyAttribute.cs
- QueryOpcode.cs
- GatewayIPAddressInformationCollection.cs
- QualificationDataAttribute.cs
- StreamReader.cs
- AttachmentCollection.cs
- basenumberconverter.cs
- LinkDescriptor.cs
- EllipseGeometry.cs
- StateRuntime.cs
- ObjectList.cs
- DesignerDataColumn.cs
- DecodeHelper.cs
- SpellerStatusTable.cs
- PinnedBufferMemoryStream.cs
- DataGridViewCellEventArgs.cs
- Graph.cs
- DataListItemEventArgs.cs
- Variant.cs
- BrushConverter.cs
- NumberFormatter.cs
- DeferredSelectedIndexReference.cs
- DeploymentSectionCache.cs
- VSDExceptions.cs
- SizeConverter.cs
- Evidence.cs
- ParameterElement.cs
- sqlinternaltransaction.cs
- ListItemViewControl.cs
- MaterializeFromAtom.cs
- DomNameTable.cs
- PlainXmlWriter.cs
- _AutoWebProxyScriptHelper.cs
- RegexGroup.cs
- HtmlElementErrorEventArgs.cs
- ListViewContainer.cs
- GlobalEventManager.cs
- DeferredTextReference.cs
- FixedSOMLineRanges.cs
- DrawingState.cs
- GeneralTransform3DTo2D.cs