Code:
/ 4.0 / 4.0 / 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. /****************************************************************************\ * * 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; // Collection using 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
- HttpCookieCollection.cs
- ScriptControlManager.cs
- PresentationSource.cs
- RawKeyboardInputReport.cs
- SplashScreenNativeMethods.cs
- DataGridViewCellMouseEventArgs.cs
- UnrecognizedAssertionsBindingElement.cs
- ResourceAttributes.cs
- FormattedTextSymbols.cs
- AvTraceFormat.cs
- FloatUtil.cs
- SqlBooleanizer.cs
- DataAdapter.cs
- IndexerNameAttribute.cs
- PipelineModuleStepContainer.cs
- TrackingMemoryStreamFactory.cs
- TargetConverter.cs
- EventlogProvider.cs
- Int32RectConverter.cs
- WebPartCloseVerb.cs
- AssociationTypeEmitter.cs
- EmbeddedMailObjectCollectionEditor.cs
- ThemeDictionaryExtension.cs
- WindowsUpDown.cs
- SqlBuffer.cs
- ComEventsInfo.cs
- PagerSettings.cs
- ClockGroup.cs
- IndentTextWriter.cs
- RadioButtonPopupAdapter.cs
- TakeQueryOptionExpression.cs
- DispatcherTimer.cs
- RelationshipSet.cs
- StringReader.cs
- OdbcPermission.cs
- FilterEventArgs.cs
- ModifierKeysConverter.cs
- WebConfigurationFileMap.cs
- Bitmap.cs
- WebExceptionStatus.cs
- BezierSegment.cs
- SatelliteContractVersionAttribute.cs
- safesecurityhelperavalon.cs
- IConvertible.cs
- AnnotationComponentChooser.cs
- DesignerOptions.cs
- DataBindingExpressionBuilder.cs
- DataServiceQueryProvider.cs
- ObjectListCommand.cs
- MarginCollapsingState.cs
- TaskDesigner.cs
- NavigationService.cs
- updateconfighost.cs
- PrintSchema.cs
- PropertyTabAttribute.cs
- TextRenderingModeValidation.cs
- ConfigurationErrorsException.cs
- ApplicationContext.cs
- CngProperty.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SplitterPanel.cs
- DocumentPageViewAutomationPeer.cs
- SocketException.cs
- InstanceLockLostException.cs
- MaterialGroup.cs
- ImplicitInputBrush.cs
- CompositeFontFamily.cs
- TripleDES.cs
- Trace.cs
- SystemIPv4InterfaceProperties.cs
- WebPartMenu.cs
- RemotingException.cs
- MimeImporter.cs
- ColumnMapProcessor.cs
- PhoneCall.cs
- AssociationProvider.cs
- AttachedPropertiesService.cs
- AuthorizationRuleCollection.cs
- BreakRecordTable.cs
- TextDecorationCollection.cs
- MultiPageTextView.cs
- FormatConvertedBitmap.cs
- AssemblySettingAttributes.cs
- MSG.cs
- WindowPattern.cs
- QuarticEase.cs
- TagPrefixAttribute.cs
- XsltLibrary.cs
- ComboBoxAutomationPeer.cs
- PropertyPushdownHelper.cs
- StatusBarItemAutomationPeer.cs
- FontFamilyValueSerializer.cs
- ActiveXSite.cs
- COM2Properties.cs
- IconConverter.cs
- SetStateEventArgs.cs
- Content.cs
- InheritanceContextHelper.cs
- PropertyToken.cs
- ProtectedConfigurationProviderCollection.cs